Bounded ML-DSA signing #
FIPS 204 Algorithm 7 signs by rejection sampling. After the response and low-bits checks on
line 23, line 28 performs a second rejection check: ‖c t₀‖∞ < γ₂, and the hint has at most
ω set coefficients. This module adds that complete two-stage acceptance predicate to the
existing semantic ML-DSA surface and gives executable bounded-loop semantics.
The source-shaped loop takes an explicit mask schedule. Attempt i uses the counter
κ + i ℓ, matching Algorithm 7 line 31. Exhausting the supplied attempt limit returns none.
This pure result represents the standard's single error result, but does not model destruction
of intermediate state or side-channel behavior. The byte signer in MLDSA.FIPS204Signing supplies
the concrete seeded mask and challenge and uses the same response calculation.
Appendix C, Table 3 of the published FIPS 204 gives 814 as the minimum permitted bounded
signing limit under its stated hash/XOF distribution assumptions. This module does not derive
the standard's failure estimate from the semantic mask model.
Main definitions #
Cslib.Crypto.MLDSA.hintWeight: number of set hint coefficients.Cslib.Crypto.MLDSA.compressedSignAttempt: one semantic Algorithm 7 attempt, including both rejection stages.Cslib.Crypto.MLDSA.compressedSignBoundedFrom,Cslib.Crypto.MLDSA.compressedSignBounded: first successful attempt in a bounded mask schedule, with an explicit starting counter or counter zero.
Main results #
Cslib.Crypto.MLDSA.signAttempt_eq_some_of_compressedSignAttempt_eq_some: every compressed attempt output is also the corresponding uncompressed attempt output.Cslib.Crypto.MLDSA.compressedVerify_compressedSignAttempt,Cslib.Crypto.MLDSA.compressedVerify_compressedSignBounded: accepted attempts and bounded signing outputs pass compressed verification.
References #
Reading the materialized vector returns the original coefficients.
Algorithm 7 lines 18--30. Given the signer's low public-key term and sampled challenge, return the response and hint precisely when both rejection stages pass.
One semantic execution of FIPS 204 Algorithm 7 lines 11--30.
The hash and mask are still the abstract values used by Basic.lean; seed expansion, the message
representative, byte encodings and malformed-input behavior are not modeled here. Unlike
signAttempt, this compressed attempt constructs the FIPS hint and includes both line-28 checks.
Every compressed attempt output is also the corresponding output of the uncompressed
signAttempt; the compressed attempt only adds the second-stage checks and the hint.
Every accepted Algorithm 7 response has the prescribed response and hint bounds and reconstructs the exact high-bit commitment used by the signer.
Correctness of one compressed attempt. Under the secret-key and hash-to-ball bounds,
every signature returned by compressedSignAttempt passes compressedVerify under the matching
public key. The proof uses the derived compressed/uncompressed commitment bridge and the
MakeHint/UseHint recovery theorem.
Bounded Algorithm 7 signing from counter κ: return the first accepted signature among
K scheduled attempts, or none if every attempt rejects. This is the pure semantics of the
finite-maximum option in Section 6.2, footnote 10, and of Algorithm 7 lines 10--32.
Every signature returned by bounded signing from an arbitrary starting counter passes compressed verification under the matching public key.
Every signature returned by bounded signing from Algorithm 7's initial counter passes compressed verification under the matching public key.