Documentation

CslibFrontier.Crypto.Computational.MLDSA.SigningHedges

Distinct signing hedges in the ML-DSA forgery game #

Algorithm 2 of FIPS 204 samples 32 random bytes per call. For a forger making at most n adaptive signing requests, use one uniformly sampled injection to provide those bytes in request order. The change in strong-forgery probability is at most n (n − 1) / 2²⁵⁷. Both experiments evaluate the mask-seed derivation and every signing attempt on the same raw XOFs that the persistent quantum device accesses.

@[reducible, inline]

The requests charged against the classical signing budget in the quantum forgery game.

The maximum number of classical signing requests on each path, for every published key. Private samples, measurements, gates and coherent XOF calls have zero signing cost.

The honest signed transcript with the hedge for each call read from the supplied list. The quantum device uses device, and signing uses H. The fallback supplies zero bytes. The signing budget ensures sufficient tape for the comparison with honest signing.

Uniform hedges drawn before the first instruction give the joint law of the adaptive forgery and the entire signing log under the original XOFs.

The 256-bit hedge space supplies a distinct hedge for each of at most 2^256 slots.

noncomputable def Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.distinctHedgeGame (C : QuantumSigningForger) (s : Level) (base : Xofs) (a b : ℕ) {n : ℕ} (_hn : C.SigningCallsLe n) (hsize : n ≤ 2 ^ 256) (score : SignedMatrixTrial s → Bool) :

Run honest seeded key generation, signing and final scoring with a uniform injection providing the successive 32-byte signing hedges. The key, matrix, raw XOFs, adversary's output and log used for scoring all come from this execution.

theorem Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.dist_matrixTrial_distinctHedges (C : QuantumSigningForger) (s : Level) (base : Xofs) {a b n : ℕ} (ha : 272 ≤ a) (hb : 894 ≤ b) (hn : C.SigningCallsLe n) (hsize : n ≤ 2 ^ 256) (score : SignedMatrixTrial s → Bool) :
dist (PMF.map (fun (x : Option (SignedMatrixTrial s)) => Option.any score x) ((base.uniformPrefixes a b).bind (C.matrixTrial s))) (C.distinctHedgeGame s base a b hn hsize score) ≤ ↑(n * (n - 1)) / 2 ^ 257

Sampling the signing hedges without replacement changes the probability of any signed trial event by at most n(n−1)/2²⁵⁷. In particular the bound applies to the exact SignedMatrixTrial.newDigestWin term in randomPrefixGame_forgery_le.

theorem Cslib.Crypto.MLDSA.FIPS204.hedge_eq_of_maskSeedInput_eq {key : List Byte} {r r' : FixedBytes 32} {μ ν : List Bool} (h : maskSeedInput key r μ = maskSeedInput key r' ν) :
r = r'

At a fixed signing key the raw Algorithm 7 input determines the hedge, whatever message representative follows it.