Documentation

CslibFrontier.Crypto.Computational.MLDSA.CommitmentContinuation

Changing one commitment digest during a quantum ML-DSA execution #

Fix the current device, transcript and remaining private mask-expansion rows before drawing a fresh mask. Change the digest of its rounded commitment in the shared SHAKE256 stream. A coherent query contributes at most 4 * √δ to the expected absolute change in fresh-digest forgery probability, where δ is the largest atom of the rounded commitment for the fixed matrix. A later signing request contributes 815 * δ, and final verification contributes 2 * δ.

The query estimate uses the quantum query disturbance argument of [BBBV97]. The composition with the adaptive controller and the capped signer and verifier of [NIST24a], Algorithms 7 and 8 and Appendix C, is an original game comparison.

theorem Cslib.Crypto.MLDSA.FIPS204.Xofs.sq_sqrt_readout_after_maskCommitment_le (H : Xofs) (s : Level) (A : PublicMatrix s) (m : BitString 512) (D : BitString s.commitmentInputBits → BitString (8 * digestBytes s)) (replacement : (Fin s.params.ℓ → Poly) → BitString (8 * digestBytes s)) (a b w : ℕ) {κ σ α : Type} [Fintype κ] [DecidableEq κ] [Fintype α] (st : Quantum.DeviceState (a + 2 + 8 * b + w) κ σ) (M : (Fin s.params.ℓ → Poly) → Quantum.POVM α ((Fin (a + 2 + 8 * b + w) → Bool) × κ)) (outcome : α) :
have μ := signingMaskLaw s.params ⋯; have base := (H.withDigestRegister s D).queryTable a b; have write := fun (y : Fin s.params.ℓ → Poly) => (H.withDigestRegister s (Function.update D (maskCommitmentAddress s A m y) (replacement y))).queryTable a b; have p := fun (y : Fin s.params.ℓ → Poly) (T : (Fin (a + 2) → Bool) → Fin (8 * b) → Bool) => (M y).densityProb (Quantum.DeviceState.instruction T Quantum.OracleGateCode.query st).density outcome; ∑ y : Fin s.params.ℓ → Fin s.params.n → ZMod s.params.q, (μ y).toReal * (√(p y (write y)) - √(p y base)) ^ 2 ≤ 4 * (commitmentGuessProbability s.params ⋯ A).toReal

Mean squared change of the square root of an observable probability after one coherent SHAKE query when a fresh ML-DSA mask selects the digest to change. The final measurement may depend on the mask and the input device may carry an arbitrary entangled reference.

Resume the fresh-digest forgery game with a retained device, the successful signing log, and fixed remaining rows of Algorithm 34 bytes. Device queries, later signatures and final verification all use the same raw XOF streams.

theorem Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.mean_expansionContinuation_gap_le (C : QuantumSigningForger) (s : Level) (H : Xofs) (A : PublicMatrix s) (m : BitString 512) (D : BitString s.commitmentInputBits → BitString (8 * digestBytes s)) (replacement : (Fin s.params.ℓ → Poly) → BitString (8 * digestBytes s)) (keys : KeyPair) (prog : C.Program Forgery) (d : C.Device) (log : List Forgery) (tape : List (FixedBytes 2 → FixedBytes (maskPolyBytes s))) {qH qS : ℕ} (hash : OracleComp.IsCostBounded (fun (q : ℕ ⊕ Quantum.DeviceRequest C.Width Empty ⊕ SigningQuery) => (isXofQuery q).toNat) prog qH) (calls : OracleComp.IsCostBounded (fun (q : ℕ ⊕ Quantum.DeviceRequest C.Width Empty ⊕ SigningQuery) => (isSigningCall q).toNat) prog qS) :
have μ := signingMaskLaw s.params ⋯; have δ := (commitmentGuessProbability s.params ⋯ A).toReal; have win := fun (T : BitString s.commitmentInputBits → BitString (8 * digestBytes s)) => (C.expansionContinuation s (H.withDigestRegister s T) A keys prog d log tape).succProbability; ∑ y : Fin s.params.ℓ → Fin s.params.n → ZMod s.params.q, (μ y).toReal * |↑(win (Function.update D (maskCommitmentAddress s A m y) (replacement y))) - ↑(win D)| ≤ 4 * ↑qH * √δ + (815 * ↑qS + 2) * δ

For any remaining adaptive program, changing the digest at one fresh mask commitment changes the probability of a verified fresh-digest strong forgery by at most the coherent-query, signing and verification terms shown. The initial state and remaining tape are fixed before the mask is drawn. The replacement digest can depend on the mask.

theorem Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.freshExpansionGame_eq_expansionContinuation (C : QuantumSigningForger) (s : Level) (base : Xofs) (a b : ℕ) {n : ℕ} (hn : C.SigningCallsLe n) :
C.freshExpansionGame s base a b = do let H ← base.uniformPrefixes a b let seed ← Probability.PMF.uniformOfFintype (FixedBytes 32) match H.keyGen s seed with | some keys => match H.expandA s (List.take 32 keys.publicKey) with | some A => do let rows ← Probability.PMF.uniformOfFintype (Fin n → FixedBytes 2 → FixedBytes (maskPolyBytes s)) C.expansionContinuation s H A keys (C.program keys.publicKey) C.initialDevice [] (List.ofFn rows) | x => pure false | x => pure false

Running the resumed comparison at the initial device with independent mask-expansion rows gives the fresh-digest game in the original forgery bound, including failed key generation or public-matrix expansion.