Module 03: Algebraic Lattices — Cyclotomic Rings, Modules, and NTT

1. The Efficiency Problem with Plain Z\mathbb{Z}-Lattices

If you built a commitment scheme directly from standard SIS/LWE over Zq\mathbb{Z}_q, look at the key sizes:

  • For 128-bit security, you need lattice dimension n≈512n \approx 512–10241024.
  • A public matrix A∈Zqn×mA \in \mathbb{Z}_q^{n \times m} with m≈2nlog⁡qm \approx 2n \log q has ≈107\approx 10^7 entries, and every matrix-vector multiply AxA\mathbf{x} takes O(n2log⁡q)O(n^2 \log q) operations!

Compare this with Elliptic Curves, where a group element is 32 bytes and Plonk uses FFTs over Fp\mathbb{F}_p in O(Nlog⁡N)O(N \log N) time.

How do lattices get fast O(dlog⁡d)O(d \log d) arithmetic and compact keys? Replace Z\mathbb{Z} with a polynomial ring RR! Just as Plonk works over polynomials mod XN−1X^N - 1, modern lattice proof systems work over cyclotomic rings R=Z[X]/(Xd+1)R = \mathbb{Z}[X]/(X^d + 1) (where dd is a power of 2, typically d=64,128,256,d = 64, 128, 256, or 10241024).


2. The Power-of-2 Cyclotomic Ring RR and RqR_q

Let d=2kd = 2^k be a power of 2. The polynomial Φ2d(X)=Xd+1\Phi_{2d}(X) = X^d + 1 is the (2d)(2d)-th cyclotomic polynomial, which is irreducible over Q\mathbb{Q} (and Z\mathbb{Z}). Define: R=Z[X](Xd+1),Rq=Zq[X](Xd+1)=R/qR.R = \frac{\mathbb{Z}[X]}{(X^d + 1)}, \qquad R_q = \frac{\mathbb{Z}_q[X]}{(X^d + 1)} = R / qR.

Every element a∈Ra \in R has a unique representative of degree <d< d: a(X)=a0+a1X+⋯+ad−1Xd−1,ai∈Z.a(X) = a_0 + a_1 X + \dots + a_{d-1} X^{d-1}, \quad a_i \in \mathbb{Z}.

2.1 Multiplication in RR: Negacyclic Convolution

When you multiply two polynomials in RR and reduce modulo Xd+1X^d + 1, you replace Xd≡−1X^d \equiv -1. For instance, X⋅a(X)=−ad−1+a0X+a1X2+⋯+ad−2Xd−1X \cdot a(X) = -a_{d-1} + a_0 X + a_1 X^2 + \dots + a_{d-2} X^{d-1}.

In matrix form, multiplying by a(X)a(X) on the left is multiplication by the negacyclic Toeplitz matrix rot(a)∈Zd×d\text{rot}(a) \in \mathbb{Z}^{d \times d}: rot(a)=(a0−ad−1−ad−2⋯−a1a1a0−ad−1⋯−a2a2a1a0⋯−a3⋮⋮⋮⋱⋮ad−1ad−2ad−3⋯a0).\text{rot}(a) = \begin{pmatrix} a_0 & -a_{d-1} & -a_{d-2} & \cdots & -a_1 \\ a_1 & a_0 & -a_{d-1} & \cdots & -a_2 \\ a_2 & a_1 & a_0 & \cdots & -a_3 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ a_{d-1} & a_{d-2} & a_{d-3} & \cdots & a_0 \end{pmatrix}.

Look at what just happened: One ring element a∈Rqa \in R_q stores dd scalars, yet acts like a d×dd \times d matrix! That cuts public matrix sizes by a factor of dd and turns d×dd \times d matrix-vector products into a single polynomial multiplication in RqR_q!

2.2 Norms on RR and the Expansion Factor γ\gamma

How do we measure the size of a polynomial a∈Ra \in R (or a vector a∈Rm\mathbf{a} \in R^m)? Using its coefficient vector vec(a)=(a0,…,ad−1)T∈Zd\text{vec}(a) = (a_0, \dots, a_{d-1})^T \in \mathbb{Z}^d:

  • ∥a∥∞=max⁡i∣ai∣\|a\|_\infty = \max_i |a_i|,
  • ∥a∥2=∑i=0d−1ai2\|a\|_2 = \sqrt{\sum_{i=0}^{d-1} a_i^2} (for a∈Rqa \in R_q, we always lift coefficients to the centered interval [−q/2,q/2)[-q/2, q/2) before measuring norms!).
  • For a vector a=(a(1),…,a(m))T∈Rm\mathbf{a} = (a^{(1)}, \dots, a^{(m)})^T \in R^m, ∥a∥2=∑j∥a(j)∥22\|\mathbf{a}\|_2 = \sqrt{\sum_j \|a^{(j)}\|_2^2} and ∥a∥∞=max⁡j∥a(j)∥∞\|\mathbf{a}\|_\infty = \max_j \|a^{(j)}\|_\infty.

Crucial Pitfall — Norm Multiplication: Unlike real numbers where ∣ab∣=∣a∣⋅∣b∣|ab| = |a|\cdot|b|, in R=Z[X]/(Xd+1)R = \mathbb{Z}[X]/(X^d+1) multiplication mixes coefficients! For any a,b∈Ra, b \in R: ∥a⋅b∥∞≤∥a∥1⋅∥b∥∞≤d⋅∥a∥∞∥b∥∞,\|a \cdot b\|_\infty \le \|a\|_1 \cdot \|b\|_\infty \le d \cdot \|a\|_\infty \|b\|_\infty, ∥a⋅b∥2≤∥a∥1⋅∥b∥2≤d⋅∥a∥2∥b∥2.\|a \cdot b\|_2 \le \|a\|_1 \cdot \|b\|_2 \le \sqrt{d} \cdot \|a\|_2 \|b\|_2. Wait: for random or independent short a,ba, b, the coefficients mostly cancel like a random walk, so typically ∥a⋅b∥2≈∥a∥2∥b∥2\|a \cdot b\|_2 \approx \|a\|_2 \|b\|_2 (only growing by ≈d\approx \sqrt{d} in the worst case, or even wt(a)\sqrt{\text{wt}(a)} if aa is sparse!). We also define the operator norm (often written ∥c∥op\|c\|_{\text{op}} or via the canonical embedding below) to bound ∥c⋅s∥2≤∥c∥op∥s∥2\|c \cdot s\|_2 \le \|c\|_{\text{op}} \|s\|_2.


3. Canonical Embedding & Galois Automorphisms

In algebra, K=Q[X]/(Xd+1)K = \mathbb{Q}[X]/(X^d + 1) is the (2d)(2d)-th cyclotomic number field. Let ζ=eiπ/d\zeta = e^{i\pi / d} be a primitive (2d)(2d)-th complex root of unity. The dd roots of Xd+1X^d + 1 in C\mathbb{C} are the odd powers: ζj=ζ2j+1,j=0,1,…,d−1.\zeta_j = \zeta^{2j+1}, \quad j = 0, 1, \dots, d-1.

3.1 Canonical Embedding σ\sigma

Evaluating a polynomial a(X)∈Ra(X) \in R at all dd roots gives the canonical embedding: σ:R↪Cd,σ(a)=(a(ζ0),  a(ζ1),  …,  a(ζd−1)).\sigma : R \hookrightarrow \mathbb{C}^d, \qquad \sigma(a) = \big(a(\zeta_0), \; a(\zeta_1), \; \dots, \; a(\zeta_{d-1})\big).

Why do lattice cryptographers love σ\sigma? Because σ\sigma turns polynomial multiplication into coordinate-wise multiplication! σ(a⋅b)=σ(a)⊙σ(b)  ⟹  ∥σ(a⋅b)∥∞≤∥σ(a)∥∞⋅∥σ(b)∥∞.\sigma(a \cdot b) = \sigma(a) \odot \sigma(b) \implies \|\sigma(a \cdot b)\|_\infty \le \|\sigma(a)\|_\infty \cdot \|\sigma(b)\|_\infty. Moreover, the matrix sending (a0,…,ad−1)(a_0, \dots, a_{d-1}) to (a(ζ0),…,a(ζd−1))(a(\zeta_0), \dots, a(\zeta_{d-1})) is a scaled unitary (DFT) matrix! By Parseval's identity: ∥σ(a)∥2=d⋅∥a∥2!\|\sigma(a)\|_2 = \sqrt{d} \cdot \|a\|_2! Look how clean that is: ∥a⋅b∥2=1d∥σ(a⋅b)∥2≤1d∥σ(a)∥∞∥σ(b)∥2=∥σ(a)∥∞⋅∥b∥2.\|a \cdot b\|_2 = \frac{1}{\sqrt{d}} \|\sigma(a \cdot b)\|_2 \le \frac{1}{\sqrt{d}} \|\sigma(a)\|_\infty \|\sigma(b)\|_2 = \|\sigma(a)\|_\infty \cdot \|b\|_2. So the operator norm ∥a∥op\|a\|_{\text{op}} of multiplying by a∈Ra \in R is bounded by ∥σ(a)∥∞=max⁡j∣a(ζj)∣\|\sigma(a)\|_\infty = \max_j |a(\zeta_j)|!

3.2 Galois Automorphisms σk\sigma_k

Notice that the field K=Q(ζ)K = \mathbb{Q}(\zeta) has a Galois group Gal(K/Q)≅Z2d×\text{Gal}(K/\mathbb{Q}) \cong \mathbb{Z}_{2d}^\times of order dd. For every odd integer k∈Z2d×k \in \mathbb{Z}_{2d}^\times, there is an automorphism σk:R→R\sigma_k : R \to R (and Rq→RqR_q \to R_q) defined by: σk(X)=Xk(modXd+1).\sigma_k(X) = X^k \pmod{X^d + 1}. Because Xd=−1X^d = -1, for k=−1k = -1 (i.e., 2d−12d - 1), we have σ−1(X)=X−1=−Xd−1\sigma_{-1}(X) = X^{-1} = -X^{d-1}! Let's check what σ−1(a)\sigma_{-1}(a) looks like for a(X)=∑i=0d−1aiXia(X) = \sum_{i=0}^{d-1} a_i X^i: σ−1(a)(X)=a0−ad−1X−ad−2X2−⋯−a1Xd−1.\sigma_{-1}(a)(X) = a_0 - a_{d-1} X - a_{d-2} X^2 - \dots - a_1 X^{d-1}.

Magic Trick (Foreshadowing Module 06): Compute the constant term (coefficient of X0X^0) of a(X)⋅σ−1(b)(X)a(X) \cdot \sigma_{-1}(b)(X) in RR: coeff0(a⋅σ−1(b))=∑i=0d−1aibi=⟨a,b⟩!\text{coeff}_0\big(a \cdot \sigma_{-1}(b)\big) = \sum_{i=0}^{d-1} a_i b_i = \langle \mathbf{a}, \mathbf{b} \rangle! Verify this yourself for d=2d=2: (a0+a1X)(b0−b1X)=(a0b0+a1b1)+(a1b0−a0b1)X(a_0 + a_1 X)(b_0 - b_1 X) = (a_0 b_0 + a_1 b_1) + (a_1 b_0 - a_0 b_1) X since X2=−1X^2 = -1! This single identity—conjugation σ−1\sigma_{-1} turns polynomial multiplication into an inner product in the constant term—is used in almost every modern lattice ZKP (LNP22, LaBRADOR, LatticeFold)!


4. Module-SIS and Module-LWE

Wait: why do modern proof systems use Module-SIS and Module-LWE rather than Ring-SIS / Ring-LWE (m=1m=1 or n=1n=1)?

  • Pure Ring-LWE (n=1n = 1): You work over a single huge ring of degree d=1024d = 1024 or 20482048. To change security level, you must jump dd by powers of 2 (512→1024→2048512 \to 1024 \to 2048), and ring-level algebraic attacks could conceivably exploit n=1n=1 ideal lattice structure.
  • Module-LWE / Module-SIS: Keep the ring degree small and fixed (e.g., d=64d = 64 or d=128d = 128 or d=256d = 256), and take small matrices over RqR_q, e.g. A∈Rqκ×mA \in R_q^{\kappa \times m} where rank κ∈{2,4,8,… }\kappa \in \{2, 4, 8, \dots\}!

The total underlying Z\mathbb{Z}-lattice dimension is N=κ⋅dN = \kappa \cdot d:

  • Module-SIS (M-SISκ,m,q,β\text{M-SIS}_{\kappa, m, q, \beta}): Given uniform A←Rqκ×mA \leftarrow R_q^{\kappa \times m}, find nonzero x∈Rm∖{0}\mathbf{x} \in R^m \setminus \{\mathbf{0}\} with ∥x∥2≤β\|\mathbf{x}\|_2 \le \beta such that Ax≡0(modq)A\mathbf{x} \equiv \mathbf{0} \pmod q.
  • Module-LWE (M-LWEκ,m,q,χ\text{M-LWE}_{\kappa, m, q, \chi}): Distinguish (A,As+e mod q)(A, A\mathbf{s} + \mathbf{e} \bmod q) from (A,u)(A, \mathbf{u}), where A←Rqm×κA \leftarrow R_q^{m \times \kappa}, s←χκ\mathbf{s} \leftarrow \chi^\kappa, e←χm\mathbf{e} \leftarrow \chi^m (using HNF short secrets!).

Why Module lattices are the sweet spot for ZKPs:

  1. Tune security smoothly by varying κ\kappa (just add/remove a row of AA) while keeping ring degree dd constant (e.g. d=64d = 64 in LaBRADOR / LNP22!).
  2. Keep the expansion factor d\sqrt{d} small (d=64  ⟹  d=8d=64 \implies \sqrt{d} = 8)!
  3. Still enjoy fast NTT multiplication!

5. CRT Splitting & Negacyclic NTT (Connecting Back to Plonk!)

In Plonk, you evaluate polynomials over a multiplicative subgroup H={1,ω,ω2,…,ωN−1}⊂Fp×H = \{1, \omega, \omega^2, \dots, \omega^{N-1}\} \subset \mathbb{F}_p^\times using the FFT/NTT so that polynomial multiplication becomes pointwise multiplication in evaluation form.

The exact same algebraic phenomenon happens in Rq=Zq[X]/(Xd+1)R_q = \mathbb{Z}_q[X]/(X^d + 1)!

Suppose qq is a prime. By the Chinese Remainder Theorem (CRT), RqR_q splits according to how Xd+1X^d + 1 factors modulo qq:

Case A: Fully Splitting Prime (q≡1(mod2d)q \equiv 1 \pmod{2d})

If q≡1(mod2d)q \equiv 1 \pmod{2d}, then Fq×\mathbb{F}_q^\times contains a primitive (2d)(2d)-th root of unity ψ\psi (with ψd≡−1(modq)\psi^d \equiv -1 \pmod q, and ω=ψ2\omega = \psi^2 a primitive dd-th root of unity). Then Xd+1X^d + 1 splits completely into dd distinct linear factors modulo qq: Xd+1≡∏j=0d−1(X−ψ2j+1)(modq).X^d + 1 \equiv \prod_{j=0}^{d-1} (X - \psi^{2j+1}) \pmod q. By the Chinese Remainder Theorem: Rq=Fq[X](Xd+1)  →  NTT    ∏j=0d−1Fq[X](X−ψ2j+1)  ≅  Fqd!R_q = \frac{\mathbb{F}_q[X]}{(X^d + 1)} \;\xrightarrow{\;\text{NTT}\;}\; \prod_{j=0}^{d-1} \frac{\mathbb{F}_q[X]}{(X - \psi^{2j+1})} \;\cong\; \mathbb{F}_q^d!

Look at what this gives you:

  1. Fast Multiplication: Compute NTT(a),NTT(b)∈Fqd\text{NTT}(a), \text{NTT}(b) \in \mathbb{F}_q^d in O(dlog⁡d)O(d \log d), multiply coordinate-wise, and apply NTT−1\text{NTT}^{-1}.
  2. SIMD / Batching (CRT Slots): A single ring element a∈Rqa \in R_q encodes dd independent field elements (a(ψ1),a(ψ3),…,a(ψ2d−1))∈Fqd(a(\psi^1), a(\psi^3), \dots, a(\psi^{2d-1})) \in \mathbb{F}_q^d! Adding or multiplying two ring elements in RqR_q performs dd parallel additions/multiplications in Fq\mathbb{F}_q!

CRITICAL WARNING (The CRT Trap!): In Rq≅FqdR_q \cong \mathbb{F}_q^d, NOT every nonzero element is invertible! An element a∈Rqa \in R_q is invertible mod qq if and only if all dd of its NTT slots are nonzero (a(ψ2j+1)≢0(modq)a(\psi^{2j+1}) \not\equiv 0 \pmod q for all jj). If even one slot is 0(modq)0 \pmod q, then aa is a zero divisor in RqR_q! This breaks naive Schwartz-Zippel and Schnorr extraction ((z1 - z2) / (c1 - c2)), because c1−c2c_1 - c_2 might not be invertible!

Case B: Partially Splitting Prime (q≡1+2d/k(mod4d/k)q \equiv 1 + 2d/k \pmod{4d/k}, e.g. q≡5(mod8)q \equiv 5 \pmod 8)

What if we pick qq so that Xd+1X^d + 1 does not split into linear factors, e.g., it splits into kk irreducible factors of degree d/kd/k? Xd+1≡∏j=0k−1fj(X)(modq),deg⁡(fj)=d/k.X^d + 1 \equiv \prod_{j=0}^{k-1} f_j(X) \pmod q, \qquad \deg(f_j) = d/k. Then by CRT: Rq≅∏j=0k−1Fqd/k!R_q \cong \prod_{j=0}^{k-1} \mathbb{F}_{q^{d/k}}!

Why would anyone want RqR_q to split into larger extension fields Fqd/k\mathbb{F}_{q^{d/k}} instead of Fq\mathbb{F}_q? Two huge reasons for proof systems:

  1. Invertibility of short differences (Lyubashevsky–Seiler Theorem): If Xd+1X^d + 1 only factors into kk large factors of degree d/kd/k (say k=2k = 2 or k=4k = 4), then any nonzero short polynomial c∈Rc \in R with ∥c∥∞\|c\|_\infty small enough cannot vanish modulo an irreducible factor fj(X)f_j(X)! Why? Because the norm of a polynomial modulo fjf_j bounds its minimum coefficient size (we'll see the exact bound in Module 05!). That guarantees every nonzero difference c1−c2c_1 - c_2 in a challenge set is invertible in RqR_q!
  2. Large Challenge / Soundness Field: If qq is small (like q≈232q \approx 2^{32} or q=261−1q = 2^{61}-1, or even q=Goldilocksq = \text{Goldilocks}), a single slot Fq\mathbb{F}_q might be big enough, or for tiny qq (e.g., q≈216q \approx 2^{16}), an extension field Fqd/k\mathbb{F}_{q^{d/k}} gives a 21282^{128} Schwartz-Zippel soundness error inside each CRT slot!

6. Why This Matters for Proof Systems

Here is the dual view of RqR_q that you will use constantly from Module 04 onward:

  • Geometry View (Coefficients): a∈Rqa \in R_q is a short vector (a0,…,ad−1)(a_0, \dots, a_{d-1}) in [−q/2,q/2)d[-q/2, q/2)^d. Security (M-SIS / M-LWE) and binding live here.
  • Algebraic View (NTT / CRT Slots): a∈Rqa \in R_q is a vector of kk field elements in Fqd/kk\mathbb{F}_{q^{d/k}}^k. Arithmetic checks, Plonk gates, batching, and Schwartz-Zippel live here!

Every modern lattice proof system dances between these two representations: prove algebraic identities in CRT/evaluation slots while guaranteeing smallness in coefficient space.


Exercises

  1. Negacyclic Multiplication: Let d=4d = 4, R=Z[X]/(X4+1)R = \mathbb{Z}[X]/(X^4 + 1), a(X)=1+2X−X3a(X) = 1 + 2X - X^3, and b(X)=2−X+X2b(X) = 2 - X + X^2.
    • Compute a(X)⋅b(X)a(X) \cdot b(X) in RR.
    • Verify that coeff0(a⋅σ−1(b))=⟨a,b⟩\text{coeff}_0(a \cdot \sigma_{-1}(b)) = \langle \mathbf{a}, \mathbf{b} \rangle for these two polynomials!
  2. NTT Splitting & Zero Divisors: Let d=4d = 4 and q=17q = 17. Check that ψ=2\psi = 2 is a primitive 88-th root of unity mod 1717 (so 24≡−1(mod17)2^4 \equiv -1 \pmod{17}).
    • Factor X4+1(mod17)X^4 + 1 \pmod{17} into 4 linear factors (X−ψ2j+1)(X - \psi^{2j+1}).
    • Find a nonzero polynomial c(X)∈R17c(X) \in R_{17} with coefficients in {−1,0,1}\{-1, 0, 1\} that is NOT invertible in R17R_{17} (i.e., c(ψ2j+1)≡0(mod17)c(\psi^{2j+1}) \equiv 0 \pmod{17} for some jj). (Hint: try 1−2X1 - 2X? Wait, coefficients in {−1,0,1}\{-1, 0, 1\}: try 1+X+X2+X31 + X + X^2 + X^3 or 1+X21 + X^2!)
  3. Partial Splitting: Let d=4d = 4 and q=5q = 5. Notice 5≡1(mod4)5 \equiv 1 \pmod 4 but 5≢1(mod8)5 \not\equiv 1 \pmod 8. Factor X4+1(mod5)X^4 + 1 \pmod 5 into two irreducible quadratics! (Hint: X4+1=(X2−2)(X2+2)(mod5)X^4 + 1 = (X^2 - 2)(X^2 + 2) \pmod 5? Check!) Why is 1+X1 + X invertible in R5R_5?
  4. Hands-on Lab (Rust + Arkworks): Run cargo run --bin lab02_ajtai_and_ntt inside labs/ (lab02_ajtai_and_ntt.rs) to test Negacyclic NTT via Arkworks' Radix2EvaluationDomain, inspect CRT zero divisors, and see how short vs. non-short openings behave in a ring-based Ajtai commitment.

(Solutions in exercise-solutions.md.)

results matching ""

    No results matching ""