Repository navigation
refactor(slh-dsa): share constructions and reusable security proofs - #1009
Draft
alexanderlhicks wants to merge 143 commits into
Draft
alexanderlhicks wants to merge 143 commits into
alexanderlhicks wants to merge 143 commits into
Conversation
Plan shared signature and counted-game interfaces around the canonical construction, retaining both exact security-bound families. Specify gated proof extraction, graph parameterization and migration with rejection, cache and cost-preservation obligations. Record three independently reviewed Lean probes and 77 preservation anchors for the staged implementation.
Require a reviewed finite list of extraction families, consumers and exact recovery theorems after the graph pilot. Use that list as the R6c and R8 completion scope while retaining the required deeper reuse.
Check 77 literal closed kernel types and the semantic dependency closure of eleven model groups against immutable compact artifacts. Force fresh witness elaboration and verify toolchain, dependency and source frames. Add same-name semantic, opaque, constructor and warm-cache JSON mutation controls. This is the R0a manual baseline; readable equations and normal CI enforcement remain R0b work.
…edding Separate raw signing replies from candidate signatures and derive strong freshness from successful reply readback. Keep every raw response logged and expose compositional signing-run equations, including rejection. Prove that the total SignatureAlg view has exactly the existing strong unforgeability program for every adversary, without resource premises.
Prove that identity-forwarding additive observers compose as one paired policy, preserving the complete result and both chronological costs without commutativity. Recover the original verifier and outer hash counters jointly on every path. Validated by independent adversarial source review, canonical library build, fresh frozen contracts and public axiom checks, and the normal runtime driver including R0 regressions and all 18 exact bound-table rows.
Share seven node families and the seed across validated parameter sets, keeping the full tree rectangle and finite coordinates without enumerating them. Prove ordered child rank decrease and recover every original SHAKE-128s coordinate, rank, child list and natural address through explicit equivalences. Actual SHAKE-128s and SHAKE-192f kernel clients exercise distinct dimensions. Independent adversarial review, current-parent source mutation controls, targeted builds, exact public statements/axioms and fresh R0 regressions pass. Encoded-input widths and actual effectful traversal remain separate gates.
Prove exact free-program equality for the original outcome and actual keygen and later hash counters, using the single counted experiment. Derive unused phase coordinates from real supported executions without caller invariants. Preserve optional replies, full logs, and false verification paths jointly. Independent adversarial review, canonical builds, fresh frozen contract and public axiom checks, targeted lint/import checks and fresh R0 guards pass. This is the third scoped P5 contract; whole-game transport remains separate.
Recover the complete original outcome and source vector from the recorded program equality. Transport the same whole observation through any lawful stateful handler, initial cache and continuation, retaining final cache jointly. Fresh frozen FullProgram and SharedContinuation witnesses, literal five-vector reconstruction, standard axiom audits, targeted builds/lints/import checks and R0 guards pass independent adversarial review and root integration. This closes five of fifteen scoped P5 targets; security-game transport follows.
Prove natural graph-address injection for every parameter record, then derive canonical serialization and byte injection from explicit field capacities. Keep those conditions separate from arithmetic validity and answer lengths. Actual 128s/192f clients and an actual encoder collision establish the scope. Independent source/control review, fresh frozen universal witnesses, standard axiom audits, targeted builds/lints/imports and R0 guards pass. E2/E3 and the effectful graph bridge remain separate implementation gates.
Interpret the shared counted program once to recover the original joint winning bit and complete five-source vector. Prove equivalence of every selected probability-one budget at the same natural cap, including zero, and preserve the original probability-one signing lifetime. Independent adversarial source review, fresh exact frozen contract witnesses, standard axiom audits, targeted builds/lints/imports and R0 guards pass. This closes eight of fifteen scoped P5 targets; security certificates follow.
Prove exact prefix and suffix recovery and the joint law of independent uniform components for every n <= m, including empty components. Reuse the existing byte split equivalence and preserve its original implementation. Actual 128s/192f clients, old truncation recovery, valid-weaker-library rejection controls, fresh frozen universal witness, standard axiom audits, targeted builds/lints/imports and R0 checks pass independent review. This is a distribution law; effectful graph integration remains separate.
Transport the original 127-bit actual-work theorem, zero success below569, parsed and accepted verifier bounds569..3824, and accepted direct-plus-verifier work into the single shared experiment with their original premises intact. Keep heavy probability imports in this certificate owner. Six exact frozen witnesses, standard axiom audits, canonical targeted builds, lints/imports and R0 guards pass independent review and root integration. All fourteen unconditional same-scheme targets are now proved; actual factory compatibility, the broader766 recoveries and fullP6 remain separate gates.
Prove traversal append and unwritten-cell laws without finiteness, freshness, or distinct-query premises. Retain the complete free program, final state, and effectful continuation. Check exact public types and a repeated-write consumer with full cache and ordered-cost observations.
Add generic binomial moments and centered common-moment sums through order six, with an independent-sign sixth-moment consumer. Check the exact original FORS types and all-bin product-Poisson formula through the generic API. Original numerical definitions and proof bodies remain intact pending migration.
Define natural-coordinate schedules and prove child readiness, call uniqueness, and signature-cell coverage for arithmetic-valid parameters. Check actual SHAKE-128s and SHAKE-192f instances, exact public types and definition bodies, and short-input parsing. Existing construction, parser, and security bodies remain intact.
Relate the existing callback signer to the shared traversal for every valid parameter set and node carrier. Interpret the equality under arbitrary handlers while retaining effects. Validate SHAKE-128s, SHAKE-192f, and nonfinite Nat/Bool consumers, full outer observations, and exact public types without new finiteness or resource premises.
Derive the all-parameter canonical SHAKE interpretation from the generic FORS graph theorem, retaining the exact query order and zero-padding even when the digest is shorter than a node. Register native checks for complete signatures, shared cache, reply traces and ordered costs across repeated calls, with ordinary 128s/192f and short-output proof clients.
Record five extraction families, 52 recovery anchors and six component units after the accepted P6 checkpoint. Require exact per-unit contracts, semantic coverage and original-strength recovery before each port.
Generalize signing views, counted experiments, tracing and cost handlers to independent oracle-index universes while preserving existing explicit slots. Exercise nonzero index and runtime universes through recovery clients and the registered signing-view runtime checks. Retain the original R0 theorem and semantic fixtures. Recover their exact universe layout through a finite, fail-closed four-declaration/seven-site adapter, with source and serialized mutation controls.
Delegate the independent-power and finite-sum proofs to the shared moment API, preserving all original hypotheses and numerical security bounds. Use the shared polynomial with an explicit unfolding in the sixth-moment proof. Add compiled literal recovery, full dependency and generated-proof checks, with cached-source mutation controls. Store the complete evidence as compact JSON while preserving every token and value.
Use the verifier floor from current main to provide a narrow FIPS theorem for arbitrary actual joint caps below 569, including zero. Preserve the previous WorkFinal and shared certificate clients.
…eviewed-main-port
…iles Use the complementary checksum digits to save at least one maximal chain per hypertree layer. Propagate the intrinsic verifier cap through the structured, deterministic and hedged estimates, and regenerate the 18 exact coefficients.
Combine the parameterized weak-seed bound with the actual-work bound using the checksum-sensitive verification allowance. Keep both original 3929-call theorem interfaces as corollaries.
… duplicate proof chain Charge the actual signing attempts, attacker queries and verification on one run. Derive the piecewise bound from the verifier floor and the remaining FORS coverage, then transport it to the paper game. Preserve the public 127-bit conclusions and provide the sharper fixed-context wire minimum. Remove 135 superseded internal modules and document the surviving interfaces. Exercise the zero, middle and saturated budget ranges from a public import.
This was referenced Nov 21, 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.
What changes for a caller
This candidate derives the deterministic SHAKE-128s bit theorem directly on VCVio’s FIPS 205 byte game and transports it to the paper transcription. The parameterized structural theorems cover all six SHAKE profiles. A caller chooses a theorem by the signing mode and the resource certificate they can establish.
Security.wireStrongAdvantage_le_securityBound_validatedParamsor its_hedged_validatedParamscounterpartslhDsa_sufCma_lejointWorkBound qbelow, including the 127-bit corollaryqh, qsandqs ≤ 2⁶⁴for deterministic pure-mode SHAKE-128swireStrongAdvantage_le_jointWorkBoundjointWorkBound (qh + qs + 3824)An executable inherits the bounds once its key generation, signed messages, verification results and query accounting have been related to the model. In the joint cap each signing attempt costs one, including a rejected request. Direct attacker hashes and the actual hashes of final verification count. Key generation and signer hashes share the oracle and remain outside that cost measure. The structural wire theorem and its minimum use a fixed valid context. The direct joint-work theorem permits per-request contexts.
The shared observation exposes
SharedExperiment.advantage_le_jointWorkBound. With a user-defined scalar policy,ScalarPolicy.advantage_le_jointWorkBoundgives the piecewise guarantee at the policy’s own cap. The client proves the signing lifetime, an almost-sure weighted cap, and that the weight of each event covers its original selected work. The byte-weighted example charges each attacker or verifier hash by one plus its input length. An implementation proof still needs to establish the correspondence between its own events and the formal game.Construction and reduction history
Nicolas Consigny introduced the reduced-profile SLH-DSA construction in #424. On August 26, Alexander Hicks’s generalization branch enumerated all twelve FIPS 205 parameter sets, proved their derived sizes and WOTS widths, and tested each Table 2 row. Quang Dao’s #593 subsequently landed the proof-carrying
ValidatedParamsinterface on main, separating raw arithmetic validity from approval of a named FIPS set. Hicks’s branch adopted that interface while #593 was under review. Initial construction #424 · August 26 parameter proofs and tests · Parameter interface #593 · Integration on Hicks’s branchHicks’s #597 brought together work from both contributors on the arbitrary-depth construction, codecs, primitives and security groundwork. Dao coordinated the extraction of that work into focused PRs. The internal algorithms, codecs, primitive instantiations and external interface went through that review stack and subsequent integration PRs. Further work connected component-level forgery witnesses and their query costs to a bound for the complete scheme, which #766 built on. Hicks’s integration branch #597 · Dao’s extraction ledger · Internal algorithms #617 · Codecs #619 · Primitives #626 · External interface #611
From component witnesses to a full-scheme bound
The intermediate work established reachable hash targets, certified FORS, XMSS and hypertree programs against those targets, and turned an accepting forgery into a component witness. The game definitions, composition certificate, strong-unforgeability residual bound and reduced profile then made those results available at scheme level. #630 · #631 · #682 · #683 · #685 · #689 · #692 · #697 · #699 · #708 · #715 · #718 · #723
#766 provides the general structural reduction, parameter families, signing modes and weak-seed accounting. Its structured proof distinguishes the tweakable hash, H_msg and PRF_msg. The byte proof routes those roles through one shared SHAKE oracle and accounts for input overlap and weak keys. #886 supplied further generic oracle and FORS provider results. Tom Wambsgans’s #912 added a specialized proof for deterministic SHAKE-128s on one 30-byte random oracle. Its contribution on the overlap was the almost-sure joint-work accounting and concrete bound. #766 already proves its stated security result under its structural hypotheses. On the fixed-context overlap, each numeric bound can be useful at different budgets. A client with a signing-lifetime certificate and a same-run work certificate can invoke the joint theorem directly. The specialized argument follows the SHAKE-128s analysis in §7.1 of Kudinov, Wagner and Emile Wambsgans. The initial integration retained all 238 original Lean modules and connected the paper transcription to the byte game. General development #766 · Framework and FORS #886 · Specialized integration #912 · The Exact Bit Security of Hash-Based Signatures
Security and proof architecture
The replacement starts from the native FIPS game. It uses #766’s classification of fresh accepting forgeries, retains the actual cache and charged counts through signing and verification, and applies #912’s finite-tape and FORS concentration estimates to the coverage event. A two-way representation theorem transports the conclusion back to the original transcription, which represents a 30-byte oracle answer as 240 bits. Both public 127-bit statements refer to their original games. The joint-work theorem has two caller obligations, the signing lifetime and the almost-sure budget. Its middle-range proof discharges the classification of a winning forgery internally. The zero-success theorem uses the budget alone. Codec round trips, signing fidelity and standalone probability lemmas remain available.
The FIPS, 240-bit and paper 127-bit corollaries follow from the piecewise theorem and the numerical comparison
jointWorkBound_le. The shared observation, a generic dominating policy and the byte-weighted example now expose the same piecewise theorem. The public linear certificates keep their names and argument lists. This gives callers the middle-range improvement directly and preserves the separate zero-success theorem that needs no signing-lifetime premise.The reusable
SigningView.simulateQ_runWithSigningOracle_mapClienttheorem handles a client whose ambient queries are translated and whose signing service records each raw reply. It equates the complete computations in any lawful target monad. A stateful caller can apply the equality at its own initial cache and retain the returned value, ordered log and final cache together. The framework's counted experiment uses it with an additive cost monoid, while the SHAKE proof uses it for signing counts and the role invariant. The existing free-oracle transport theorem follows from it as well. Each caller still proves what its own handlers do, including the charge before a signing attempt. The shared lemma uses the standard Lean axioms; it adds no cryptographic assumption, oracle or hypothesis to the public security bounds. Logged signing theoremFollowing one execution through the proof
#766’s structural caps must hold throughout an adversary program. The hash work, signing attempts and verification work on one sampled execution can be correlated. In particular, separate maxima for these categories may occur on different executions. A joint cap can therefore apply to an adversary whose actual paths stay within budget even when those maxima sum to more than the budget. The proof carries the returned output, log, caches and paid work through these steps.
Native.TerminalReservenow relates that cache to the digest entries, signing and forging counters, nonweak-key condition and total work on the same terminal. Pricing needs its actual work to fit the canonical forger-tape budget. It can be reused without repeating the adversary, fallback or tapes as pricing parameters. The FORS probability argument still has to show which reached positions can cover a fresh winning forgery.The proof shares #766’s construction and classification with the joint-work argument. The remaining specialized work pays for routed SHAKE calls, bounds the probability of FORS coverage on the consumed tape positions, and integrates the weak-key term. The current evidence supports maintaining that argument for the joint certificate. Both results concern strong unforgeability in the shared random-oracle model. Which estimate is tighter depends on the available certificate and its budget.
Numerical effect
q < 569,slhDsa_sufCma_eq_zero_of_lt_569gives zero success under the joint cap alone.569 ≤ q < 2¹²⁷, the bound is(32q − 1)/(16·2¹²⁸) + 34A/2²⁵⁶, where the honest address countA = 1591788895347057694892543. The improvement overq/2¹²⁷is the constant(2¹²⁴ − 34A)/2²⁵⁶, about1.84 × 10⁻⁴⁰. The reported whole-bit result remains 127.q ≥ 2¹²⁷the bound is one.jointWorkBound_legives the original linear bound for every natural budget.The minimum matters even when both results apply to the same wire attacker. For
qh = qs = 2⁶⁴, the structural value is about1.637 × 10⁻¹⁹, compared with2.168 × 10⁻¹⁹from joint work. Forqh = 2⁸⁰, qs = 2⁶⁴, joint work gives about7.106 × 10⁻¹⁵, compared with7.172 × 10⁻¹⁵structurally. These are evaluations of the upper bounds, with the full weak-seed correction and the 3,824-call allowance.Reusable pieces include secret-key reconstruction for marked signing views, transport for a cost guard with an absorbing abort, and one- and two-position FORS credit for arbitrary validated SLH-DSA parameters. The generic guard requires agreement on charged steps and fallback answers. The signing-view theorem reconstructs raw outputs. A caller changing the readback function must separately show that its win predicate is preserved. A client can also use the guard’s support theorem with any monad implementing
LawfulMonadandLawfulMonadAttach. The theorem keeps the handler’s answer paired with its returned cache.Three compiled examples show what a downstream client supplies. The profile client switches between SHAKE-128s and SHAKE-192f and selects deterministic or hedged signing with the corresponding bound. The FORS client records either a chronological trace or a query count alongside the signature and final cache. The weighted-policy client charges a signing attempt once and charges an attacker or verifier hash by one plus its input length, then proves that this pays for the original work measure and transports the full piecewise bound to that policy. Profiles · Effectful FORS provider · Weighted work policy
Callers using the public 127-bit and wire results keep their theorem names. Callers that imported the old internal proof chain directly must migrate. For example,
WorkFinal.setupBound,WorkFinal.verifierFilesandWorkFinal.hsharedFuseddescribed stages of the former argument. The public entry points above express the actual game and budget. SHAKE-128s proof and migration guideMaintenance cost and verification
The table counts physical Lean source lines, including comments and generated umbrellas, from main
811357048to197afe9bb. Lean sources used by documentation and tooling appear in “Other Lean sources”. The proof and framework libraries together are 264 lines larger than main. Sharing the logged signing theorem removed 184 net lines across four files (77 added, 261 removed) since222f8209c. The preceding accounting pass removed 190, giving a combined reduction of 374 lines since6a59713ac. The non-Lean delta includes 10,464 additional documentation and evidence lines, and 1,352 additional lines of tooling, fixtures and configuration. The strength baseline includes declaration schemas, semantic fingerprints and axiom sets for detecting weakened statements.Of #912’s 238 original module paths, 135 are removed (30,395 lines on the comparison base), 60 differ from their files on main and 43 are byte-identical to main. Of the surviving paths, 35 match the archived #912 source byte for byte. The three security entry points and their transitive imports include 49 original paths. Of the survivors, 37 modules (6,291 lines) have no repository importer outside that family once the generated umbrella is excluded. They include standalone key-generation, codec and component results. Their maintenance cost remains even for users who import just the security theorem.
The native joint-work proof occupies 14,465 lines across 51 modules. The logged-signing change removed 167 lines from this part of the proof. Importing the combined wire theorem adds 166 modules and 40,705 lines over importing the structural wire theorem alone. On main at
811357048it adds 273 modules and 59,882 lines. The FORS consumed-credit proof imports the existing logged client. Its closure is 387 modules and 111,552 lines, up 3 modules and 1,094 lines from6a59713ac.The table follows ordinary Lean imports through repository sources and excludes package dependencies.
The key-generation lower bound still gives at least 18,432 hash calls even with a warmed cache. This cost concerns the physical implementation model and is excluded from the forgery budget.
Validation of the current revision
This revision integrates main
811357048and its PolyFun lock713d8857. Main updated pure-support proofs in two retired #912 modules. The merge keeps both retirements. A one-line proof uses VCVio’s existingmem_support_pure_iffto establish membership explicitly under the upgraded PolyFun representation. This port preserves the logged-signing extraction, the public security statements and their bounds.On clean commit
197afe9bb894d1133eacba63c3f14eb432ad295d,./scripts/validate.sh --lint --test --axiomspassed using Lean 4.36.0 with all 12 dependencies at their locked revisions before and after validation. All seven generated import umbrellas reproduced. All 42 registered executables ran, including the counted game and wire bridge. The regenerated table matched all 18 exact rational coefficients. The frozen-contract check accepted 77 declared theorem or definition types, 40 equations and 198 standard-axiom checks. The kernel sweep found zero nonstandard-axiom orsorryAxdependencies across 32,868 declarations in 1,346 modules.Eleven external Lean clients passed at the same clean commit. Six checked the 77 frozen contract witnesses, seven direct proof dependencies, public and compatibility interfaces, and five budget boundaries. Their 99 axiom reports used only standard Lean axioms. Four checked charged rejection, frozen state after the guard stops, correlation between handler replies and cache, weighted budgets and calls through the existing named argument. The eleventh instantiated the new logged-client theorem with an adaptive ambient translation and a stateful handler. It checked the exact returned value, the ordered log containing a rejected and an accepted signing request, and the final state. The new theorem uses only
propext,Classical.choiceandQuot.sound.All nine GitHub checks passed. GitHub tested merge
305302636of197afe9bbwith main811357048, including the downstream build without submodules. Build, runtime tests and kernel audit · Downstream buildValidation at the previous draft revision 222f820
At
222f8209c17a24d0653f1d4c2bb122d367ec82b7, the full local command./scripts/validate.sh --lint --test --axiomspassed on Lean 4.36.0. The source and all 12 locked dependencies were clean before and after. All seven import umbrellas reproduced. All 42 registered executables ran, including the counted game and wire bridge. The regenerated table matched all 18 exact rational coefficients. The kernel sweep found zero nonstandard-axiom orsorryAxdependencies across 32,789 declarations in 1,341 modules.Ten external Lean clients replayed at the exact commit. Six checked the 77 frozen contract witnesses, seven proof dependencies, public and compatibility interfaces, and five budget boundaries. Their 99 axiom reports used only standard Lean axioms. Four more checked charged rejection, frozen guard state, correlated handler replies and cache, the weighted budget ranges, and calls using the legacy named argument. The stronger weighted certificate uses the same axioms as its linear corollary. A separate Lean check established both implications between the named terminal certificate and its six original accounting conditions.
All nine GitHub checks passed. GitHub tested merge
9933d6a4of this draft head with7c167e88, including the downstream build without submodules. Build, runtime tests and kernel audit · Downstream buildValidation and independent audit of the earlier draft at 6a59713
At
6a59713ac0688d8348039e71f7b946d95d9f7742, the clean draft head on Lean 4.36.0 passed the full proof-library build with all 12 dependencies at their locked revisions. Six external Lean clients checked the original entry points, five budget boundaries, seven theorem dependencies and all 77 frozen contract witnesses. All 99 axiom reports used only the standard Lean axioms. The whole-run proof and its terminal consumer also compiled with the old proof bodies absent.All nine PR checks passed. The build, runtime tests and kernel audit used the merge of this head with main
7c167e88at5b35923c. All 42 registered executables ran, including the counted game and wire bridge. The table matched all 18 exact coefficients, and the kernel sweep found zero nonstandard-axiom orsorryAxtaint across 32,771 declarations in 1,341 modules. The downstream build without submodules passed. Build, runtime tests and kernel audit · Downstream buildThe first local validation stopped when an import-generator fixture exceeded its ten-second deadline. That fixture passed on the rerun with system Python 3.12 and the original timeout. Five isolation-fixture subprocesses subsequently exceeded the same deadline. All remaining local validator stages passed on the recorded commit, including all 42 executables, all 18 exact table coefficients and the repository kernel sweep. The source and 12 locked dependency checkouts were clean before and after. The complete unchanged isolation fixture passed on a hosted runner at the exact draft commit. Exact-head isolation run
Validation and independent audit of the earlier draft at 0884e49
The full local command
./scripts/validate.sh --lint --test --axiomspassed at commit0884e492c70522a9603339ff930e6075082886e7on Lean 4.36.0. All 12 dependencies matched the committed lock, including Mathlibfc4f59e5and PolyFun528b3b1f. The source and dependency checkouts were clean before and after validation. All seven generated umbrellas reproduced. All 42 registered executables ran, including the FORS, counted-game and wire-bridge tests. The regenerated bounds table matched all 18 exact coefficients. Environment lint matched the existing 127-entry baseline, and the kernel sweep found zero nonstandard-axiom orsorryAxtaint across 32,771 declarations in 1,341 modules.At that same revision, an independent client recompiled four security entry points with all 135 retired modules absent and matched 1,900 source and compiled-artifact checks across 475 repository modules. Its 14 axiom checks reported exactly
propext,Classical.choiceandQuot.sound. All 77 frozen declaration witnesses (75 theorems and two definitions) and 40 readable semantic equations passed. The 51 replacement modules had zero new environment-lint findings.All nine GitHub checks passed for that earlier revision. GitHub tested its merge with main
7c167e88at4de038f0, including the downstream build without submodules. Build, runtime tests and kernel audit · Downstream build