Repository navigation
DSA: remove the three-tape parameter-generation spec and its dead proofs - #4304
Merged
reaperhulk merged 1 commit intoNov 6, 2026
Merged
Conversation
Every architecture now generates DSA parameters with the refillable-tape
search (`Spec/Dsa/ParameterSearch.lean`); no registration uses
`generateParametersApi` and no crate emits `vg_dsa_generate_parameters`.
Spec (removal only; the rest is doc wording):
* `Spec/Dsa/Generate.lean`: `generateParametersBytes`,
`generateParametersSig`, `generateParametersContract`,
`generateParametersApi`.
* `Spec/Dsa.lean`: the list-based `generateParameters` (and its `attempt`),
which only the byte adapter and the old controllers' proofs used.
* Docs in `Generate.lean`, `ParameterSearch.lean`, `RefillSeed.lean` and
`GeneratorStageContract.lean` no longer name the removed definitions.
Proofs and code that only the old API or the old x86-64 three-tape
controller used, found with a declaration-level graph from the build's
.ilean files (reachable from no Artifacts/Generic/Variants file), then
confirmed by a full build and `Emit.lean --check`:
* 27 modules deleted, among them x86-64's `Generation/{ABI, ABIContext,
ABIGeometry, BackendVerified, Dispatch, DispatchCT, EntryAllocated,
EntryFrame, EntryInitial, EntryReady, EntryResult, GenerateCT,
NativeParameters, NativeParametersCT, ParameterIterationCT,
ParameterLoopCT, ParameterTailCT, PublicCT, Sized, SizedBackend,
SizedContract, Widths}`, `Impl/Dsa/X86_64/Generation/{Generate, Sized,
Widths}` and the shared `Proof/Dsa/Generation/{ByteResult, SeedResult}`.
* The old controller's declarations removed from the modules the refill
proofs still use (e.g. `BackendCorrect`, `EntryInnerCT`, `EntryState`,
`ParameterCTState`, `ParameterInvariant`, `SharedChecker`'s code and
proof, `Impl/.../Entry`'s `code`/`dispatch`/`entryBody`), AArch64's
three-tape `ParameterInvariant`/`GenerationContext.remaining`, and
x86-64's `parameters_verified`/`parametersSatisfiable`, which only the
old shared checker used.
Tests drop their checks of the removed definitions. The bench comment
says the search reads one fixed tape.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ajQWxFgLnhRDJS1FKU7Ub
reaperhulk
enabled auto-merge
November 6, 2026 09:50
reaperhulk
deleted the
claude/unify-random-bytes-crypto-xqmg0z-dsa-spec-cleanup
branch
November 6, 2026 10:22
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.
#4234, #4293, #4295, #4297 and #4296 moved DSA parameter generation on every architecture to the refillable-tape search (
Spec/Dsa/ParameterSearch.lean). Nothing registersgenerateParametersApiany more, no crate emitsvg_dsa_generate_parameters, and the Rust no longer calls it. This PR removes that old spec and every proof and piece of code that existed only for it. The generated crates are unchanged.Trust change:
Spec/(removals and doc wording only)Definitions removed:
Spec/Dsa/Generate.lean:generateParametersBytes,generateParametersSig,generateParametersContract,generateParametersApi.Spec/Dsa.lean: the list-basedgenerateParameters(and itsattempt). Apart from tests that checked it directly, onlygenerateParametersBytesand the old controllers' proofs used it.Kept (used by the parameter search, key generation, or live proofs):
generationChunks,generationLengthsValid,generationScratchWords,encodeParams,paramsBytes,encodePrivateKey, thegenerateKey*definitions,generator,primeFromSeed,qCandidate,pCandidateandsubgroupBits.Doc wording only, no definition changed:
Generate.lean's module doc now describes only key generation and the shared helpers.ParameterSearch.lean, the module doc and the docs ofparameterSeedsandgeneratorAttemptsnow describe the one-tape layout directly, without naming the removed definition.TCB/is untouched.Dead code and proofs removed
Deleted modules (27):
Proof/Dsa/X86_64/Generation/: ABI, ABIContext, ABIGeometry, BackendVerified, Dispatch, DispatchCT, EntryAllocated, EntryFrame, EntryInitial, EntryReady, EntryResult, GenerateCT, NativeParameters, NativeParametersCT, ParameterIterationCT, ParameterLoopCT, ParameterTailCT, PublicCT, Sized, SizedBackend, SizedContract, Widths. DSA parameter search on x86-64: verified refill controller #4234 had left these behind.Impl/Dsa/X86_64/Generation/, none of them emitted: Generate, Sized, Widths.Proof/Dsa/Generation/: ByteResult, SeedResult.Declarations removed from modules that remain:
SharedCheckerkeeps onlyname;parameters_verifiedandparametersSatisfiable.code,dispatch,entryBody,entryHeader,entryIncomingandincomingSlots; SeedSearch'sparameterSearchandseedAttempt; Hash'sseedHashandhashTest; PHash'suseWrappedSeed; TapeLoop'sseedTape.ParameterInvariantloses the three-tapeGenerationContext.remainingandParameterInvariant.Generation/SearchlosesparameterAttempt_nilandparameterAttempt_step;Generation/SeedSuffixlosesseedResult_suffix.How "dead" was established:
.ileanfiles of a full build. It starts from every definition inArtifacts/,Generic/,Variants/,TCB/and the tests.Code that was already dead on
mainbut does not involve the old API is left for a separate cleanup: the AArch64Tape*/WrappedSeed/RoundTailmodules and some unused lemmas.Lean tests:
generateParametersBytesandgenerateParametersare removed, includingcheckParameters, an end-to-end check of the NIST PQGGen seed through the old adapter.cavp_generated_parametersruns the full refillable search on the NIST vectors on every architecture. The pieces it uses (qCandidate,pCandidate,probablePrime) are still checked against NIST inDsa.lean.Other: a benchmark comment now says "from a fixed tape". Nothing in
docs/algorithms,ci/,vectors/or the README tables named the old API.Size
65 files changed, +53 / −4,466.
Checks
lake buildpasses (28,970 jobs).Emit.lean --checkpasses with the standard axiom audit, so the generated crates are unchanged.check_lean_public_imports --base origin/mainpasses on the modified modules.cargo fmt --check(library andbench/) andcargo clippy --all-targets -- -D warningspass.sorry,native_decide,bv_decide,admitoraxiomadded.No benchmark: nothing that runs changed.
Generated by Claude Code