Repository navigation
AES block functions are internal: no Api, contracts in Proof - #4873
Merged
Merged
Conversation
Rust never calls vg_aes_encrypt_blocks or vg_aes_decrypt_blocks; only verified code (ECB, CBC, CTR, XTS, OCB, CFB, OFB, GCM-SIV, CCM, CMAC) does. Their registrations go, so the emitter writes them as internal functions of their callers, and their contracts move to Proof/Aes/Rounds.lean (copies of the Spec ones, which a follow-up Spec PR deletes). The residue allowlist loses the six functions' lines, which name no public function any more, and the AES-ECB row of the algorithms table now reads its own module, aes_ecb. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHFjAR7Byf513R4zuFy
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.
Part of #4548. Rust never calls
vg_aes_encrypt_blocksorvg_aes_decrypt_blocks. Only verified code calls them: the AES modes, CMAC and CCM. So they stop being public Apis, and the emitter writes them as internal functions of their callers.What changes
Registrations (
Artifacts/Aes/<Target>.lean, all six targets).encryptBlocksApianddecryptBlocksApientries are removed; onlyexpandKeyApiis left.Proofs.
Proof/Aes/Rounds.leangetsProof.Aes.encryptBlocksContractanddecryptBlocksContract, unchanged copies of theSpec.Aesones.encryptBlocks_keyedanddecryptBlocks_keyednow conclude those copies.Proof/AesEcb/Wipe.lean.Generated crates. Regenerated:
internal/vg_aes_{en,de}crypt_blocks*.rs(andassembly/internal/*.s).CI data.
ci/residue_allowlist.txtloses the sixx86_64 vg_aes_{en,de}crypt_blocks*lines. The emitter refuses them now that they name no public function, and the list only shrinks.docs/algorithms/aes-ecb.tomllists theaes_ecbmodule, where ECB's code is. Its row used to pick up the block functions' VAES/AVX2 variants fromaes, and now reads them from ECB's own variants. Its README cell is unchanged.aes.No
Spec/orTCB/change. The follow-up Spec PR deletesSpec.Aes.encryptBlocksContract,decryptBlocksContract,encryptBlocksApianddecryptBlocksApi, and keepsblocksSig, which AES-ECB's contract uses.Checks
main:lake build(all modules),Emit.lean, andEmit.lean --checkafter trimming the registration files' importsStatic checksjob's scriptscheck_lean_public_imports.pyon each edited modulecargo fmt --check,cargo clippy --all-targets -D warningscargo testwith Wycheproof, and the AES tests withVG_CPU_FEATURES=nonemainwas clean;mainchanged only PPC64LE EC code.Generated by Claude Code