Repository navigation
FFDH generate_key_cached is internal: no Api, contract in Proof - #4875
Merged
Merged
Conversation
Only verified code, the cached key search, calls vg_ffdh_generate_key_cached; Rust called it only from a test. Its registrations go, so the emitter writes it as an internal function of the search, and its signature and contract move to Proof/Ffdh/CachedGenerateKeyContract.lean (copies of the Spec ones, which a follow-up Spec PR deletes). The code that calls it names the function by its string. The test that a cloned domain keeps its context now runs the key search on the same draw. The residue allowlist loses the function's two lines, which name no public function any more. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHFjAR7Byf513R4zuFy
alex
enabled auto-merge
November 9, 2026 23:19
alex
pushed a commit
that referenced
this pull request
Nov 9, 2026
main (#4875) removed the test-only Domain::generate_key; keep its removal, with the lazy context's tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHGTYqNsecxgCdT9ZaD
alex
pushed a commit
that referenced
this pull request
Nov 15, 2026
`vg_ffdh_generate_key_cached` is internal on main (#4875, #4876): the registration drops its artifact and its proofs name `Proof.Ffdh.cachedGenerateKeyContract`. Generic callers are ordinary registrations (#4654), so the sieved parameter search is registered in `Artifacts/Ffdh/RISCV64.lean` over `Proof.Variants.MillerRabin.RISCV64`, as on PPC64LE. `Shape.lean` uses the shared `RsaKeyGen.wv_half` that replaced FFDH's `WordHalf` (#5059). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHHEKNw8eCDhgbwoFBL
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.
vg_ffdh_generate_key_cachedis called only by verified code, the cached key search (vg_ffdh_generate_key_search_cached). Rust called it only from one#[cfg(test)]helper. So it stops being a public Api, and the emitter writes it as an internal function of the search.What changes
Proofs.
Proof/Ffdh/CachedGenerateKeyContract.leanholdsProof.Ffdh.cachedGenerateKeySigandcachedGenerateKeyContract, unchanged copies of theSpec.Ffdhones.GenerationPolicy."vg_ffdh_generate_key_cached", where it used to readSpec.Ffdh.cachedGenerateKeyApi.name. That applies toImpl/Ffdh/X86/Cached.leanand the search proofs.Registrations (
Artifacts/Ffdh/<Target>.lean).cachedGenerateKeyApientries are removed.Cached.AttemptVerifiedimports that only those entries used are removed.Generated crates. Regenerated:
internal/vg_ffdh_generate_key_cached*.rs(andassembly/internal/*.s).Rust.
cache_tests::clones_share_immutable_context_and_keep_it_alivenow runs the key search on the same draw, throughkey_stateandkey_search, with a fresh state each time. It expects status 1 with the 64 bytes consumed.Domain::generate_keyand its import are deleted.CI data.
ci/residue_allowlist.txtlosesx86_64 vg_ffdh_generate_key_cachedand_adx. They now name no public function, so the emitter refuses them, and the list only shrinks.No
Spec/orTCB/change. The follow-up Spec PR deletesSpec.Ffdh.cachedGenerateKeySig,cachedGenerateKeyContractandcachedGenerateKeyApi.Checks
main:lake build(all modules),Emit.lean, andEmit.lean --checkafter trimming the registration importsStatic checksjob's scriptscheck_lean_public_imports.pyon each edited modulecargo fmt --check,cargo clippy --all-targets -D warningscargo testwith Wycheproof, and the FFDH tests withVG_CPU_FEATURES=nonemain's only change since was Spec: delete the AES block functions' Apis and contracts #4874, AES's Spec.Generated by Claude Code