Micciancio–Peikert primitive gadget matrices, short bases, and gadget inversion #
This module formalizes the power-of-two primitive gadget construction of
Micciancio and Peikert, Section 4, Theorem 4.1 and Proposition 4.2
at modulus q = 2 ^ w, reusing the binary decomposition and recomposition operations from
Cslib.Crypto.Homomorphic.GSW (GSW.bitDecomp, GSW.bitCompose, GSW.powersOfTwo) and the
half-modulus bit decoder LWE.decode from Cslib.Crypto.LWE:
- Primitive gadget vector and matrix (
gadgetVector,gadgetMatrix): The geometric vectorg = (1, 2, …, 2 ^ (w - 1)) ∈ (ZMod (2 ^ w)) ^ w(Equation 4.1) and its block-diagonal tensor expansionG = I_ι ⊗ gᵀ : Matrix ι (ι × Fin w) (ZMod (2 ^ w)). Multiplication byGon the right isGSW.bitCompose(gadgetMatrix_mulVec), and multiplication on the left isGSW.powersOfTwo(vecMul_gadgetMatrix). - Deterministic syndrome decomposition (
scalarDecomp,gadgetDecomp,gadgetDecompMatrix): LiftingGSW.bitDecompto{0, 1}-valued integer vectors gives a right inverse tof_G(x) = G x mod 2 ^ w(gadgetMatrix_mulVec_gadgetDecomp,gadgetMatrix_mul_gadgetDecompMatrix), establishing thatGis primitive (gadgetMatrix_surjective). - Kernel lattice
Λ^⊥(gᵀ)andΛ^⊥(G)and the explicit short matrixS_w(scalarBasis,gadgetBasis): Forq = 2 ^ w, the lower-bidiagonal integer matrixS_w ∈ ℤ^{w × w}with2on the diagonal and-1on the subdiagonal (Section 4.1, Proposition 4.2) has columns inΛ^⊥(gᵀ)(gadgetVector_vecMul_scalarBasis), determinant2 ^ w(det_scalarBasis), entry magnitudes at most2(natAbs_scalarBasis_le_two), and squared Euclidean column norm at most5(sum_sq_scalarBasis_col_le_five). Its block-diagonal sumS = I_ι ⊗ S_w(gadgetBasis) satisfiesG S ≡ 0 (mod 2 ^ w)(gadgetMatrix_mul_gadgetBasis) with the same column norm bounds. The paper deduces thatS_wis a basis ofΛ^⊥(gᵀ)from these two facts and the index|ℤ^w / Λ^⊥(gᵀ)| = q; that lattice-index argument, and the Gram–Schmidt identityS̃_w = 2 I, are not formalized, so the generating-set property is not proved here. - Deterministic
g_G-inversion (invertScalar,invertGadget): The iterative nearest-plane algorithm of Section 4.1 recoverssfromg_G(s, e) = sᵀ G + eᵀ mod 2 ^ wwhenever every integer error coordinate satisfies4 * (e p).natAbs < 2 ^ w(invertScalar_correct,invertGadget_gadgetLWE). The paper allows everye_i ∈ [-q/4, q/4); the hypothesis here excludes only the endpoint-q/4.
General (non-power-of-two) moduli from Section 4.2 and randomized discrete-Gaussian preimage
sampling over cosets of Λ^⊥(G) are not formalized here.
Main definitions #
Cslib.Crypto.LWE.Trapdoor.gadgetVector,Cslib.Crypto.LWE.Trapdoor.gadgetMatrix: the primitive gadget vectorgand matrixG = I_ι ⊗ gᵀoverZMod (2 ^ w).Cslib.Crypto.LWE.Trapdoor.scalarDecomp,Cslib.Crypto.LWE.Trapdoor.gadgetDecomp,Cslib.Crypto.LWE.Trapdoor.gadgetDecompMatrix: binary{0, 1}-valued integer decompositions.Cslib.Crypto.LWE.Trapdoor.InScalarKernel: membership inΛ^⊥(gᵀ); membership inΛ^⊥(A)is the sharedCslib.Crypto.InKernelLattice.Cslib.Crypto.LWE.Trapdoor.scalarBasis,Cslib.Crypto.LWE.Trapdoor.gadgetBasis: the explicit short kernel matrixS_winΛ^⊥(gᵀ)and block matrixS = I_ι ⊗ S_winΛ^⊥(G)(shown to be bases in Section 4.1; kernel membership,det S_w = 2 ^ w, and norm bounds are proved here, not lattice generation).Cslib.Crypto.LWE.Trapdoor.gadgetLWE,Cslib.Crypto.LWE.Trapdoor.invertScalarAux,Cslib.Crypto.LWE.Trapdoor.invertScalar,Cslib.Crypto.LWE.Trapdoor.invertGadget: the gadget LWE mapg_G(s, e) = sᵀ G + eᵀand its iterative Section 4.1 inversion algorithm.
Main results #
Cslib.Crypto.LWE.Trapdoor.gadgetMatrix_mulVec,Cslib.Crypto.LWE.Trapdoor.vecMul_gadgetMatrix: bridges toGSW.bitComposeandGSW.powersOfTwo.Cslib.Crypto.LWE.Trapdoor.gadgetVector_dotProduct_scalarDecomp,Cslib.Crypto.LWE.Trapdoor.gadgetMatrix_mulVec_gadgetDecomp,Cslib.Crypto.LWE.Trapdoor.gadgetMatrix_mul_gadgetDecompMatrix,Cslib.Crypto.LWE.Trapdoor.gadgetMatrix_surjective: deterministic right-inversion off_Gand primitivity ofG.Cslib.Crypto.LWE.Trapdoor.gadgetVector_vecMul_scalarBasis,Cslib.Crypto.LWE.Trapdoor.det_scalarBasis,Cslib.Crypto.LWE.Trapdoor.sum_sq_scalarBasis_col_le_five,Cslib.Crypto.LWE.Trapdoor.gadgetMatrix_mul_gadgetBasis,Cslib.Crypto.LWE.Trapdoor.sum_sq_gadgetBasis_col_le_five:det S_w = 2 ^ wforS_w, and kernel membership and Euclidean column length≤ √5for bothS_wandS(Theorem 4.1 / Proposition 4.2; the basis property itself is not proved).Cslib.Crypto.LWE.Trapdoor.invertScalar_correct,Cslib.Crypto.LWE.Trapdoor.invertGadget_gadgetLWE: exact inversion ofg_G(s, e)under4 * (e p).natAbs < 2 ^ w(Theorem 4.1 / Section 4.1).
References #
- D. Micciancio and C. Peikert, Trapdoors for Lattices: Simpler, Tighter, Faster, Smaller, Section 4; numbering follows IACR ePrint 2011/501.
Primitive gadget vector and matrix #
The primitive gadget matrix G = I_ι ⊗ gᵀ over ZMod (2 ^ w)
([MP12], Section 4): row i has gadgetVector w in block i and zeros
elsewhere.
Right-multiplying gadgetMatrix w by a vector is GSW.bitCompose w.
Left-multiplying gadgetMatrix w by a row vector s is GSW.powersOfTwo w s.
Deterministic gadget decomposition (G⁻¹ for f_G) #
gadgetDecomp w is a deterministic right inverse of f_G(x) = G x mod 2 ^ w:
G *ᵥ gadgetDecomp w u = u ([MP12], Section 4).
scalarDecomp w is a deterministic right inverse of x ↦ ⟨g, x⟩ mod 2 ^ w.
Matrix form of gadget right-inversion: G * gadgetDecompMatrix w U = U modulo 2 ^ w.
The gadget matrix G is primitive ([MP12], Section 4): its integer column
combinations span (ZMod (2 ^ w)) ^ ι.
Kernel lattice Λ^⊥(gᵀ), Λ^⊥(G) and the explicit short basis S_w #
The matrix S_w ∈ ℤ ^ {w × w} that [MP12], Section 4.1 and
Proposition 4.2, shows is a short basis of Λ^⊥(gᵀ) for q = 2 ^ w: 2 on the diagonal, -1
on the first subdiagonal, and 0 elsewhere. This module proves kernel membership and the
determinant and norm bounds, not the basis property.
det(S_w) = 2 ^ w ([MP12], Section 4.1).
Every entry of S_w has magnitude at most 2.
Every column of S_w belongs to Λ^⊥(gᵀ) ([MP12], Section 4.1).
Matrix form of gᵀ S_w ≡ 0 (mod 2 ^ w) ([MP12], Section 4.1).
Every column of S_w has squared Euclidean length at most 5 (‖S_w‖ ≤ √5,
[MP12], Proposition 4.2).
Every entry of S = I_ι ⊗ S_w has magnitude at most 2.
G * S ≡ 0 (mod 2 ^ w) ([MP12], Section 4, Theorem 4.1).
Every column of gadgetBasis w belongs to Λ^⊥(G).
Every column of S = I_ι ⊗ S_w has squared Euclidean length at most 5 (‖S‖ ≤ √5,
[MP12], Theorem 4.1 and Proposition 4.2).
Deterministic g_G-inversion (Theorem 4.1, Section 4.1) #
Iterative scalar gadget inversion recovers s whenever 4 * (e j).natAbs < 2 ^ w for every
coordinate j ([MP12], Section 4.1, "Inversion"; the paper's condition
e_j ∈ [-q/4, q/4) also admits e_j = -q/4).
Blockwise gadget inversion recovers s from g_G(s, e) = sᵀ G + eᵀ mod 2 ^ w whenever
4 * (e p).natAbs < 2 ^ w for every coordinate p : ι × Fin w
([MP12], Theorem 4.1 and Section 4.1).