Documentation

CslibFrontier.Crypto.Computational.MLDSA.SplitMatrix

Evaluation coordinates for the ML-DSA matrix #

The 256 distinct roots of X^256 + 1 over the FIPS 204 field split the negacyclic coefficient algebra into 256 copies of that field. Evaluation commutes with each module matrix product. The kernel of a square coefficient matrix is therefore the product of the finite-field kernels in the 256 coordinates. Barbosa et al. [BarbosaEtAl2023, Appendix A.2, Lemma 8, p. 35] use this splitting to express the rank of a uniform ring matrix as the sum of the ranks of independent uniform field matrices.

Evaluation at the 256 odd powers of 1753, the primitive 512th root specified by FIPS 204. The index orders the roots by exponent.

noncomputable def Cslib.Crypto.MLDSA.FIPS204.matrixBlock {k ℓ : ℕ} (A : Matrix (Fin k) (Fin ℓ) Poly) (r : Fin 256) :
Matrix (Fin k) (Fin ℓ) (ZMod 8380417)

The field matrix obtained by evaluating every coefficient polynomial at the same root.

noncomputable def Cslib.Crypto.MLDSA.FIPS204.splitMatrixKernel {k ℓ : ℕ} (A : Matrix (Fin k) (Fin ℓ) Poly) :
{ y : Fin ℓ → Poly // moduleSISMap A y = 0 } ≃ { v : Fin 256 → Fin ℓ → ZMod 8380417 // ∀ (r : Fin 256), (matrixBlock A r).mulVec (v r) = 0 }

The actual coefficient kernel is equivalent to independently choosing a kernel vector for each evaluation coordinate. This includes singular and zero matrices.

Over a uniform FIPS coefficient matrix, the mean square root of the top submatrix's kernel size is below 11/10 at all three levels. Evaluation gives 256 independent uniform field matrices and preserves the entire kernel, including its size at singular matrices.

Expected square root of the largest commitment probability under the uniform public matrix. This uses the entire matrix distribution, including singular square submatrices.

Statistical distance of the classical signing simulation #

Discharge the maximum commitment probability in a fixed-matrix game comparison by averaging over the FIPS matrix. The bound is numerical at all three parameter sets.

theorem Cslib.Crypto.MLDSA.FIPS204.closeTo_simulateSigning_uniformMatrix (s : Level) (d ω K : ℕ) {Digest α : Type} (dist : PMF Digest) (expand : Digest → Poly) (hc : ∀ (c : Digest), InBall s.params.τ (expand c)) (s₁ : Fin s.params.ℓ → Poly) (s₂ : Fin s.params.k → Poly) (hs₁ : ∀ (i : Fin s.params.ℓ) (j : Fin 256), |(s₁ i j).valMinAbs| ≤ ↑s.params.η) (hs₂ : ∀ (i : Fin s.params.k) (j : Fin 256), |(s₂ i j).valMinAbs| ≤ ↑s.params.η) (forger : PublicKey s.params → OracleComp (SigningROMSpec s.params Digest) α) {S H : ℕ} (hS : ∀ (pk : PublicKey s.params), OracleComp.IsCostBounded Protocols.ROMSignature.signingCost (forger pk) S) (hH : ∀ (pk : PublicKey s.params), OracleComp.IsCostBounded Protocols.ROMSignature.hashCost (forger pk) H) :
Probability.CloseTo ((Probability.PMF.uniformOfFintype (Matrix (Fin s.params.k) (Fin s.params.ℓ) (Fin s.params.n → ZMod s.params.q))).bind fun (A : Matrix (Fin s.params.k) (Fin s.params.ℓ) (Fin s.params.n → ZMod s.params.q)) => have sk := { A := A, s₁ := s₁, s₂ := s₂ }; PMF.map Prod.fst (runBoundedSigningROM s.params false d ω K ⋯ dist expand sk (forger sk.publicKey))) ((Probability.PMF.uniformOfFintype (Matrix (Fin s.params.k) (Fin s.params.ℓ) (Fin s.params.n → ZMod s.params.q))).bind fun (A : Matrix (Fin s.params.k) (Fin s.params.ℓ) (Fin s.params.n → ZMod s.params.q)) => have pk := { A := A, s₁ := s₁, s₂ := s₂ }.publicKey; PMF.map Prod.fst (runAcceptedSigningROM s.params K dist (fun (c : Digest) => simulateFreshSigningAttempt s.params d ω ⋯ pk (expand c)) (forger pk))) (↑(2 * (S * K) * H + (S * K).choose 2) * ENNReal.ofReal (11 / 10 / √(2 ^ s.commitmentBoxBits)))

The adaptive ideal-mask signing simulation under a uniform FIPS matrix, for a digest expander that always returns a sparse challenge. The error counts all signing attempts and hash queries. The adversary chooses its program after receiving the public key.