Documentation

CslibFrontier.Crypto.Computational.LWE.PrimeModulus

Prime-modulus LWE encodings, ensembles, and search games #

Framed binary encodings, sample distributions, and finite search games for learning with errors over ZMod q with prime modulus q, supporting the normal-form and search-to-decision finite probability bounds in NormalForm and SearchToDecision.

In the uniform-secret model (realEnsemble, searchGame), a sample draws a uniform secret s, a uniform matrix A, and independent errors e from noise, encoding [A * s + e | A] via encMatrix. In the error-secret (normal-form) model (publicMatrixLawErrorSecret, realEnsembleErrorSecret, searchGameErrorSecret), s is instead drawn with independent coordinates from noise. The comparison distribution uniformEnsemble encodes a uniform matrix of the same shape.

Main definitions #

Main results #

References #

Encode a ZMod q element.

Encode a ZMod q vector.

Encode a matrix over ZMod q.

With a uniform matrix A and a uniform error e, the public matrix [A * s + e | A] is uniform, whatever the secret s.

noncomputable def Cslib.Crypto.PrimeLWE.publicMatrixLawErrorSecret (n m q : ℕ) [Fact (Nat.Prime q)] (noise : PMF (ZMod q)) :
PMF (Matrix (Fin m) (Fin (n + 1)) (ZMod q))

Draw the public matrix [A * s + e | A] where s is drawn from the error distribution.

noncomputable def Cslib.Crypto.PrimeLWE.realEnsemble (n m q : ℕ → ℕ) [∀ (security : ℕ), Fact (Nat.Prime (q security))] (noise : (security : ℕ) → PMF (ZMod (q security))) (security : ℕ) :

The prime LWE real ensemble.

noncomputable def Cslib.Crypto.PrimeLWE.realEnsembleErrorSecret (n m q : ℕ → ℕ) [∀ (security : ℕ), Fact (Nat.Prime (q security))] (noise : (security : ℕ) → PMF (ZMod (q security))) (security : ℕ) :

The prime LWE real ensemble with error secret.

noncomputable def Cslib.Crypto.PrimeLWE.uniformEnsemble (n m q : ℕ → ℕ) [∀ (security : ℕ), Fact (Nat.Prime (q security))] (security : ℕ) :

The uniform ensemble for prime modulus.

noncomputable def Cslib.Crypto.PrimeLWE.searchGame (n m q : ℕ) [Fact (Nat.Prime q)] (noise : PMF (ZMod q)) (adversary : List Bool → ProbComp (List Bool)) :

The prime search LWE game.

noncomputable def Cslib.Crypto.PrimeLWE.searchGameErrorSecret (n m q : ℕ) [Fact (Nat.Prime q)] (noise : PMF (ZMod q)) (adversary : List Bool → ProbComp (List Bool)) :

The prime search LWE game with secret drawn from the error distribution.