Documentation

CslibFrontier.Crypto.Computational.MLDSA.AdaptiveSigningSimulation

Adaptive ML-DSA signing simulation #

The hybrid at index j serves the first j signing requests using native private-expansion rows. All later requests use the simulated service on the same evolving SHAKE stream. Each comparison preserves the state of the quantum device, the signing log and the byte verifier.

Loss from replacing the native commitment digests of all signing requests by independent samples and erasing rejected writes. The cap is the 814-attempt option of FIPS 204. Each summand uses the actual matrix's maximum commitment probability and its zero-based signing index. Failed setup contributes zero.

theorem Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.adaptiveSigningLoss_le_mean_sqrt (s : Level) (base : Xofs) {a b : ℕ} (n qH : ℕ) (ha : 272 ≤ a) (hb : 894 ≤ b) :
adaptiveSigningLoss s base a b n qH ≤ 814 * ↑n * (12 * ↑qH + 816 * ↑n + 815) * Finset.univ.expect fun (A : PublicMatrix s) => √(commitmentGuessProbability s.params ⋯ A).toReal

The total adaptive-signing loss in the seeded FIPS game is bounded by the uniform-matrix average of the square root of the largest commitment probability. The coefficient includes all the native and simulated requests and all 814 attempts per request.

theorem Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.abs_freshExpansionGame_sub_publicPairSigning_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) :
have publicGame := (base.uniformPrefixes a b).bind fun (H : Xofs) => H.fullPairExperiment s fun (rho : FixedBytes 32) (pair : PublicKey s.params) => PMF.map (fun (x : C.ProgrammedSigningResult s H) => x.trial.newDigestWin) (C.publicPairSigning s H rho pair); |↑(C.freshExpansionGame s base a b).succProbability - ↑(Game.succProbability publicGame)| ≤ adaptiveSigningLoss s base a b n qH

Replace every adaptive signing request in the fresh private-expansion game by the public-pair simulator. Keys come from the FIPS byte sampler. The left and right games both score fresh-digest forgeries on their final shared SHAKE streams. At signing index i the two losses pay for erasing rejected writes in the programmed future and for refreshing all digest reads after the native prefix. The expectation uses the generated matrices, with zero loss at failed setup.

theorem Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.randomPrefixGame_forgery_le_publicPairSigning (C : QuantumSigningForger) (s : Level) (base : Xofs) {a b n qH : ℕ} (ha : s.commitmentInputBits ≤ a) (hb : 894 ≤ b) (calls : C.SigningCallsLe n) (size : n ≤ 2 ^ 256) (hash : C.XofCallsLe qH) :
have R := base.uniformPrefixes a b; have trial := R.bind (C.matrixTrial s); have publicGame := R.bind fun (H : Xofs) => H.fullPairExperiment s fun (rho : FixedBytes 32) (pair : PublicKey s.params) => PMF.map (fun (x : C.ProgrammedSigningResult s H) => x.trial.newDigestWin) (C.publicPairSigning s H rho pair); have fresh := ↑(Game.succProbability publicGame) + adaptiveSigningLoss s base a b n qH; have expansion := (√fresh + 2 * ↑qH * √(↑n / 2 ^ 512)) ^ 2 + 2 * ↑n / 2 ^ 512 + ↑(n * (n - 1)) / 2 ^ 513; have seedLoss := 2 * ↑qH * √(2 * ↑n / 2 ^ 256) * (√(2 / 2 ^ 256) + ↑qH * (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 native finite-random-stream experiment after simulating every adaptive signature. The fresh-digest term uses only the generated full lattice public pair. The other two terms score the raw hash collision and the constructed Hermite-MSIS solver.