Cryptography January 9th, 2026 27 min read

Post-Quantum Cryptography: Lattice-Based Cryptography and Mathematical Foundations

A comprehensive deep-dive into lattice-based cryptography, the mathematical backbone of post-quantum security. Explore the geometry of lattices, the Learning With Errors problem, and how ML-KEM and ML-DSA achieve quantum resistance.

AstraQ
By Team Astraq
Post-Quantum Cryptography: Lattice-Based Cryptography and Mathematical Foundations
Table of Contents

Series: Post-Quantum Cryptography

  1. Part 1Post-Quantum Cryptography: The Quantum Threat and Cryptographic Foundations
  2. Part 2Post-Quantum Cryptography: Lattice-Based Cryptography and Mathematical Foundations
  3. Part 3Post-Quantum Cryptography: Alternative Mathematical Frameworks and Cryptanalytic Lessons

In Part 1 of this series, we established the quantum threat to classical cryptography: Shor's algorithm breaks RSA and ECC in polynomial time, while Grover's algorithm halves security margins for symmetric schemes. We identified that post-quantum security requires problems fundamentally different from factoring and discrete logarithms: problems without the periodic structure that quantum algorithms exploit.

Lattice problems provide exactly this. Unlike the algebraic structures underlying RSA (the multiplicative group modulo nn) or ECC (elliptic curve point groups), lattices are geometric objects where the relevant hard problems, finding short vectors or solving noisy linear equations, have no known efficient quantum algorithms.

This article provides an exhaustive mathematical treatment of lattice-based cryptography, from the foundational geometry through the modern constructions standardized by NIST.

The Geometry of Lattices

Definition and Basic Properties

A lattice L\mathcal{L} is a discrete additive subgroup of Rn\mathbb{R}^n. Equivalently, given a set of linearly independent vectors B={b1,,bm}\mathbf{B} = \{\mathbf{b}_1, \ldots, \mathbf{b}_m\} where mnm \leq n, the lattice generated by B\mathbf{B} is:

L(B)={i=1mzibi:ziZ}\mathcal{L}(\mathbf{B}) = \left\{ \sum_{i=1}^{m} z_i \mathbf{b}_i : z_i \in \mathbb{Z} \right\}

The vectors {b1,,bm}\{\mathbf{b}_1, \ldots, \mathbf{b}_m\} form a basis of the lattice. When m=nm = n, we call the lattice full-rank.

Key observations:

  1. Non-unique basis: Every lattice has infinitely many bases. For any unimodular matrix U\mathbf{U} (integer matrix with determinant ±1\pm 1), B=BU\mathbf{B}' = \mathbf{BU} generates the same lattice.

  2. Fundamental parallelepiped: The region P(B)={ixibi:0xi<1}\mathcal{P}(\mathbf{B}) = \{\sum_{i} x_i \mathbf{b}_i : 0 \leq x_i < 1\} tiles Rn\mathbb{R}^n and has volume equal to det(B)|\det(\mathbf{B})|.

  3. Determinant invariance: While bases vary, the lattice determinant det(L)=det(B)\det(\mathcal{L}) = |\det(\mathbf{B})| is invariant across all bases.

Successive Minima and the Shortest Vector

For a lattice LRn\mathcal{L} \subset \mathbb{R}^n, the ii-th successive minimum λi(L)\lambda_i(\mathcal{L}) is the smallest radius of a ball centered at the origin containing ii linearly independent lattice vectors:

λi(L)=min{r:dim(span(LB(r)))i}\lambda_i(\mathcal{L}) = \min\{r : \dim(\text{span}(\mathcal{L} \cap \mathcal{B}(r))) \geq i\}

where B(r)\mathcal{B}(r) is the ball of radius rr.

The first successive minimum λ1(L)\lambda_1(\mathcal{L}) is the length of the shortest non-zero vector:

λ1(L)=minvL{0}v\lambda_1(\mathcal{L}) = \min_{\mathbf{v} \in \mathcal{L} \setminus \{0\}} \|\mathbf{v}\|

Minkowski's Theorem provides a fundamental bound:

λ1(L)n(det(L))1/n\lambda_1(\mathcal{L}) \leq \sqrt{n} \cdot (\det(\mathcal{L}))^{1/n}

This bound is tight up to constants for "random" lattices, but finding a vector achieving this bound is computationally hard.

The Gram-Schmidt Orthogonalization

Given a basis B=(b1,,bn)\mathbf{B} = (\mathbf{b}_1, \ldots, \mathbf{b}_n), the Gram-Schmidt orthogonalization (GSO) produces orthogonal vectors b~i\tilde{\mathbf{b}}_i:

b~i=bij=1i1μi,jb~jwhereμi,j=bi,b~jb~j2\tilde{\mathbf{b}}_i = \mathbf{b}_i - \sum_{j=1}^{i-1} \mu_{i,j} \tilde{\mathbf{b}}_j \quad \text{where} \quad \mu_{i,j} = \frac{\langle \mathbf{b}_i, \tilde{\mathbf{b}}_j \rangle}{\|\tilde{\mathbf{b}}_j\|^2}

The GSO vectors do not form a lattice basis (they typically have non-integer coefficients), but they characterize basis quality:

  • Good basis: GSO vectors have similar lengths
  • Bad basis: GSO lengths decay rapidly (last vectors much shorter)

The quality of a basis directly impacts the difficulty of lattice problems: a more orthogonal basis makes finding short vectors easier.


Computational Lattice Problems

The Shortest Vector Problem (SVP)

Exact SVP: Given a basis B\mathbf{B} for lattice L\mathcal{L}, find a non-zero vector vL\mathbf{v} \in \mathcal{L} with v=λ1(L)\|\mathbf{v}\| = \lambda_1(\mathcal{L}).

Approximate SVP (γ\gamma-SVP): Find a non-zero vector vL\mathbf{v} \in \mathcal{L} with vγ(n)λ1(L)\|\mathbf{v}\| \leq \gamma(n) \cdot \lambda_1(\mathcal{L}) for approximation factor γ(n)1\gamma(n) \geq 1.

Approximation Factor γ(n)\gamma(n)Known ComplexityRelevance
γ=1\gamma = 1 (exact)NP-hard under randomized reductionsTheoretical
γ=poly(n)\gamma = \text{poly}(n)No known polynomial algorithmCryptographic
γ=2n1/2\gamma = 2^{n^{1/2}}Polynomial time (LLL)Insufficient
γ=2O(n)\gamma = 2^{O(n)}Exponential time (enumeration)Attack baseline

The Closest Vector Problem (CVP)

Exact CVP: Given a basis B\mathbf{B} for lattice L\mathcal{L} and a target vector tRn\mathbf{t} \in \mathbb{R}^n, find the lattice vector vL\mathbf{v} \in \mathcal{L} closest to t\mathbf{t}:

v=argminuLtu\mathbf{v} = \arg\min_{\mathbf{u} \in \mathcal{L}} \|\mathbf{t} - \mathbf{u}\|

CVP and SVP are intimately related:

  1. CVP is at least as hard as SVP: There's an efficient reduction from SVP to CVP
  2. SVP is a special case: SVP asks for the closest vector to the origin, excluding the origin itself
  3. Both are NP-hard: Under appropriate reductions for exact and approximate versions

The Shortest Independent Vectors Problem (SIVP)

γ\gamma-SIVP: Given a basis for an nn-dimensional lattice L\mathcal{L}, find nn linearly independent lattice vectors v1,,vn\mathbf{v}_1, \ldots, \mathbf{v}_n such that:

maxiviγ(n)λn(L)\max_i \|\mathbf{v}_i\| \leq \gamma(n) \cdot \lambda_n(\mathcal{L})

SIVP is crucial for security reductions: Ajtai's and Regev's reductions connect average-case cryptographic problems to worst-case SIVP.


The Learning With Errors Problem

The Learning With Errors (LWE) problem, introduced by Oded Regev in 2005, is the cryptographic foundation of modern lattice-based schemes. It provides a clean, algebraic formulation with provable connections to worst-case lattice problems.

Problem Definition

Let n,qNn, q \in \mathbb{N} where qq is a modulus (typically prime), and let χ\chi be an error distribution over Z\mathbb{Z} (typically discrete Gaussian).

Search-LWE: Given polynomially many samples of the form:

(ai,bi=ai,s+eimodq)(\mathbf{a}_i, b_i = \langle \mathbf{a}_i, \mathbf{s} \rangle + e_i \mod q)

where aiZqn\mathbf{a}_i \leftarrow \mathbb{Z}_q^n uniformly random, sZqn\mathbf{s} \in \mathbb{Z}_q^n is a fixed secret, and eiχe_i \leftarrow \chi is a "small" error, find s\mathbf{s}.

Decision-LWE: Distinguish LWE samples (ai,ai,s+ei)(\mathbf{a}_i, \langle \mathbf{a}_i, \mathbf{s} \rangle + e_i) from uniform random pairs (ai,ui)(\mathbf{a}_i, u_i) where uiZqu_i \leftarrow \mathbb{Z}_q uniformly.

Matrix Formulation

In matrix form, LWE becomes: given

(A,b=As+emodq)(\mathbf{A}, \mathbf{b} = \mathbf{A}\mathbf{s} + \mathbf{e} \mod q)

where AZqm×n\mathbf{A} \in \mathbb{Z}_q^{m \times n}, sZqn\mathbf{s} \in \mathbb{Z}_q^n, eχm\mathbf{e} \in \chi^m, find s\mathbf{s} or distinguish from random.

This is essentially a system of mm linear equations in nn unknowns, but each equation is perturbed by noise:

{a1,1s1+a1,2s2++a1,nsn+e1b1(modq)a2,1s1+a2,2s2++a2,nsn+e2b2(modq)am,1s1+am,2s2++am,nsn+embm(modq)\begin{cases} a_{1,1}s_1 + a_{1,2}s_2 + \cdots + a_{1,n}s_n + e_1 \equiv b_1 \pmod{q} \\ a_{2,1}s_1 + a_{2,2}s_2 + \cdots + a_{2,n}s_n + e_2 \equiv b_2 \pmod{q} \\ \vdots \\ a_{m,1}s_1 + a_{m,2}s_2 + \cdots + a_{m,n}s_n + e_m \equiv b_m \pmod{q} \end{cases}

Without the error terms eie_i, Gaussian elimination would solve this in polynomial time. The errors, though small, render the system information-theoretically soluble but computationally intractable.

Regev's Security Reduction

Theorem (Regev 2005): For appropriate parameter choices, solving LWE on average is at least as hard as solving γ\gamma-SIVP in the worst case for γ=O~(nq/σ)\gamma = \tilde{O}(n \cdot q / \sigma), where σ\sigma is the Gaussian width.

This is a quantum reduction: an efficient LWE algorithm implies an efficient quantum algorithm for approximate SIVP. Peikert later provided a classical reduction from GapSVP to LWE.

The reduction works by showing that an LWE oracle can be used to iteratively sample from discrete Gaussian distributions on lattices, which in turn solves SIVP.

Implications:

  • If γ\gamma-SIVP is hard (no efficient quantum algorithm known), then LWE is hard
  • Breaking any LWE-based cryptosystem with suitable parameters would break a fundamental lattice problem
  • This is worst-case hardness: even the hardest SIVP instances are no harder than LWE

Parameter Trade-offs

LWE security depends on the interplay of:

ParameterSymbolEffect on SecurityEffect on Efficiency
Dimensionnn↑ Higher → harder↓ Larger keys/operations
Modulusqq↓ Larger → easier attacks↑ Larger values, more bits
Error widthσ\sigma↑ Larger → harder↓ Less margin for correctness
SamplesmmInitially ↑, then saturates↓ More computation

The error-to-modulus ratio σ/q\sigma/q is critical:

  • Too small → not enough noise, algebraic attacks succeed
  • Too large → decryption fails (errors overwhelm signal)
  • Sweet spot → cryptographic security with high probability correctness

Structured Lattices: Ring-LWE and Module-LWE

Standard LWE requires O(n2)O(n^2) storage for the public matrix A\mathbf{A} and O(n2)O(n^2) operations for matrix-vector products. For practical cryptosystems, this is prohibitive.

Structured variants exploit algebraic structure to achieve efficiency while (hopefully) preserving security.

Ring-LWE

Ring-LWE works over the polynomial ring Rq=Zq[x]/(f(x))R_q = \mathbb{Z}_q[x]/(f(x)) where f(x)f(x) is typically xn+1x^n + 1 with nn a power of 2.

Elements: Polynomials of degree <n< n with coefficients in Zq\mathbb{Z}_q:

a(x)=a0+a1x+a2x2++an1xn1a(x) = a_0 + a_1 x + a_2 x^2 + \cdots + a_{n-1} x^{n-1}

Operations: Addition is coefficient-wise. Multiplication is polynomial multiplication modulo f(x)f(x).

Ring-LWE Problem: Given samples (ai(x),bi(x)=ai(x)s(x)+ei(x))(a_i(x), b_i(x) = a_i(x) \cdot s(x) + e_i(x)), find s(x)s(x) or distinguish from random.

Advantages:

  • Compact keys: Public key is a single ring element, not an n×nn \times n matrix
  • Fast operations: Polynomial multiplication can be done in O(nlogn)O(n \log n) using the Number Theoretic Transform (NTT)

Security Considerations:

Ring-LWE's security reduces to worst-case problems on ideal lattices, a special class of lattices with additional algebraic structure. There's ongoing debate about whether this structure could be exploited by specialized attacks.

Module-LWE: The Best of Both Worlds

Module-LWE generalizes Ring-LWE by working with vectors and matrices of ring elements.

Setup: Let Rq=Zq[x]/(xn+1)R_q = \mathbb{Z}_q[x]/(x^n + 1). A Module-LWE instance uses:

  • A public matrix ARqk×\mathbf{A} \in R_q^{k \times \ell}
  • A secret vector sRq\mathbf{s} \in R_q^\ell
  • An error vector eRqk\mathbf{e} \in R_q^k with small coefficients

Relation to other LWE variants:

VariantMatrix SizeRing DimensionTotal Dimension
Plain LWEm×nm \times n1mnmn
Ring-LWE1×11 \times 1nnnn
Module-LWEk×k \times \ellnnknk \cdot \ell \cdot n

Module-LWE with rank k=k = \ell provides a tunable security-efficiency trade-off:

  • k=1k = 1: Equivalent to Ring-LWE (most efficient, potentially more structure to exploit)
  • k=nk = n: Approaches plain LWE (less efficient, fewer structural concerns)
  • k=2,3,4k = 2, 3, 4: Practical middle ground (used by Kyber/Dilithium)

Worst-Case to Average-Case Reductions

The crown jewel of lattice-based cryptography is its security proofs: breaking a cryptographic scheme implies breaking a worst-case lattice problem.

Ajtai's Breakthrough (1996)

Miklós Ajtai proved the first such reduction for the Short Integer Solution (SIS) problem.

SIS Problem: Given a random matrix AZqn×m\mathbf{A} \in \mathbb{Z}_q^{n \times m}, find a short non-zero vector zZm\mathbf{z} \in \mathbb{Z}^m such that:

Az=0modqwithzβ\mathbf{A}\mathbf{z} = \mathbf{0} \mod q \quad \text{with} \quad \|\mathbf{z}\| \leq \beta

Theorem (Ajtai 1996): Solving average-case SIS with m=poly(n)m = \text{poly}(n) columns implies solving worst-case γ\gamma-SIVP for γ=O~(βn)\gamma = \tilde{O}(\beta \sqrt{n}).

This means:

  • If any random A\mathbf{A} can be efficiently attacked, worst-case SIVP can be solved
  • Security of SIS-based hash functions rests on foundational lattice hardness

Regev's Reduction for LWE (2005)

Regev extended Ajtai's approach to LWE via a more intricate quantum reduction.

High-level idea:

  1. Start with a γ\gamma-SIVP instance (a lattice where we want short independent vectors)
  2. Use quantum sampling to generate points from the lattice's "smoothed" distribution
  3. Transform these samples into LWE samples
  4. Use the LWE oracle to recover information about the lattice
  5. Iterate to find progressively shorter vectors, solving SIVP

Key insight: Discrete Gaussian distributions on lattices have beautiful mathematical properties. Sampling from them (which quantum computers can help with) provides information about short lattice vectors.

Classical Reduction via Peikert

Peikert (2009) showed a classical reduction from GapSVP to LWE, removing the quantum requirement but with somewhat worse parameters.

GapSVPγ_\gamma: Given a basis, determine whether λ11\lambda_1 \leq 1 or λ1>γ\lambda_1 > \gamma (promised one holds).

Theorem (Peikert 2009): For q2nσq \geq 2\sqrt{n} \cdot \sigma, solving decision LWE classically implies solving GapSVPO~(nq/σ)_{\tilde{O}(n \cdot q/\sigma)} classically.

What the Reductions Mean

These reductions provide fundamentally different security guarantees than pre-quantum cryptography:

CryptosystemSecurity BasisType of Hardness
RSAFactoringAverage-case only (random moduli)
ECCECDLPAverage-case only (random curves)
LWE-basedSVP/SIVPWorst-case → average-case reduction

If someone breaks an LWE-based scheme, they've solved a problem that the entire mathematical community believes is fundamentally hard. This is a qualitatively stronger security foundation.


The Number Theoretic Transform

Efficient lattice cryptography relies on fast polynomial multiplication. The Number Theoretic Transform (NTT) is the modular arithmetic analog of the Fast Fourier Transform.

From FFT to NTT

The FFT computes the Discrete Fourier Transform using complex roots of unity. The NTT uses roots of unity in a finite field Zq\mathbb{Z}_q.

Requirement: qq must be a prime with 2n(q1)2n \mid (q - 1), ensuring primitive 2n2n-th roots of unity exist in Zq\mathbb{Z}_q.

For Kyber, q=3329=1+2813q = 3329 = 1 + 2^8 \cdot 13, so primitive 256256-th roots of unity exist.

NTT Definition

Let ωZq\omega \in \mathbb{Z}_q be a primitive nn-th root of unity (ωn1modq\omega^n \equiv 1 \mod q, but ωk≢1\omega^k \not\equiv 1 for 0<k<n0 < k < n).

The NTT of a polynomial a(x)=i=0n1aixia(x) = \sum_{i=0}^{n-1} a_i x^i is:

NTT(a)j=i=0n1aiωijmodq\text{NTT}(a)_j = \sum_{i=0}^{n-1} a_i \omega^{ij} \mod q

The inverse NTT recovers the original coefficients:

ai=n1j=0n1a^jωijmodqa_i = n^{-1} \sum_{j=0}^{n-1} \hat{a}_j \omega^{-ij} \mod q

where n1n^{-1} is the modular inverse of nn.

NTT-Based Polynomial Multiplication

To multiply polynomials a(x)b(x)mod(xn+1)a(x) \cdot b(x) \mod (x^n + 1):

  1. Forward NTT: Compute a^=NTT(a)\hat{a} = \text{NTT}(a) and b^=NTT(b)\hat{b} = \text{NTT}(b)
  2. Pointwise multiplication: c^i=a^ib^imodq\hat{c}_i = \hat{a}_i \cdot \hat{b}_i \mod q
  3. Inverse NTT: c=NTT1(c^)c = \text{NTT}^{-1}(\hat{c})

Complexity:

  • Naive polynomial multiplication: O(n2)O(n^2)
  • NTT-based multiplication: O(nlogn)O(n \log n)

For n=256n = 256 (Kyber's ring dimension), this is a 50x speedup.

NTT Domain Representation

Kyber and Dilithium store polynomials in NTT domain whenever possible:

  • Key generation produces NTT-domain keys
  • Encryption/signing work in NTT domain
  • Only convert back for operations requiring coefficient access

This optimization eliminates redundant NTT/inverse-NTT pairs.


ML-KEM (CRYSTALS-Kyber): In-Depth

ML-KEM (Module-Lattice Key Encapsulation Mechanism), standardized as FIPS 203, is the primary post-quantum key encapsulation mechanism. We now examine its cryptographic construction in detail.

The IND-CPA Encryption Scheme

At its core, ML-KEM builds on an IND-CPA (indistinguishable under chosen-plaintext attack) public-key encryption scheme.

Key Generation

  1. Generate random matrix ARqk×k\mathbf{A} \in R_q^{k \times k} (derived deterministically from a seed for compactness)
  2. Sample secret sRqk\mathbf{s} \in R_q^k and error eRqk\mathbf{e} \in R_q^k with small coefficients
  3. Compute t=As+eRqk\mathbf{t} = \mathbf{A}\mathbf{s} + \mathbf{e} \in R_q^k

Public key: (A,t)(\mathbf{A}, \mathbf{t}) — in practice, A\mathbf{A} is a seed, t\mathbf{t} is explicit

Secret key: s\mathbf{s}

Encryption

To encrypt message m{0,1}256m \in \{0, 1\}^{256}:

  1. Sample ephemeral secret rRqk\mathbf{r} \in R_q^k and errors e1Rqk\mathbf{e}_1 \in R_q^k, e2Rqe_2 \in R_q with small coefficients
  2. Compute: u=ATr+e1\mathbf{u} = \mathbf{A}^T \mathbf{r} + \mathbf{e}_1 v=tTr+e2+q/2mv = \mathbf{t}^T \mathbf{r} + e_2 + \lceil q/2 \rfloor \cdot m

Ciphertext: (u,v)(\mathbf{u}, v)

The message mm is encoded by scaling: each bit becomes either 00 or q/2\approx q/2 in the ciphertext.

Decryption

To decrypt (u,v)(\mathbf{u}, v):

  1. Compute vsTuv - \mathbf{s}^T \mathbf{u}
  2. For each coefficient, check if it's closer to 00 or q/2\lceil q/2 \rfloor
  3. Output corresponding bit

Why it works:

vsTu=(tTr+e2+q/2m)sT(ATr+e1)v - \mathbf{s}^T \mathbf{u} = (\mathbf{t}^T \mathbf{r} + e_2 + \lceil q/2 \rfloor \cdot m) - \mathbf{s}^T (\mathbf{A}^T \mathbf{r} + \mathbf{e}_1)

Substituting t=As+e\mathbf{t} = \mathbf{A}\mathbf{s} + \mathbf{e}:

=(sTAT+eT)r+e2+q/2msTATrsTe1= (\mathbf{s}^T \mathbf{A}^T + \mathbf{e}^T) \mathbf{r} + e_2 + \lceil q/2 \rfloor \cdot m - \mathbf{s}^T \mathbf{A}^T \mathbf{r} - \mathbf{s}^T \mathbf{e}_1 =eTr+e2sTe1+q/2m= \mathbf{e}^T \mathbf{r} + e_2 - \mathbf{s}^T \mathbf{e}_1 + \lceil q/2 \rfloor \cdot m

The error terms eTr+e2sTe1\mathbf{e}^T \mathbf{r} + e_2 - \mathbf{s}^T \mathbf{e}_1 are small (bounded by parameters). The message term q/2m\lceil q/2 \rfloor \cdot m dominates, allowing correct recovery.

The Fujisaki-Okamoto Transform

The IND-CPA scheme above is vulnerable to chosen-ciphertext attacks. The Fujisaki-Okamoto (FO) transform upgrades it to IND-CCA2 security.

Encapsulation:

  1. Generate random message m{0,1}256m \leftarrow \{0, 1\}^{256}
  2. Derive randomness r=G(m,pk)r = G(m, \text{pk}) for encryption
  3. Compute ciphertext c=Encpk(m;r)c = \text{Enc}_{\text{pk}}(m; r)
  4. Compute shared secret K=H(m,c)K = H(m, c)

Decapsulation:

  1. Decrypt m=Decsk(c)m' = \text{Dec}_{\text{sk}}(c)
  2. Re-encrypt to get c=Encpk(m;G(m,pk))c' = \text{Enc}_{\text{pk}}(m'; G(m', \text{pk}))
  3. Verify: If c=cc = c', return K=H(m,c)K = H(m', c); otherwise return random

The re-encryption check is crucial: it defeats attacks that submit malformed ciphertexts to extract information about the secret key.

ML-KEM Parameter Sets

ParameterML-KEM-512ML-KEM-768ML-KEM-1024
NIST Level135
Module rank kk234
Ring dimension nn256256256
Modulus qq332933293329
Public key (bytes)8001,1841,568
Ciphertext (bytes)7681,0881,568
Shared secret (bytes)323232

ML-DSA (CRYSTALS-Dilithium): In-Depth

ML-DSA (Module-Lattice Digital Signature Algorithm), standardized as FIPS 204, provides post-quantum digital signatures. It uses a fundamentally different construction from ML-KEM.

The Fiat-Shamir with Aborts Paradigm

Dilithium is based on the Fiat-Shamir transform applied to an identification scheme, with a crucial modification: rejection sampling.

Basic Fiat-Shamir intuition:

  1. Prover commits to a random value
  2. Verifier sends a challenge
  3. Prover responds, proving knowledge without revealing secret
  4. To sign, the "challenge" becomes a hash of the message

The problem: In lattice-based schemes, the response directly depends on the secret key. Repeated signatures could leak information.

Solution: Rejection sampling. The signer checks if the response would leak information; if so, they restart with fresh randomness.

Dilithium Construction

Key Generation

  1. Sample random matrix ARqk×\mathbf{A} \in R_q^{k \times \ell} (from a seed)
  2. Sample secret vectors s1Rq\mathbf{s}_1 \in R_q^\ell and s2Rqk\mathbf{s}_2 \in R_q^k with "small" coefficients
  3. Compute t=As1+s2\mathbf{t} = \mathbf{A}\mathbf{s}_1 + \mathbf{s}_2

Public key: (A,t)(\mathbf{A}, \mathbf{t}) (or seed + t\mathbf{t})

Secret key: (s1,s2)(\mathbf{s}_1, \mathbf{s}_2)

Signing

To sign message MM:

  1. Sample random "masking" polynomial yRq\mathbf{y} \leftarrow R_q^\ell with coefficients in [γ1+1,γ1][-\gamma_1 + 1, \gamma_1]
  2. Compute w=Ay\mathbf{w} = \mathbf{A}\mathbf{y}
  3. Compute challenge c=H(HighBits(w),M)c = H(\text{HighBits}(\mathbf{w}), M) where cc is a polynomial with few non-zero coefficients
  4. Compute response z=y+cs1\mathbf{z} = \mathbf{y} + c \cdot \mathbf{s}_1
  5. Rejection check: If z\mathbf{z} has any coefficient γ1β\geq \gamma_1 - \beta or if LowBits(Azct)\text{LowBits}(\mathbf{A}\mathbf{z} - c\mathbf{t}) is too large, restart from step 1
  6. Output signature (z,c,hint)(\mathbf{z}, c, \text{hint})

Signature: σ=(z,c,h)\sigma = (\mathbf{z}, c, h) where hh is a "hint" for efficient verification

Verification

To verify (M,σ)(M, \sigma) with public key (A,t)(\mathbf{A}, \mathbf{t}):

  1. Recover w=Azct\mathbf{w}' = \mathbf{A}\mathbf{z} - c\mathbf{t} (approximately, using hint hh)
  2. Check c=?H(HighBits(w,h),M)c \stackrel{?}{=} H(\text{HighBits}(\mathbf{w}', h), M)
  3. Check that z\mathbf{z} has coefficients in the expected range

The Rejection Sampling Analysis

The rejection step ensures that the distribution of z\mathbf{z} is statistically independent of the secret s1\mathbf{s}_1.

Without rejection, z=y+cs1\mathbf{z} = \mathbf{y} + c \cdot \mathbf{s}_1 correlates with s1\mathbf{s}_1. After many signatures, an adversary could extract s1\mathbf{s}_1.

With rejection sampling: only z\mathbf{z} values that could have come from many different secrets are output. The distribution is "masked" by the large random value y\mathbf{y}.

Expected number of attempts: Approximately e2.7e \approx 2.7 rejections per signature. This is the cost of provable security.

ML-DSA Parameter Sets

ParameterML-DSA-44ML-DSA-65ML-DSA-87
NIST Level235
Matrix dimensions4 × 46 × 58 × 7
Public key (bytes)1,3121,9522,592
Signature (bytes)2,4203,2934,595
Ring dimension256256256
Modulus qq8,380,4178,380,4178,380,417

Note the larger modulus (q223q \approx 2^{23}) compared to Kyber (q=3329q = 3329). This reflects the different algebraic requirements of signatures vs. encryption.


Lattice Basis Reduction Algorithms

Understanding the attacker's tools is essential for security analysis. Lattice reduction algorithms attempt to find short vectors and are the primary attack vector against lattice cryptography.

The LLL Algorithm

The Lenstra-Lenstra-Lovász (LLL) algorithm (1982) is the first polynomial-time lattice reduction algorithm.

Definition: A basis B=(b1,,bn)\mathbf{B} = (\mathbf{b}_1, \ldots, \mathbf{b}_n) is LLL-reduced with parameter δ(1/4,1)\delta \in (1/4, 1) if:

  1. Size condition: μi,j1/2|\mu_{i,j}| \leq 1/2 for all i>ji > j
  2. Lovász condition: δb~i12b~i2+μi,i12b~i12\delta \|\tilde{\mathbf{b}}_{i-1}\|^2 \leq \|\tilde{\mathbf{b}}_i\|^2 + \mu_{i,i-1}^2 \|\tilde{\mathbf{b}}_{i-1}\|^2

Output guarantee: The shortest vector in an LLL-reduced basis satisfies:

b12(n1)/2λ1(L)\|\mathbf{b}_1\| \leq 2^{(n-1)/2} \cdot \lambda_1(\mathcal{L})

This is an exponential approximation to SVP: good for low dimensions, useless for high dimensions.

Complexity: O(n5log3B)O(n^5 \log^3 B) where BB is a bound on input basis norms. Polynomial in dimension.

The BKZ Algorithm

Block Korkine-Zolotarev (BKZ) improves on LLL by solving SVP in projected sublattices of block size β\beta.

Algorithm outline:

  1. Apply LLL to get an initial reduced basis
  2. For each block of β\beta consecutive vectors, solve (approximate) SVP in the projected sublattice
  3. Insert the found short vector, re-reduce, and repeat
  4. Continue until no improvement

Output quality: With block size β\beta, BKZ finds a vector with:

b1γβn/β(detL)1/n\|\mathbf{b}_1\| \lesssim \gamma_\beta^{n/\beta} \cdot (\det \mathcal{L})^{1/n}

where γββ/(2πe)\gamma_\beta \approx \beta / (2\pi e) is the Hermite factor.

Example security implications:

Block Size β\betaApproximate FactorTime ComplexitySecurity Impact
2ExponentialPolynomialNone
201.01n\approx 1.01^nHours-daysLow dimensions broken
501.005n\approx 1.005^nMonths-yearsMedium security
300+1.001n\approx 1.001^nInfeasibleTarget for PQC

Known Attack Strategies

Primal attack: Construct a lattice where the LWE secret/error is a short vector. Use BKZ to find it.

Dual attack: Construct a short vector in the dual lattice, use it to distinguish LWE from random.

Hybrid attack: Guess part of the secret (reduces dimension), use lattice reduction on the rest.

All known attacks are exponential in the lattice dimension. No quantum algorithm provides more than polynomial speedup for lattice problems.


Security Analysis and Parameter Selection

Security Estimation

The security of ML-KEM and ML-DSA parameters is estimated via:

  1. Core-SVP model: Estimate BKZ block size β\beta needed
  2. Gate count: Translate to classical/quantum gate operations
  3. Comparison to AES: Match to corresponding NIST security levels

Current estimates (approximate classical/quantum bit security):

SchemeClassical SecurityQuantum Security
ML-KEM-512118 bits~107 bits
ML-KEM-768183 bits~164 bits
ML-KEM-1024256 bits~230 bits
ML-DSA-44128 bits~115 bits
ML-DSA-65192 bits~172 bits
ML-DSA-87256 bits~230 bits

These estimates assume the best known algorithms. A breakthrough in lattice reduction could change the picture.

Conservative vs. Aggressive Parameters

Conservative approach (recommended):

  • Use ML-KEM-768/1024 and ML-DSA-65/87 for systems requiring decades of security
  • Accounts for potential algorithmic advances
  • Larger keys/signatures, but manageable

Aggressive approach (performance-critical systems):

  • ML-KEM-512 and ML-DSA-44 for current security needs
  • May require algorithm agility for future updates
  • Smaller overhead

Side-Channel Considerations

Lattice schemes have specific side-channel vulnerabilities:

  1. Timing attacks: NTT operations, rejection sampling timing can leak information
  2. Power analysis: Polynomial operations have distinguishable power traces
  3. Fault attacks: Corrupting intermediate values can reveal secrets

Mitigations:

  • Constant-time implementations (no secret-dependent branches)
  • Masking: split sensitive values into random shares
  • Careful randomness generation

NIST standards include guidance on side-channel resistant implementation.


The Falcon Signature Scheme

While ML-DSA is NIST's primary lattice-based signature, Falcon offers an alternative with smaller signatures.

NTRU Lattices

Falcon builds on NTRU-type lattices:

L={(g,f)R2:g=hfmodq}\mathcal{L} = \{(\mathbf{g}, \mathbf{f}) \in R^2 : \mathbf{g} = h \cdot \mathbf{f} \mod q\}

where hh is a public polynomial and (f,g)(f, g) is a secret key with short coefficients.

GPV Framework

Falcon implements the Gentry-Peikert-Vaikuntanathan (GPV) hash-and-sign paradigm:

  1. Hash the message to a target point t\mathbf{t}
  2. Use a "trapdoor" (the secret key) to sample a short preimage s\mathbf{s} with As=tA\mathbf{s} = \mathbf{t}

The trapdoor enables Gaussian sampling from the lattice solution space.

Fast Fourier Sampling

Falcon's efficiency comes from its sampling algorithm:

  1. Represent the lattice basis in FFT form
  2. Sample Gaussian values using tree-structured computation
  3. Convert back to get signature polynomials

This achieves O(nlogn)O(n \log n) signature generation with minimal signature size.

Comparison with ML-DSA

PropertyML-DSA-65Falcon-512
NIST Level31
Public key (bytes)1,952897
Signature (bytes)3,293666
Sign speedVery fastFast
Verify speedVery fastFast
Implementation complexityLowerHigher

Falcon's smaller signatures come at the cost of more complex implementation, particularly the Gaussian sampler which must avoid side channels.


Conclusion and Series Overview

In this second part, we've provided a comprehensive treatment of lattice-based cryptography:

  • Lattice geometry: Bases, successive minima, Gram-Schmidt, and the structure of lattice problems
  • Computational problems: SVP, CVP, SIVP, and their approximation variants
  • Learning With Errors: The algebraic foundation with worst-case security reductions
  • Structured lattices: Ring-LWE and Module-LWE for practical efficiency
  • NIST standards: Deep dives into ML-KEM (Kyber) and ML-DSA (Dilithium) constructions
  • Security analysis: Lattice reduction, parameter selection, and attack cost estimation

Coming in Part 3: Alternative Mathematical Frameworks

The final part of this series explores non-lattice approaches to post-quantum cryptography:

  • Hash-based signatures (SLH-DSA/SPHINCS+): Security from Merkle trees and hash functions only
  • Code-based cryptography (Classic McEliece): Goppa codes and syndrome decoding
  • Isogeny-based cryptography: Supersingular elliptic curves and the SIKE mathematical attack
  • Multivariate cryptography: System of polynomial equations and the MQ problem

References and Further Reading

Foundational Papers

  • Regev, O. (2005). "On Lattices, Learning with Errors, Random Linear Codes, and Cryptography" — The LWE paper
  • Ajtai, M. (1996). "Generating Hard Instances of Lattice Problems" — First worst-case to average-case reduction
  • Lyubashevsky, V., Peikert, C., Regev, O. (2010). "On Ideal Lattices and Learning with Errors over Rings" — Ring-LWE
  • Peikert, C. (2009). "Public-Key Cryptosystems from the Worst-Case Shortest Vector Problem" — Classical LWE reduction

NIST Standards and Reports

  • FIPS 203 (2024). "Module-Lattice-Based Key-Encapsulation Mechanism Standard" (ML-KEM)
  • FIPS 204 (2024). "Module-Lattice-Based Digital Signature Standard" (ML-DSA)
  • NIST IR 8413 (2022). "Status Report on the Third Round of the NIST Post-Quantum Cryptography Standardization Process"
  • NIST IR 8545 (2024). "Status Report on the Fourth Round"

Surveys and Textbooks

  • Micciancio, D. & Regev, O. (2008). "Lattice-based Cryptography" — Comprehensive survey
  • Peikert, C. (2016). "A Decade of Lattice Cryptography" — Modern developments
  • Galbraith, S.D. (2012). "Mathematics of Public Key Cryptography" — Textbook with lattice chapters

Implementation Resources


Appendix: Mathematical Reference

Key Inequalities

Minkowski's bound on shortest vector:

λ1(L)n(detL)1/n\lambda_1(\mathcal{L}) \leq \sqrt{n} \cdot (\det \mathcal{L})^{1/n}

Hermite's constant (asymptotic):

γnn2πe(as n)\gamma_n \approx \frac{n}{2\pi e} \quad \text{(as } n \to \infty \text{)}

LWE noise bound for correctness (simplified):

e<q4    decryption succeeds with high probability\|e\|_\infty < \frac{q}{4} \implies \text{decryption succeeds with high probability}

Polynomial Ring Arithmetic

For Rq=Zq[x]/(xn+1)R_q = \mathbb{Z}_q[x]/(x^n + 1):

  • Addition: Coefficient-wise mod qq
  • Multiplication: Polynomial product mod xn+1x^n + 1 and mod qq
  • Reduction by xn+1x^n + 1: Since xn1x^n \equiv -1, terms xn+kx^{n+k} become xk-x^k

Discrete Gaussian Distribution

The discrete Gaussian over Z\mathbb{Z} with width σ\sigma:

DZ,σ(x)eπx2/σ2D_{\mathbb{Z}, \sigma}(x) \propto e^{-\pi x^2 / \sigma^2}

Samples concentrate near zero with standard deviation σ/2π\approx \sigma / \sqrt{2\pi}.

Complexity Summary

OperationComplexityUsed In
Matrix-vector multiply (standard)O(n2)O(n^2)Plain LWE
NTT-based polynomial multiplyO(nlogn)O(n \log n)Ring/Module-LWE
LLL reductionO(n5log3B)O(n^5 \log^3 B)Attack foundation
BKZ with block size β\beta20.292β\approx 2^{0.292\beta}Security estimation