Repository navigation
AES-GCM x86-64: one proof of the VAES encryption loop, in place and out of place - #4409
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ajQWvqXkQxFyWZxghqxBG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ajQWvqXkQxFyWZxghqxBG
reaperhulk
enabled stacked auto-merge
November 7, 2026 09:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows pyca/verified-garbage#4391, which made the 256-bit out-of-place encryption loop (
StitchTo) use the in-place batch. Its loop proofs (body, first group, loop, last group and stores) were still a separate copy of the in-place ones. Now one proof covers both outputs, and both sets of lemmas are its cases. The code is unchanged.Proofs.
Stitch/Loop.lean:EInvM ixisEInvover the output (wp ix, the data or the buffer atr10), withrdxat the output and, out of place,r8holdingsrc - dst.bodyM_okis the body for both, throughbatchM_okin its load mode.QG.keepWnow takes any base for the blocks the GHASH loads read, so it keeps the hash of the ciphertext in the output, which the batch's writes skip by their offsets.body_okis the in-place case.Stitch/Enc.lean:ReadyM,firstM_ok,cmpEM_ok,loopEM_from_ok,EPostM(the output block by block),finalM_okandencTailM_ok.first_ok,cmpE_ok,loopE_from_ok,loopE_ok,final_okandencTail_okare the in-place cases.StitchTo/Loop.lean:bodyTo_ok,firstTo_ok,loopE_ok,finalTo_okandencTailTo_okare the out-of-place cases, throughEInvTo.toM,EInvM.toTo,ReadyTo.toMandEPostM.toEPostTo. Their statements are unchanged, so their users (StitchR/OnePass.lean,StitchR/RemETo.lean,Prepared/OutOfPlace.lean) are unchanged.Stitch/Aes.lean:batchM_okstatesrdx's base aswp ld s₀, the same term the loop invariants use.Net, the proofs lose 123 lines. The 512-bit out-of-place encryption loops (
StitchZTo,StitchZHTo) are the follow-up.Trust. No
Spec/orTCB/changes, and no change to the emitted code (Emit.lean --check), so there are no Rust, test or benchmark changes.Generated by Claude Code