Prerequisite: Parameter Selection

When cryptographers say “ML-KEM-512 has Core-SVP cost 2118.62^{118.6} at BKZ block size β=406\beta = 406,” where does 406406 actually come from? You do not need a 10,000-line SageMath library to understand parameter estimation: combining the Bai–Galbraith rescaled Kannan embedding with Schnorr's Geometric Series Assumption reproduces the headline block sizes from first principles.

Step 1: Build the rescaled Bai–Galbraith uSVP basis

Given mm LWE samples b=As+e mod qb = A s + e \bmod q with A∈Zqm×nA \in \mathbb{Z}_q^{m \times n}, secret standard deviation σs\sigma_s, and error standard deviation σe\sigma_e, reduction algorithms minimize Euclidean length. If σs≠σe\sigma_s \neq \sigma_e (for instance, binary/ternary secrets alongside wide Gaussian errors), rescale the secret coordinates by w=σe/σsw = \sigma_e / \sigma_s and set the Kannan homogenization weight to M=σeM = \sigma_e so every coordinate of the target vector has equal variance σ2=σe2\sigma^2 = \sigma_e^2:

B=[qIm00A⊤wIn0−b⊤0M]∈R(m+n+1)×(m+n+1)B = \begin{bmatrix} q I_m & 0 & 0 \\ A^\top & w I_n & 0 \\ -b^\top & 0 & M \end{bmatrix} \in \mathbb{R}^{(m + n + 1) \times (m + n + 1)}

Multiply the row blocks by integer combination (k⊤,  s⊤,  1)(k^\top,\; s^\top,\; 1) where As−b+qk=−eA s - b + q k = -e: the resulting lattice vector is vtarget=(−e⊤,  ws⊤,  M)v_{\mathrm{target}} = (-e^\top,\; w s^\top,\; M), with expected Euclidean length E[∥vtarget∥]≈d σe\mathbb{E}[\|v_{\mathrm{target}}\|] \approx \sqrt{d}\,\sigma_e in dimension d=m+n+1d = m + n + 1. Because BB is block-lower-triangular, its determinant is immediate:

det⁡(L)=qm⋅wn⋅M=qm(σeσs) ⁣nσe\det(L) = q^m \cdot w^n \cdot M = q^m \left(\frac{\sigma_e}{\sigma_s}\right)^{\!n} \sigma_e

In ML-KEM-768 (n=768,q=3329n = 768, q = 3329), both ss and ee come from the centered binomial distribution CBD2\mathsf{CBD}_2 of variance η/2=1.0\eta / 2 = 1.0, so σs=σe=1\sigma_s = \sigma_e = 1, w=1w = 1, M=1M = 1, and det⁡(L)=qm\det(L) = q^m!

Step 2: Write the Alkim–Ducas–Pöppelmann–Schwabe win condition

Naive intuition compares ∥vtarget∥≈d σ\|v_{\mathrm{target}}\| \approx \sqrt{d}\,\sigma against the shortest full vector BKZ-β\beta produces, δ0ddet⁡(L)1/d\delta_0^d \det(L)^{1/d}. In 2016, the NewHope authors (ADPS16) observed that BKZ recovers vtargetv_{\mathrm{target}} much earlier — during the very last SVP call on the trailing β\beta-dimensional projected block!

Under the Geometric Series Assumption (GSA), Gram–Schmidt norms decay geometrically across a BKZ-β\beta basis as ∥b~i∥≈δ0d−1−2(i−1)det⁡(L)1/d\|\tilde{b}_i\| \approx \delta_0^{d - 1 - 2(i-1)} \det(L)^{1/d} where the root-Hermite factor satisfies:

δ0(β)≈((πβ)1/β⋅β2πe)12(β−1)\delta_0(\beta) \approx \left( \frac{(\pi \beta)^{1/\beta} \cdot \beta}{2 \pi e} \right)^{\frac{1}{2(\beta - 1)}}

Projected onto the last β\beta orthogonal directions, vtargetv_{\mathrm{target}} has expected length β σ\sqrt{\beta}\,\sigma, while the start of that final β\beta-block (at index i=d−β+1i = d - \beta + 1) has Gram–Schmidt length δ02β−d−1det⁡(L)1/d\delta_0^{2\beta - d - 1} \det(L)^{1/d}. Recovery succeeds as soon as:

β σ≤δ0(β)2β−d−1⋅det⁡(L)1/d\sqrt{\beta}\,\sigma \le \delta_0(\beta)^{2\beta - d - 1} \cdot \det(L)^{1/d}

Step 3: Optimize sample count m∗m^* and compute Core-SVP bits

Notice that the attacker chooses how many LWE rows m≤mavailm \le m_{\mathrm{avail}} to include! Using too few samples leaves det⁡(L)1/d=qm/d\det(L)^{1/d} = q^{m/d} too small; using too many inflates dimension dd faster than qm/dq^{m/d} grows. Scanning mm and converting the winning β\beta via BDGL16 classical sieving exponent 0.292β0.292 \beta (or quantum sieving 0.257β0.257 \beta) yields:

Instancennqqσ\sigmaOptimal m∗m^*Lattice dim ddBKZ β\betaClassical Core-SVP (0.292β0.292\beta)
Toy LWE-12812833291.000 (η=2)1362654011.7 bits
ML-KEM-51251233291.225 (η₁=3)4881,001406118.6 bits
ML-KEM-76876833291.000 (η₁=2)6641,433624182.2 bits
ML-KEM-1024102433291.000 (η₁=2)8721,897871254.3 bits

Compare rows 2–4 with Table 3 of the Kyber specification: 406, 624, and 871 match the published primal-attack BKZ block sizes almost to the integer! (Note: in ML-KEM-512, η1=3\eta_1 = 3 for s,es, e during KeyGen; full estimators refine asymmetric η1,η2\eta_1, \eta_2 across KeyGen + ciphertext samples and simulate exact BKZ profiles beyond strict GSA.)

Run the 25-line Primal uSVP Estimator in Python

import math

def delta0(beta: int) -> float:
    return (((math.pi * beta) ** (1.0 / beta)) * beta / (2.0 * math.pi * math.e)) ** (1.0 / (2.0 * (beta - 1)))

def estimate_primal_usvp(n: int, q: int, sigma_s: float, sigma_e: float) -> tuple[int, int, float]:
    w = sigma_e / sigma_s
    best_beta, best_m = 10_000, 0
    for m in range(n // 2, 2 * n + 1, 8):
        d = m + n + 1
        log2_det_root = (m * math.log2(q) + n * math.log2(w) + math.log2(sigma_e)) / d
        for beta in range(40, d):
            lhs = 0.5 * math.log2(beta) + math.log2(sigma_e)
            rhs = (2 * beta - d - 1) * math.log2(delta0(beta)) + log2_det_root
            if lhs <= rhs:
                if beta < best_beta:
                    best_beta, best_m = beta, m
                break
    return best_beta, best_m, round(0.292 * best_beta, 1)

for label, n, s_std, e_std in [
    ("ML-KEM-512",  512,  math.sqrt(1.5), math.sqrt(1.5)),
    ("ML-KEM-768",  768,  1.0,            1.0),
    ("ML-KEM-1024", 1024, 1.0,            1.0),
]:
    beta, m_opt, bits = estimate_primal_usvp(n, 3329, s_std, e_std)
    print(f"{label:12s} -> beta={beta}, m*={m_opt}, Core-SVP={bits} bits")

Next, see what happens to dd and det⁡(L)\det(L) when an attacker obtains side-channel leakage in Integrating Leaked Hints into LWE Lattices, or run real progressive BKZ tours in g6k-rs recipes.