“My memory is of Professor Yoo coming over to see the counsel to the president and I was invited in the meeting with the three of us, and he gave us an outline of ‘here are the subjects I’m going to address,’ ” Mr. Addington said.

“We said, ‘Good,’ ” he added. “And he goes off and writes the opinion.”

Mr. Yoo denied assertions by some officials that he had sought to bypass Mr. Ashcroft in writing the 2002 memorandum and other opinions favored by the White House.

Mr. Yoo, who worked in the Office of Legal Counsel, said he had supplied some drafts of the memorandum and its final version, signed by his boss at the time, Assistant Attorney General Jay S. Bybee, to top aides to Mr. Ashcroft and his deputy, Larry Thompson. In written testimony, he said Mr. Ashcroft’s staff “made edits to the opinion” and worked on it “up until the very minute it was signed.”

Image John Yoo, a former Justice Department official, testified about writing several major legal opinions on the subject of torture. Credit... Andrew Councill for The New York Times

In the view of some human rights advocates, the 50-page memorandum set the stage for abusive interrogations by both the Central Intelligence Agency, which had sought the legal opinion, and the Defense Department, by giving a stamp of legality to even extreme interrogation measures. After Mr. Yoo and Mr. Bybee left the Justice Department, their successors formally withdrew the memorandum.