Strict-PPT discrete-grid Gaussian and HNF-free quotient samplers #
This module constructs the two lattice-specific strict probabilistic polynomial-time (IsPPTOn)
samplers supporting the Micciancio–Regev IncGDD to ℓ₂-SIS reduction (MR07Core):
Cslib.Crypto.SIS.MR07.sampleGridGaussian: drawsdimindependent 1-D discrete Gaussian coordinates viasampleZat widthq · √(sSq)and centerq · t_i, then reduces into the fundamental parallelepiped viagridReduceInt(built onsolveFloorMul,ratSolve,Rat.floor, andListMatrix.dotProduct).Cslib.Crypto.SIS.MR07.sampleQuotientModS: computes the quotient indexD = |det S| / |det B|via staged Bird determinants (quotientIndex), samplesdimnear-uniform coordinates inZMod DviasampleModNat, and reduces moduloP(S)viaquotientReduceInt(built onsolveFloorMulandListMatrix.dotProduct).
In addition to unconditional strict-PPT and product-pushforward CloseTo certificates, this module
proves exact matrix specifications (solveFloorMul_spec, quotientIndex_eq_natAbs_div_det,
gridReduceInt_spec, quotientReduceInt_spec) and typed-law bridges connecting the executable
list samplers directly to idealGridSample on GridRep B q × intLattice B (via
gridPairToLists / decodeGridPair) and to PMF.uniformOfFintype (SublatticeQuot B S) (via
sublatticeQuotToList / decodeSublatticeQuot).
Main definitions #
Cslib.Crypto.SIS.MR07.intTableMulVec,Cslib.Crypto.SIS.MR07.solveFloorMul: shared polynomial-time integer matrix-vector multiplication (ListMatrix.dotProduct), rational solve, andRat.floormultiply-back helpers.Cslib.Crypto.SIS.MR07.GridSampleInput,gridReduceInt,sampleGridGaussian: discrete-grid Gaussian sampler and input encoding.Cslib.Crypto.SIS.MR07.QuotientSampleInput,quotientIndex,quotientReduceInt,sampleQuotientModS: HNF-free quotient sampler and input encoding.Cslib.Crypto.SIS.MR07.gridEmbed,gridPairToLists,decodeGridPair,sublatticeQuotToList,decodeSublatticeQuot: canonical injective list encodings and left-inverse decoders between list outputs andMR07Core's typed lattice interfaces.
Main results #
Cslib.Crypto.SIS.MR07.computableInPolyTime_intTableToRatTable,Cslib.Crypto.SIS.MR07.computableInPolyTime_intTableMulVec,Cslib.Crypto.SIS.MR07.intTableMulVec_getD,Cslib.Crypto.SIS.MR07.ratSolve_intTable_real_spec,Cslib.Crypto.SIS.MR07.closeTo_eval_sampleModNat_clog_add_zmod: shared polynomial-time linear-algebra and modular-sampling helpers reused byMR07Reduction.Cslib.Crypto.SIS.MR07.isPPTOn_sampleGridGaussian,Cslib.Crypto.SIS.MR07.closeTo_eval_sampleGridGaussian_pi,Cslib.Crypto.SIS.MR07.closeTo_eval_sampleGridGaussian_pi_of_smoothingParameter_le,Cslib.Crypto.SIS.MR07.mem_support_sampleGridGaussian: strict-PPT, product-pushforwardCloseTo, and support certificates forsampleGridGaussian.Cslib.Crypto.SIS.MR07.isPPTOn_sampleQuotientModS,Cslib.Crypto.SIS.MR07.closeTo_eval_sampleQuotientModS_pi,Cslib.Crypto.SIS.MR07.mem_support_sampleQuotientModS: strict-PPT, product-pushforwardCloseTo, and support certificates forsampleQuotientModS.Cslib.Crypto.SIS.MR07.solveFloorMul_spec,Cslib.Crypto.SIS.MR07.quotientIndex_eq_natAbs_div_det,Cslib.Crypto.SIS.MR07.gridReduceInt_spec,Cslib.Crypto.SIS.MR07.quotientReduceInt_spec: exactIntTable/WellFormedspecifications connecting executable list reductions toMR07Corelattice geometry.Cslib.Crypto.SIS.MR07.piFin_discreteGaussianInt_map_gridEmbed,Cslib.Crypto.SIS.MR07.map_gridReduceInt_piFin_eq_map_idealGridSample,Cslib.Crypto.SIS.MR07.closeTo_eval_sampleGridGaussian_idealGridSample,Cslib.Crypto.SIS.MR07.closeTo_eval_sampleGridGaussian_idealGridSample_of_smoothingParameter_le,Cslib.Crypto.SIS.MR07.mem_support_sampleGridGaussian_exists_gridRep: typed-law bridge and lossless support recovery fromsampleGridGaussiantoidealGridSample.Cslib.Crypto.SIS.MR07.quotientReduceInt_eq_quotientHom,Cslib.Crypto.SIS.MR07.map_quotientReduceInt_piFin_eq_map_uniform,Cslib.Crypto.SIS.MR07.closeTo_eval_sampleQuotientModS_uniform,Cslib.Crypto.SIS.MR07.mem_support_sampleQuotientModS_exists_sublatticeQuot: typed-law bridge and lossless support recovery fromsampleQuotientModStoPMF.uniformOfFintype (SublatticeQuot B S).
References #
- D. Micciancio and O. Regev, Worst-Case to Average-Case Reductions Based on Gaussian Measures, §2 (p. 8) and §5.2 (Lemmas 5.7–5.8, pp. 20–21 of the December 27, 2005 author's copy).
1. Shared linear-algebra helpers (ListMatrix.dotProduct, Rat.floor, solveFloorMul) #
Polynomial-time certificate for casting an IntTable entrywise to a RatTable.
Row-wise integer matrix-vector multiplication B *ᵥ v via ListMatrix.dotProduct.
Polynomial-time certificate for intTableMulVec.
Shared exact rational-solve, coordinatewise Rat.floor, and integer multiply-back helper:
solves mat *ᵥ ξ = rhs, sets k = ⌊ξ⌋, and returns mat *ᵥ k via intTableMulVec.
2. Strict-PPT discrete-grid Gaussian sampler (sampleGridGaussian) #
Input specification for the discrete-grid Gaussian sampler sampleGridGaussian
([MR07a], Lemma 5.7, p. 20).
- dim : ℕ
Ambient lattice dimension
n. - modulus : ℕ
Integer grid modulus
q > 0. - basis : LinearAlgebra.IntTable
Basis matrix
Bof the latticeL(B)(columns are basis vectors). - sSq : ℚ
Rational squared Gaussian width
s² > 0. Target center
t ∈ ℚ^n.- tail : ℕ
Unary tail-cutoff multiplier
t_tailpassed tosampleZ. - prec : ℕ
Unary dyadic acceptance-coin precision
precpassed tosampleZ. - maxTrials : ℕ
Unary rejection-trial cap
maxTrialspassed tosampleZ.
Instances For
Framing encoding of GridSampleInput (binary modulus to permit super-polynomial q).
Exact integer grid reduction: given r' ∈ ℤ^dim, computes bk = solveFloorMul dim B (-r' / q)
and returns (u, y) = (-r' - q • bk, -bk).
Strict-PPT discrete-grid Gaussian sampler (r' ~ D_{ℤ^dim, q*s, q*t} followed by exact
gridReduceInt).
Strict-PPT certificate for sampleGridGaussian.
CloseTo bound for sampleGridGaussian against PMF.piFin of 1-D discrete Gaussians at
width q * √sSq and centers q * t_i, pushed forward by gridReduceInt.
Smoothing-parameter (η_ε(ℤ) ≤ q · √sSq) form of closeTo_eval_sampleGridGaussian_pi.
Every output pair in the support of sampleGridGaussian inp is the exact gridReduceInt
image of some length-inp.dim integer vector.
3. Strict-PPT HNF-free quotient sampler (sampleQuotientModS) #
Input specification for the HNF-free quotient sampler sampleQuotientModS.
- dim : ℕ
Ambient lattice dimension
n. - basis : LinearAlgebra.IntTable
Basis matrix
Bof the outer latticeL(B). - sublattice : LinearAlgebra.IntTable
Basis matrix
Sof the sublatticeL(S) ⊆ L(B). - extraBits : ℕ
Extra random bits per coordinate above
Nat.clog 2 D.
Instances For
Framing encoding of QuotientSampleInput.
Integer quotient index D = |det S| / |det B| computed via staged Bird determinants.
Exact integer quotient representative reduction: given x ∈ ℕ^dim, computes v0 = B *ᵥ x via
intTableMulVec, sk = solveFloorMul dim S v0, and returns v0 - sk.
HNF-free strict-PPT quotient sampler for L(B) ∩ P(S). Returns 0 if D = 0.
sampleModNat (Nat.clog 2 D + extraBits) D read in ZMod D is within 1 / 2 ^ extraBits
of PMF.uniformOfFintype (ZMod D) in CloseTo.
CloseTo bound for sampleQuotientModS against PMF.piFin of uniformOfFintype (ZMod D)
pushed forward by quotientReduceInt.
Every vector in the support of sampleQuotientModS inp is either the zero fallback (when
quotientIndex = 0) or the exact quotientReduceInt image of some length-inp.dim list.
4. Exact IntTable.toMatrix / WellFormed specifications #
Coordinatewise matrix specification of intTableMulVec: for any square IntTable T
representing B : Matrix (Fin n) (Fin n) ℤ, (intTableMulVec T v).getD i 0 = (B *ᵥ v) i.
Exact real-cast specification of ratSolve on a square invertible IntTable: for any T
representing B : Matrix (Fin n) (Fin n) ℤ with B.det ≠ 0, ratSolve returns a solution whose
real cast equals (B_ℝ)⁻¹ *ᵥ rhs coordinatewise (regardless of the .getD fallback).
Exact matrix specification of solveFloorMul: for any square invertible IntTable T
representing B : Matrix (Fin n) (Fin n) ℤ, solveFloorMul n T rhs equals
B *ᵥ ⌊(B_ℝ)⁻¹ *ᵥ rhs⌋ coordinatewise.
Exact determinant-index specification of quotientIndex: for well-formed square IntTables
representing B, S : Matrix (Fin n) (Fin n) ℤ with B.det ≠ 0 and intLattice S ≤ intLattice B,
quotientIndex TB TS = (S.det / B.det).natAbs.
Exact geometric specification of gridReduceInt against modParallelepiped and
intLattice: for invertible B and 0 < q, (u, y) from gridReduceInt n q T r' satisfies
u / q = (-r' / q) mod P(B) and y = r' / q + u / q ∈ intLattice B.
Exact geometric specification of quotientReduceInt against MR07Core.modParallelepiped:
for B = TB.toMatrix and invertible S = TS.toMatrix, v = quotientReduceInt n TB TS x
has length n and equals modParallelepiped S (B *ᵥ x).
5. Typed-law bridges to MR07Core.idealGridSample and SublatticeQuot #
5.1 Discrete-grid Gaussian sampler ↔ MR07.idealGridSample #
Bijection identifying Fin n → ℤ with the fine grid lattice G_q = (1 / q) ℤⁿ.
gridPairToLists is injective on GridRep B q × intLattice B.
decodeGridPair is a left inverse to gridPairToLists.
Exact product factorization: PMF.piFin of 1-D integer discrete Gaussians at (q · s, q · t_i)
pushed through gridEmbed equals ZLattice.discreteGaussian (gridLattice n q) s hs t.
Build the typed GridRep B q × intLattice B witness from gridReduceInt_spec on any
r' : List ℤ (zero decoding loss).
Every output pair in the support of sampleGridGaussian inp encodes a valid
GridRep B inp.modulus × intLattice B recovered losslessly by decodeGridPair.
Exact target-law equality connecting sampleGridGaussian's product-pushforward PMF to
MR07Core.idealGridSample pushed through gridPairToLists.
CloseTo guarantee for sampleGridGaussian decoded into the typed
GridRep B inp.modulus × intLattice B law idealGridSample.
Smoothing-parameter (η_ε(ℤ) ≤ q · √sSq) form of
closeTo_eval_sampleGridGaussian_idealGridSample.
5.2 HNF-free quotient sampler ↔ PMF.uniformOfFintype (SublatticeQuot B S) #
sublatticeQuotToList is injective on SublatticeQuot B S.
decodeSublatticeQuot is a left inverse to sublatticeQuotToList.
Positivity of quotientIndex TB TS for invertible B, S with intLattice S ≤ intLattice B.
Every quotientReduceInt n TB TS x output is the exact sublatticeQuotToList image of a
typed SublatticeQuot B S representative (zero decoding loss).
Every output in the support of sampleQuotientModS inp encodes a valid SublatticeQuot B S
representative recovered losslessly by decodeSublatticeQuot B S.
Pointwise identity: quotientReduceInt on z : Fin n → ZMod (S.det / B.det).natAbs equals
sublatticeQuotToList (MR07Core.quotientHom B S hS hSB z).
Exact target-law equality connecting sampleQuotientModS's product-pushforward PMF to
PMF.uniformOfFintype (SublatticeQuot B S) pushed through sublatticeQuotToList.
CloseTo guarantee for sampleQuotientModS decoded into the typed uniform law
PMF.uniformOfFintype (SublatticeQuot B S).