Repository navigation
Spec: the CFB, OFB and CTR contracts' docs point a partial last block at the final functions - #4487
Merged
Merged
Conversation
… at the final functions They said the caller handles a partial last segment or block, OFB's and CTR's by XORing in the mode of a zero block: what the Rust code did before #4394, #4430 and #4451 gave every one a verified final function. Name those functions and their specs instead. Documentation only: no definition, contract or Api changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHGJJidJdRDMDSSd58W
This was referenced Nov 7, 2026
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 #4139 (finding 4: CFB's partial last segment is XORed in Rust; the clean-up after it).
Trust change: Spec/ documentation only. No definition, contract, signature or Api changes: only the module docstrings (
/-! … -/) of 19 files underSpec/.The whole-block CFB, OFB and CTR contracts' docs still said a partial last segment or block "is the caller's". For OFB and CTR, they added that the caller XORs in the mode applied to a zero block. That described the Rust code that #4394, #4430 and #4451 replaced with verified final functions. Each sentence now names the function that takes the partial last segment or block, and the spec file that defines it:
Spec/Cfb/Contract.leanpoints atSpec/Cfb/Final.lean;Spec/<C>/Cfb.leanpoints atSpec/<C>/CfbFinal.lean, for Blowfish, Camellia, CAST5, IDEA, SEED, SM4 and Triple DES.Spec/Ofb/Contract.leanpoints atvg_aes_ofb_final(Spec/Ofb/Final.lean);Spec/<C>/Ofb.leanpoints atvg_<c>_ofb_final(Spec/<C>/OfbFinal.lean), for the same seven ciphers.Spec/Ctr/Contract.leanpoints atvg_aes_ctr_final(Spec/Ctr/Final.lean);Spec/{Camellia,Sm4}/Ctr.leanpoint atvg_{camellia,sm4}_ctr_final.This is the
Spec/half of a reachability check over what #4394, #4430 and #4451 touched. I traced the transitive closure of every artifact's code and proof on each target, plus tactic andtaint_summaryuses by name. It found no unused CFB, OFB or CTR spec definition, contract or Api. The unreached top-level string specsSpec.Cfb.aesCfbEncrypt/aesCfbDecrypt,Spec.Ofb.aesOfbandSpec.Ctr.aesCtrare left as they are, as #4333 and #4392 leftSpec.Cbc.aesCbcEncrypt. A few unused proof declarations from those PRs follow in their own PR.The 19 modules build, and the Static checks pass locally.
Generated by Claude Code