Skip to content

AArch64 GCM: remove vg_ghash_store_powers_aes and what only it used - #4364

Merged
alex merged 3 commits into
mainfrom
claude/audit-4139-gcm-aarch64-powers
Nov 6, 2026
Merged

alex merged 3 commits into
mainfrom
claude/audit-4139-gcm-aarch64-powers

Conversation

@alex

@alex alex commented Nov 6, 2026

Copy link
Copy Markdown
Member

Part of #4139 (finding 5: AES-GCM on AArch64: the powers of H)

After #4338, vg_ghash_store_powers_aes has no caller:

  • Rust stopped calling it once AesGcm::new took the powers from vg_aes_gcm_store_powers_aes.
  • No verified function calls it. The *_store_powers seal and open whose proofs used it were never registered, and AEADs: remove dead declarations and modules #4345 removed those proofs.

This PR removes it and what only it used. There are no Spec/, TCB or Rust changes. The Spec definitions it leaves unused go in a Spec-only PR after this one (see Next).

Removed

  • Registration: the vg_ghash_store_powers_aes entry of Artifacts/Gcm/AArch64.lean.
  • Generated code: its function and constants in crates/verified-garbage-asm-aarch64/{src,assembly}/gcm.*. The emitter's only change is these 607 deleted lines.
  • Impl/Gcm/AArch64/Pmull.lean: ghashS, prologueS, storePw and storesS.
  • Proof/Gcm/AArch64/Pmull/Ghash.lean: its proofs: ghashS_{correct,ct,verified,written}, ghashS_implies, correctS, epiS_ok, storeI_ok, SW, ScratchKept, prologueS_ok, pm_of_store, Pm.congr, Inv.congr, tReg_pp, write_byte_sep and satStateS. pwOff_sep and pwOff_le stay, because vg_aes_gcm_store_powers_aes's proof uses them.
  • Proof/Gcm/AArch64/Ghash.lean: its AArch64 contract, Proof.Gcm.ghashStoreAArch64.
  • Proof/AesGcm/AArch64/Callee.lean and GhashImpls.lean: GhashStoreImpl and GhashStoreImpl.aes, and GhashImpl's storePowers field. Nothing read that field, and it was the only thing that still reached ghashS.
  • Doc comments that named the deleted function are updated.

How the set was found

By reachability over the AArch64 emitter's environment (every AArch64 registration file, as Emit.lean's driver imports them), with the deleted pieces cut off: the declarations only ghashS, its registration or GhashStoreImpl reach, and every declaration that uses them. That gives exactly the list above. None of the open dead-code PRs (#4349, #4354, #4362) touches these files.

Checks

  • lake build of Artifacts.Gcm.AArch64 and every module that imports the edited ones (the Generic AES-GCM, AES-GCM-SIV and SM4-GCM AArch64 files), from main's cache; no warnings.
  • The full Emit.lean and its audits.
  • Every script of the Static checks job.
  • check_lean_public_imports.py on the edited modules.
  • cargo fmt --check.
  • cargo clippy --target aarch64-unknown-linux-gnu --all-targets -D warnings.
  • The AES-GCM, GHASH and SM4-GCM tests, Wycheproof included, under qemu-aarch64 with VG_CPU_FEATURES unset, none, aes and aes,sha3.

No benchmark: only uncalled code is removed, so nothing that runs changes.

Next

A Spec-only PR retiring the definitions this leaves unused in Spec/Gcm/Powers8.lean: ghashStorePowersApi and its sig and contract; the vg_aes_gcm_{seal,open}_store_powers Apis, sigs, posts and contracts; storePowersOk and its documentation strings.


Generated by Claude Code

Rust has not called vg_ghash_store_powers_aes since AesGcm::new takes the
powers from vg_aes_gcm_store_powers_aes (#4338), and no verified function
calls it: the *_store_powers seal and open it served were removed in #4345.
Remove its registration, its code (ghashS, prologueS, storePw, storesS), its
proofs, its AArch64 contract (Proof.Gcm.ghashStoreAArch64), GhashStoreImpl
and GhashImpl's storePowers field, which nothing read.

Part of #4139 (finding 5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKUFHFkei8WwGgosqeREs4
@alex
alex enabled auto-merge November 6, 2026 20:14
@alex
alex added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit de183ea Nov 6, 2026
15 checks passed
@alex
alex deleted the claude/audit-4139-gcm-aarch64-powers branch November 6, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants