Documentation

CslibFrontier.Crypto.Computational.MLDSA.PrivateMaskExpansion

Private mask expansion in the signed ML-DSA game #

FIPS 204, Algorithms 7 and 34, expand each call's 64-byte mask seed at two-byte little-endian nonces. Draw the mask seeds and their raw expansion bytes before the quantum execution, retaining the same SHAKE stream for signing, key generation, coherent queries and verification. The strong-forgery bound charges for repeated private seeds, for overlap with the actual key-generation or message-digest reads, and for coherent queries to the reserved rows. Its reference signer draws the Algorithm 34 expansion bytes privately and uses the original shared commitment hash throughout the rejection loop.

Fresh-digest forgery when the signer draws the raw Algorithm 34 expansion bytes independently for each signing call and two-byte nonce, at the width of the parameter set. All retries use the FIPS decoder and commitment hash. The device and verifier use the same XOFs.

theorem Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.privateMaskSeedGame_le_freshExpansionGame (C : QuantumSigningForger) (s : Level) (base : Xofs) {a b n m : ℕ} (ha : 528 ≤ a) (hb : 32 * (s.params.γ₁.log2 + 1) ≤ b) (hn : C.SigningCallsLe n) (hsize : n ≤ 2 ^ 512) (hm : C.XofCallsLe m) :
↑(C.privateMaskSeedGame s base a b).succProbability ≤ (√↑(C.freshExpansionGame s base a b).succProbability + 2 * ↑m * √(↑n / 2 ^ 512)) ^ 2 + 2 * ↑n / 2 ^ 512 + ↑(n * (n - 1)) / 2 ^ 513

Changing Algorithm 34 from a private seeded SHAKE expansion to independent private rows for each call costs a coherent-query amplitude loss, two shared-input collision terms, and the birthday probability of the 512-bit mask seeds. The reference game still computes commitment digests and sparse challenges using the shared FIPS hash stream.

theorem Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.randomPrefixGame_forgery_le_freshExpansionGame (C : QuantumSigningForger) (s : Level) (base : Xofs) {a b n m : ℕ} (ha : 1024 ≤ a) (hb : 894 ≤ b) (hn : C.SigningCallsLe n) (hsize : n ≤ 2 ^ 256) (hm : C.XofCallsLe m) :
have R := base.uniformPrefixes a b; have trial := R.bind (C.matrixTrial s); have expansion := (√↑(C.freshExpansionGame s base a b).succProbability + 2 * ↑m * √(↑n / 2 ^ 512)) ^ 2 + 2 * ↑n / 2 ^ 512 + ↑(n * (n - 1)) / 2 ^ 513; have seedLoss := 2 * ↑m * √(2 * ↑n / 2 ^ 256) * (√(2 / 2 ^ 256) + ↑m * (2 / 2 ^ 128)); ↑(C.randomPrefixGame s base a b).succProbability ≤ (√(expansion + ↑n / 2 ^ 256) + seedLoss) ^ 2 + ↑(n * (n - 1)) / 2 ^ 257 + ↑(Game.succProbability (PMF.map (fun (x : Option (SignedMatrixTrial s)) => Option.any SignedMatrixTrial.hashCollision x) trial)) + ↑(Game.succProbability ((Probability.PMF.uniformOfFintype (PublicMatrix s)).bind fun (A : PublicMatrix s) => PMF.map (fun (v : Fin (s.params.k + s.params.ℓ) → Fin 256 → ℤ) => decide (ModuleSIS.IsSolution (ModuleSIS.hermiteMatrix A) (max (2 * (s.params.γ₁ - s.params.β)) (4 * s.params.γ₂ + 2)) v)) (R.bind fun (H : Xofs) => C.matrixSolver s H A)))

Strong-forgery bound for the original finite random-XOF ML-DSA experiment, with both Algorithm 7's private mask seed and Algorithm 34's secondary expansions removed from the fresh-digest term. Signing in that term still reads its commitment digest from the shared oracle and retains all 814 retry attempts.