Repository navigation
Conversation
The baseline implementation (no PMULL) now has the functions of the AArch64 single GCM layout, so that every implementation registers them and the dispatchers alone choose: * `vg_aes_gcm_store_powers` (`Impl.Gcm.AArch64.keyPowers`): `H` from byte 240 of the key context, then for `k` from 1 to 8 `preparedPower(Hᵏ)` stored at its place in `Powers8Repr`, and `Hᵏ⁺¹` by the bit-by-bit multiplication of `vg_ghash`. Only caller-saved registers, straight-line but for the multiplications' counted loops; constant time by `taint_decide` (`Proof/Gcm/AArch64/KeyPowers.lean`). * `vg_aes_gcm_seal_with_powers` and `vg_aes_gcm_open_with_powers` of an implementation without code that reads the powers: its `seal` and `open`, which never read the buffer, whose address is the next stack argument (`Generic/AesGcm/AArch64/AesGcm.lean`, `basePwArtifacts`; `Proof/AesGcm/AArch64/BasePw.lean`). * `AArch64.Verified.dropTrailingRo` (`Proof/Framework/AArch64/TrailingRo.lean`): code verified for a function with at least one stack argument is verified for it with one more, last, a read-only array it never reads, with a stronger precondition and the same postcondition and leak. It narrows the state to the old contract's regions (`RegionModel.verified_narrowTo`). No TCB or Spec change. Nothing in Rust calls the new functions yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHFuGsz7F32Tm9DLkuP
Member
Author
|
Superseded by #4523: the same commit, restacked onto Generated by Claude Code |
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.
Step (2e) of the GCM single-family plan. Stacked on
claude/gcm-one-family; review only the top commit.On AArch64, every implementation should register
store_powersand{seal,open}_with_powers, so that the generated dispatchers alone choose. Until now only_aesand_aes_sha3had them. This adds them for the baseline (no PMULL).New functions
vg_aes_gcm_store_powers(baseline):Impl.Gcm.AArch64.keyPowers, proven inProof/Gcm/AArch64/KeyPowers.lean.Hfrom bytes 240–255 of the key context, asvg_ghashloads itsh.k= 1 … 8, storespreparedPower(Hᵏ)at its slot ofPowers8Repr, as two little-endian doublewords (enc_eq,readW128).Hᵏ⁺¹ = Hᵏ • Hwith the 128 steps ofvg_ghash's software multiplication (mul_ok, reused).taint_decide.vg_aes_gcm_{seal,open}_with_powersfor implementations without code that reads the powers:sealandopen, the same code (basePwArtifacts, used wheregh.withPowersisnone). The code never reads the buffer, whose address is the next stack argument.Proof/AesGcm/AArch64/BasePw.leanmoves the proofs ofseal/opentoSpec.Gcm.sealWithPowersContract/openWithPowersContract.open_to_with_powersis not added: nothing on AArch64 registers it, and the Rust does not use it.New framework lemma
AArch64.Verified.dropTrailingRo(Proof/Framework/AArch64/TrailingRo.lean):RegionModel.verified_narrowTo): the buffers without the array, and the stack-argument area one slot shorter.StackArgScratch.lean'sallArgs/pre_args/post_args/pub_args.Proof/Framework/Scratch.lean's helpers only cover a writable trailing array, and editing that file would rebuild most of the tree. So the read-only counterparts (Sig.withRo,Sig.bufs_append_ro) live in this new module.Scope
vg_aes_gcm_store_powers_auto,vg_aes_gcm_seal_with_powers_autoandvg_aes_gcm_open_with_powers_auto.seal_with_powers/open_with_powershave the same machine code as the baselineseal/open. They are separate copies, not aliases, because the signatures differ. They stay duplicated until step (3) stops registering plainseal/openon AArch64.Checks
lake build;Emit.lean, with--checkclean.Static checksstep:check_lean_speed.py(nodecide := true),check_variants.py,check_registrations.py,check_lean_single_importer.pyagainst the base branch.check_lean_public_imports.pyon the five changed or added modules.cargo fmt --check;cargo clippy --all-targets -D warningson AArch64 and x86-64.Generated by Claude Code