Repository navigation
refactor(xmss)!: retire the legacy leanXMSS security proof - #5456
Draft
alexanderlhicks wants to merge 18 commits into
Draft
alexanderlhicks wants to merge 18 commits into
alexanderlhicks wants to merge 18 commits into
Conversation
Under fixed answers, a layer that yields a root makes 86 calls: the message digest, 68 chain steps (a codeword's digits sum to 106 over 58 chains), the leaf hash and 16 path hashes. An accepting verification therefore makes exactly 172 calls (length_queriesWith_verifyWith). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…acle XmssSecurity.Ghost.IsAdvHash and its decidability instance move, with the same names and bodies, from Proof/Scan/Ghost.lean to the light module XmssSecurity/HashOracle.lean. The fresh proof exports that predicate instead of keeping its own copy, so the own-query bound and the public own-query budget state the same predicate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VerifierReserve/Replay replays a supported counted run from its final cache, so every accepting model verification counts exactly 172 calls. VerifierReserve/Cut cuts the adversary at q - V own hash queries and keeps every winning run. VerifierReserve/Model combines both with the fresh own-query bound: with r calls after key generation, model forgery has probability 0 below 172 and at most r / 2^127 from there on (forgeAdvantage_le_afterKeygen). afterKeygenSecurity states the same as HasAfterKeygenSecurity Concrete.scheme. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
realGame_security takes its model term from VerifierReserve.afterKeygenSecurity instead of the lane proof, so unforgeable and its corollaries (adversary budget, lifetime, multi-key, signing errors) follow the fresh route. stronglyUnforgeable (+318) now follows from the new stronglyUnforgeable_173, which applies the (2q + 344) / 2^128 own-query bound. advantage_le_afterKeygen (+146) and advantage_le_afterKeygen_terms (+290) follow from the new advantage_le_afterKeygen_fresh (model term 0 below 172 calls, else r / 2^127) and advantage_le_afterKeygen_one ((q - K + 1) / 2^127). Every existing statement is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The downstream package gains a Contracts library with three fixtures: the all-calls, own-query, permutation, stateless and multi-key statements; the signing-error statements; and the tighter own-query and paid-work bounds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SOUNDNESS.md, the security README and the changelog state where each public leanXMSS bound now gets its model term: the own-query bound (2q + 344) / 2^128 and the verifier's reserve of 172 calls. They list the tighter stronglyUnforgeable_173, advantage_le_afterKeygen_fresh and advantage_le_afterKeygen_one next to the existing statements. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lake warns when a file without a module header imports EthLib, and the downstream package builds with --wfail. Each fixture now starts with module; its statements are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No public theorem, test or other module imports them; the bounds use the fresh route. BREAKING CHANGE: the deleted modules and their declarations are gone; the public statements are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No public theorem, test or other module imports them; the bounds use the fresh route. BREAKING CHANGE: the deleted modules and their declarations are gone; the public statements are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No public theorem, test or other module imports them; the bounds use the fresh route. BREAKING CHANGE: the deleted modules and their declarations are gone; the public statements are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No public theorem, test or other module imports them; the bounds use the fresh route. BREAKING CHANGE: the deleted modules and their declarations are gone; the public statements are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…onBound modules No public theorem, test or other module imports them; the bounds use the fresh route. BREAKING CHANGE: the deleted modules and their declarations are gone; the public statements are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The changelog lists the removed modules under the changes that break callers, with the statements that replace the two named model theorems. The security README no longer describes adaptations of removed files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eserve evalWithAnswerFn_counted and the lifted-count lemma state facts about HashSig.counted, not about XMSS. They move to HashSig/CountedCalls.lean; the second is countHashQueries_liftM_hash there, since HashSig.countHashQueries_liftM already names the coin case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bridge/Security.lean imported the reserve model, which imports Fresh/, so check_layers.py found directory cycles between Fresh/, XmssSecurity/ and XmssSecurity/Proof/. The reserve's model bound moves to Fresh/VerifierReserve.lean. Bridge/Security.lean states the real-game bound from any HasAfterKeygenSecurity Concrete.scheme (realGame_le_q_of_afterKeygenSecurity), and realGame_security, with the same name and statement, moves to Fresh/RealGame.lean, which Game.lean and Proofs/Xmss/Security.lean import. The security umbrella also imports Fresh/Regression.lean, so no module is left outside a library. BREAKING CHANGE: realGame_security is declared in Fresh/RealGame.lean; import it, or Proofs/Xmss/Security.lean, instead of Bridge/Security.lean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
advantage_le_afterKeygen_piecewise (was _fresh) states its model term with the public keyGenQueries. advantage_le_afterKeygen_add_one (was _one) gives (q - K + 1) / 2^127. The downstream fixtures become one file, XmssSecurityContracts.lean, which pins the statements that Consumer.lean does not: the two new bounds, stronglyUnforgeable_173, realGame_security, the adversary-budget, lifetime and bounded signing-error bounds, and the axioms of every security bound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README credits leanerVM only for the bridge and the model, and says that Fresh/ and the verifier reserve are written for EthLib. SOUNDNESS.md says that the 290 of advantage_le_afterKeygen_terms is slack and that 318 exceeds the 173 the proof needs. The changelog names the renamed theorems and the moved realGame_security. The adversary's hash instance keeps its doc comment, and a proof comment says why 173 = 172 + 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the regression module to the downstream test package and register it as a Contracts root. Update the security umbrella and fixture comments in the same commit, and clarify the verifier-reserve and bridge docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Codex, an AI agent, prepared and published this draft.
This is the second leanXMSS proof draft. Its base is
prototype/xmss-fresh-repinfrom the model proof, #5455. Merge order is #5377, #5455, then this PR.Public security bounds
All 13 established security endpoints now use the fresh model theorem. This includes the all-calls theorem through
realGame_security, the random-permutation and stateless corollaries, the multi-key bound, and the signing-error bounds. Existing security theorem statements keep their types. Three additional theorems expose the tighter estimates.stronglyUnforgeable_173qHdirect adversarial hash queries and the existing signing lifetime, public forgery advantage is at most(qH + 173) / 2^127.advantage_le_afterKeygen_piecewiseq, letr = q − 13,434,881be the calls remaining after key generation. The model term is zero forr < 172andr / 2^127otherwise. The real game adds the seed-guess termsr / 2^256 + (q − 1) / 2^256.advantage_le_afterKeygen_add_one(r + 1) / 2^127.An accepting verification spends exactly 172 hash calls. Reserving these calls gives
2(r − 172) + 344 = 2rforr ≥ 172. Downstream clients can continue to use the existing +318 own-query and +146 after-key-generation statements.Retirement and follow-up
The change deletes 143 superseded proof files containing 45,660 lines. The import closure of the unforgeability umbrella, its multi-key module and the XMSS security umbrella falls from 346 EthLib files and 91,349 lines to 222 files and 56,165 lines, counting comments on both sides. Across the entire diff from the parent proof branch, 162 files change, with 924 insertions and 45,774 deletions.
Eleven retained modules under
XmssSecurity/Proof/still have importers. None owns a constant reached by the audited public theorems:Wots,Execution,RandomOracle,UniformFiniteTable,Merkle,SecurityBudgetWotsExtraction,ForgeryCases,ConcreteForgery,CacheVerify,LazySchemeTheir removal is a follow-up after EthLib pins the merged VCVio #1431 APIs. Trim the imports and rebuild the downstream package first. In particular,
RandomOraclere-exports HashSig names that a kernel dependency walk cannot detect.Validation
XmssSecurityContractsand the movedtests/downstream/XmssFreshRegression.lean.check-theoremsand proof coverage, remain for CI. The closure counts measure source size. There is no comparable before-and-after build-time measurement.BREAKING CHANGE: The deleted internal proof modules and their declarations are no longer importable. Consumers of the public security bounds can keep their existing theorem names and types.