Commit 9763f86
committed
fee: document the synchronous CEK-absorption guarantee (FIL-569)
Encrypt/Decrypt wipe their CEK with defer zero(cek) as soon as encryptStream /
openStream return — before the returned reader is read. Document that guarantee
where it's provided, not just where it's relied upon: encryptStream wraps the
CEK to recipients and calls aesstream.NewWriter (which internalizes the key into
a GCM AEAD) synchronously before returning; openStream calls aesstream.NewReader
likewise. So neither retains the cek slice past its own return — the background
encryption goroutine and the lazy decrypt reads both work from the internalized
key, never the slice — and a caller may wipe cek immediately.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fyx4RZx2j88mTQyeavbs791 parent 1214a14 commit 9763f86
1 file changed
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
235 | 242 | | |
236 | 243 | | |
237 | 244 | | |
| |||
437 | 444 | | |
438 | 445 | | |
439 | 446 | | |
440 | | - | |
441 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
442 | 454 | | |
443 | 455 | | |
444 | 456 | | |
| |||
0 commit comments