Documentation

CslibFrontier.Crypto.Computational.MLDSA.ExpansionTrial

Refreshing a digest in the byte-row signing experiment #

In the private-expansion experiment the nonce-indexed byte row supplies the masks for the capped signer of [NIST24a], Algorithms 7 and 34. Resampling one coordinate preserves the joint law of all 814 scheduled masks. Stopping and resuming the adaptive controller at that attempt therefore preserves its read-only forgery law. This yields an original bound on replacing one digest in the seeded private-expansion experiment, averaged over its actual public matrices.

noncomputable def Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.expansionTrialGame (C : QuantumSigningForger) (s : Level) (base : Xofs) (a b : ℕ) {n : ℕ} (i : Fin n) (j : Fin 814) (write : Bool) :

The private-expansion signing experiment with one selected attempt. The actual seeded setup and the entire private row tape are sampled before running the forger. At that attempt the signer reads the shared digest, or writes a fresh digest and retains it on rejection.

Reading at the selected attempt has the exact fresh-digest forgery law of the original private-expansion signer, for every covered request and retry index. The row is sampled even when an earlier signature, fatal error, or early termination makes the selection unreachable.

theorem Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.abs_expansionTrialGame_write_sub_freshExpansionGame_le (C : QuantumSigningForger) (s : Level) (base : Xofs) {a b n qH : ℕ} (ha : s.commitmentInputBits ≤ a) (hb : digestBytes s ≤ b) (calls : C.SigningCallsLe n) (hash : C.XofCallsLe qH) (i : Fin n) (j : Fin 814) :
have matrices := (base.uniformPrefixes a b).bind fun (H : Xofs) => PMF.map (fun (seed : FixedBytes 32) => do let keys ← H.keyGen s seed H.expandA s (List.take 32 keys.publicKey)) (Probability.PMF.uniformOfFintype (FixedBytes 32)); have win := (C.expansionTrialGame s base a b i j true).succProbability; have orig := (C.freshExpansionGame s base a b).succProbability; |↑win - ↑orig| ≤ ∑ A : Option (PublicMatrix s), (matrices A).toReal * A.elim 0 fun (M : PublicMatrix s) => have δ := (commitmentGuessProbability s.params ⋯ M).toReal; 2 * (4 * ↑qH * √δ + (815 * ↑↑i + (1 + ↑↑j)) * δ)

At one attempt in the original private-expansion experiment, persistent reprogramming costs the average of the prior-query bound under the actual seeded matrix distribution. Failed key generation contributes zero. The same sampled streams are used for setup, signing, verification and public queries.