Prerequisite: CVP by Kannan Embedding

Suppose a power trace on an ML-KEM microcontroller leaks the noisy Hamming weight of 40 polynomial multiplications, or a cold-boot snapshot reveals 60 scattered bits of the secret key. Neither leak recovers ss by Gaussian elimination alone, yet clearly the remaining instance is weaker than a fresh NIST Level 3 key. At CRYPTO 2020, Dachman-Soled, Ducas, Gong, and Rossi (DDGR20) unified side-channel cryptanalysis and lattice reduction by showing how each leaked equation reshapes the primal Kannan lattice before BKZ ever starts.

The four DDGR20 hint types and their geometric effect

Recall from Primal LWE Attacks by Hand that a reducer wins when β σ≤δ02β−d−1det⁡(L)1/d\sqrt{\beta}\,\sigma \le \delta_0^{2\beta - d - 1} \det(L)^{1/d}. Every useful hint improves that inequality through one of three levers: lowering dimension dd, increasing covolume det⁡(L)\det(L) (making competing lattice points sparser), or shrinking target variance σ2\sigma^2:

Hint typeAlgebraic formGeometric effect on LLTypical physical source
Perfect hint⟨v, s⟩ = l (exact over ℤ)Intersect with hyperplane; eliminates 1 lattice dimension & rescales covolumeCold-boot bit recovery, faulted zero coefficient, exact Hamming-weight slice
Modular hint⟨v, s⟩ ≡ l (mod k)Sparsifies lattice to an index-k sublattice; multiplies det(L) by k without raising dCRT/NTT butterfly leak, partial key bits modulo 2^r
Approximate hint⟨v, s⟩ = l + ε (Var(ε) = σ_ε²)Updates posterior mean μ and covariance Σ; anisotropic whitening W = Σ^(−1/2)Power/EM template trace (SPA/DPA), decryption-failure inequality
Short-vector hintv ∈ Λ known to be unusually shortProjects lattice orthogonally off span(v), dropping dimension by 1Algebraic ring structure or leaked trapdoor vector

Worked example: folding perfect and modular hints into a 7D basis

Take n=3,m=3,q=97n = 3, m = 3, q = 97 with secret s=(2,−1,1)s = (2, -1, 1) and error e=(1,−1,0)e = (1, -1, 0):

A=[143581621944277312],b=(As+e) mod 97=[755290]A = \begin{bmatrix} 14 & 35 & 81 \\ 62 & 19 & 44 \\ 27 & 73 & 12 \end{bmatrix}, \qquad b = (A s + e) \bmod 97 = \begin{bmatrix} 75 \\ 52 \\ 90 \end{bmatrix}

The standard 7×77 \times 7 Kannan row basis has rows [97I3∣0∣0][97 I_3 \mid 0 \mid 0], [A⊤∣I3∣0][A^\top \mid I_3 \mid 0], and [−b⊤∣0∣1][-b^\top \mid 0 \mid 1], containing target (−e,  s,  1)=(−1,1,0,2,−1,1,1)(-e,\; s,\; 1) = (-1, 1, 0, 2, -1, 1, 1) with det⁡(L)=973=912,673\det(L) = 97^3 = 912{,}673.

  1. Fold a perfect hint s0+s1=1s_0 + s_1 = 1: Substitute s0=1−s1s_0 = 1 - s_1 directly into As≡b−e(mod97)A s \equiv b - e \pmod{97}: subtract column 0 of AA from bb to get b′=(b−a0) mod 97b' = (b - a_0) \bmod 97 and replace columns (a0,a1)(a_0, a_1) by the single column (a1−a0) mod 97(a_1 - a_0) \bmod 97. The lattice drops from dimension 7 to dimension 6 while keeping det⁡(L′)=973\det(L') = 97^3, raising the normalized covolume from 973/7≈7.1197^{3/7} \approx 7.11 to 973/6=97≈9.8597^{3/6} = \sqrt{97} \approx 9.85!
  2. Fold a modular hint s2≡1(mod2)s_2 \equiv 1 \pmod 2 (parity leak): Write s2=1+2s2′s_2 = 1 + 2 s_2', shift b′←(b′−a2) mod 97b' \leftarrow (b' - a_2) \bmod 97, and double the s2s_2-coordinate weight so the lattice enforces even steps along that coordinate (an index-2 sublattice, doubling det⁡\det at fixed dimension 6!).

Why approximate hints require Σ−1/2\Sigma^{-1/2} whitening

What if a power trace instead tells you s0+s1+s2=2+εs_0 + s_1 + s_2 = 2 + \varepsilon with Gaussian measurement noise σε=0.25\sigma_\varepsilon = 0.25? You cannot intersect the lattice with a hard hyperplane because ε≠0\varepsilon \neq 0. Instead, Bayesian conditioning updates the secret's mean vector μ\mu and shrinks its n×nn \times n covariance matrix from σ2I\sigma^2 I to a correlated ellipsoid Σ\Sigma (via the Sherman–Morrison formula). Re-centering the Kannan target at μ\mu and multiplying the secret block on the right by W=Σ−1/2W = \Sigma^{-1/2} restores spherical isotropy while multiplying det⁡(L)\det(L) by det⁡(Σ)−1/2>1\det(\Sigma)^{-1/2} > 1!

Fold a perfect hint and verify LLL recovery in Python

from fractions import Fraction

def lll_rows(basis: list[list[int]], delta: Fraction = Fraction(3, 4)) -> list[list[int]]:
    rows = [r[:] for r in basis]
    def dot(u, v): return sum(x * y for x, y in zip(u, v))
    def gs(mat):
        ortho, mu = [], {}
        for i, r in enumerate(mat):
            rf = list(map(Fraction, r))
            v = rf[:]
            for j, o in enumerate(ortho):
                mu[i, j] = dot(rf, o) / dot(o, o)
                v = [vi - mu[i, j] * oi for vi, oi in zip(v, o)]
            ortho.append(v)
        return ortho, mu
    k = 1
    while k < len(rows):
        for j in range(k - 1, -1, -1):
            _, mu = gs(rows)
            c = round(mu[k, j])
            if c:
                rows[k] = [rk - c * rj for rk, rj in zip(rows[k], rows[j])]
        ortho, mu = gs(rows)
        if delta * dot(ortho[k-1], ortho[k-1]) > dot(ortho[k], ortho[k]) + mu[k, k-1]**2 * dot(ortho[k-1], ortho[k-1]):
            rows[k-1], rows[k] = rows[k], rows[k-1]
            k = max(1, k - 1)
        else:
            k += 1
    return rows

q = 97
A = [[14, 35, 81], [62, 19, 44], [27, 73, 12]]
s, e = [2, -1, 1], [1, -1, 0]
b = [(sum(a * si for a, si in zip(row, s)) + ei) % q for row, ei in zip(A, e)]

# Fold perfect hint s0 + s1 = 1  =>  s0 = 1 - s1  (dimension drops 7 -> 6!)
b_folded = [(b[i] - A[i][0]) % q for i in range(3)]
B_hint = [
    [q, 0, 0, 0, 0, 0],
    [0, q, 0, 0, 0, 0],
    [0, 0, q, 0, 0, 0],
    [(A[0][1] - A[0][0]) % q, (A[1][1] - A[1][0]) % q, (A[2][1] - A[2][0]) % q, 1, 0, 0],
    [A[0][2], A[1][2], A[2][2], 0, 1, 0],
    [-b_folded[0], -b_folded[1], -b_folded[2], 0, 0, 1],
]

v = lll_rows(B_hint)[0]
sgn = v[5]
s1_rec, s2_rec = sgn * v[3], sgn * v[4]
s0_rec = 1 - s1_rec
e_rec = [-sgn * c for c in v[:3]]
assert [s0_rec, s1_rec, s2_rec] == s and e_rec == e
print("Recovered s =", [s0_rec, s1_rec, s2_rec], "and e =", e_rec, "from 6D hinted lattice!")

In full ML-KEM-768 (β=624\beta = 624), each independent perfect bit hint roughly shaves ≈0.85\approx 0.85 off β\beta: leaking ~450 bits of secret information drops β\beta from 624 into practical sieving range (β<200\beta < 200) on a workstation running G6K or g6k-rs.