Repository navigation
proof(xmss): bound forgery when the signer tells why signing failed - #910
Merged
Merged
Conversation
tcoratger
force-pushed
the
ext23-except-reply
branch
from
November 6, 2026 12:45
32d5609 to
31045bf
Compare
In the unforgeability game, a failed signing request gets no signature. A variant game replies with the signer's whole result, so the adversary learns which layer found no codeword. The variant reuses the keys, oracles and winning rule of the game. A reduction answers each failure with the bottom layer's error, and the two games agree until the first failure. So the variant's advantage is at most the reduction's advantage plus the probability that some signing request fails. With the theorem, that is q / 2^127 plus this probability, where q bounds the reduction's hash calls. The failure probability stays an explicit term. Every adversary of the game, read in the variant, keeps its budget behind the reduction. A neutral module states the identical-until-bad lemma for two handlers that log the same entries through a writer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tcoratger
force-pushed
the
ext23-except-reply
branch
from
November 6, 2026 12:48
31045bf to
a96f1bc
Compare
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.
leanXMSS gets a corollary of its unforgeability theorem for a signer that replies with its error, so an adversary learns which layer failed.
The adversary's advantage is at most the theorem's bound plus the probability that some signing request fails.
It is a corollary on master's game, not a second game with its own proof.
The problem
In master's game, a failed signing request gets
none.signWithreturnsExcept XmssError Signature, and its only error isnoAdmissibleEncoding layer key: a one-time key found no codeword in its 2^32 randomizer trials.The request fixes the key on each layer, so the full reply leaks one bit: which layer failed.
#843 proposed a second game with this reply, and no bound on it (EXT-23 in the audit tracker).
A corollary of
unforgeablecovers that game without a second proof.The idea
Run the adversary behind a reduction to master's game, and compare the two games until the first failure.
ReasonAdversarysees the signer's whole result.reasonRunis master's game with that reply. Its log keepstoOptionof each result, soValidandContainsare reused as they are.hideReasonsis an adversary of master's game: it runs theReasonAdversaryand answers eachnonewith the bottom layer's error, whichever layer failed.prEvent_logReply_and_not_bad_leinProofs/LoggedUntilBad.lean, states that case of VCVio'sStateTidentical-until-bad lemma for handlers that log throughWriterT.signingFailureis the probability that the log of the variant game holds a failed request.The budget is the reduction's run in master's game.
After a failure, the reduction may reply with an error that the adversary never gets in the variant game, so the adversary's own budget does not bound that run.
hideReasons_ignoreReasonsshows the hypothesis is not empty: every adversary of master's game, read in the variant game throughtoOption, keeps master's budget behind the reduction.Example
The adversary asks for index
idx = 70000and messagem.The bottom key
70000finds a codeword; then the top keybottomTree 70000 = 1exhausts its 2^32 trials.error (noAdmissibleEncoding top 1), and the log records(request, none).none, the log records(request, none), and the adversary readserror (noAdmissibleEncoding bottom 70000).The logs agree, but the replies differ, so the runs may differ from here on.
The run has a failed request, so
signingFailurealready counts it.Without a failure, both oracles return
ok σand the runs are the same.For reviewers
signingFailureis an explicit term, not bounded here.prEvent_findCodeword_none_lebounds one search byexp(-4000)only when all its trial inputs are fresh; in the game the adversary's queries can hit them, unless it cannot know the secret seed. That freshness argument is the next step.qdoes not contain.prEvent_bind_le_add, is a corollary of VCVio'sprEvent_bind_le_sum_add_of_support.Proofs/; no Sphincs module is imported, and no definition of the scheme changes.Checks
lake build --wfailonProofs.LoggedUntilBad,Proofs.Xmss.Unforgeability.Reasons,Proofs.Xmss.Unforgeability,Proofs.XmssandProofs.Sphincs: passes (5,562 jobs).lake env lean:Reasons.lean4.8 s and 2.1 GB,LoggedUntilBad.lean3.7 s and 1.6 GB.leancheckerreplay, one module at a time withLEAN_NUM_THREADS=1at 8 GB:LoggedUntilBad4.6 s and 2.7 GB,Reasons5.5 s and 3.5 GB,Unforgeability20.7 s and 3.4 GB, no error.#print axioms reasonForgeAdvantage_le_add(a#guard_msgsinProofs/Xmss/Unforgeability.lean):propext,Classical.choice,Quot.sound.lake exe check-decls Proofs.LoggedUntilBad Proofs.Xmss.Unforgeability: 8,340 declarations, 0 findings.scripts/check_layers.py,scripts/soundness_facts.py --check,scripts/check_lean_layout.py --baseandscripts/check_writing.py --base: no findings.🤖 Generated with Claude Code