← Back to section · Research & Analysis
Experiment Design: Reading BKZ Through Small-Parameter Lattice Reduction Labs
Nobody can run lattice attacks at real parameters, but small-parameter experiments turn the behaviour of LLL and BKZ, the meaning of the root Hermite factor, and the steepness of cost growth into hands-on observations. Here is the design of that teaching lab.
The research question: observe shapes, not times
Security estimates for lattice cryptography ultimately rest on the cost of BKZ reduction, but real parameters run to hundreds of dimensions, far beyond any teaching environment. Small-parameter experiments are therefore often misunderstood as scaled-down real attacks, and someone inevitably extrapolates an 80-dimensional runtime into a claim about how many years a 400-dimensional instance would take — a methodological error, since reduction cost grows with dimension in a way no short interval can calibrate.
This experiment redefines the goal as observing three shapes. First, the shape of reduction quality: at fixed dimension, as the BKZ block size grows, how does the quality of the output basis improve? Second, the shape of success rates: at a fixed attack setting, as the LWE dimension grows, how does the embedding attack’s success rate collapse from near one to near zero? Third, the shape of cost: within the measurable range, how does runtime grow with dimension and block size, plotted against the predictions of public cost models? Together, the three shapes give a first-hand understanding of why parameters are as large as they are.
Materials and variable control
Instance generation must be reproducible: fix the random seed and generate LWE instances with one codebase — dimension n starting at 40 and stepping by 10 up to whatever the environment can still run, modulus q and noise distribution taken from common teaching combinations (for example a roughly 12-bit prime q and a narrow discrete Gaussian or centred binomial noise). Generate at least 20 independent instances per parameter combination, or the success rate has no statistical meaning; running a single instance repeatedly measures one point of the luck distribution.
Fix one reduction implementation (fpylll, for instance) and record its version. Fix one embedding construction (the standard embedding that turns LWE into a unique-SVP instance) and record the embedding dimension separately from the original dimension — the most common beginner confusion: the lattice actually fed to the reducer is higher-dimensional than the original problem, and cost must be charged at the embedded dimension. Fix the thread count, because reduction libraries’ multithreading makes wall-clock times incomparable; record both wall-clock and CPU time, and treat CPU time as authoritative.
Measurement: three ledgers — quality, success, cost
The quality ledger records the root Hermite factor: the length of the shortest vector found, divided by the d-th root of the lattice determinant, then raised to the 1/d power. It is the common currency of reduction quality — dimensionless and comparable across dimensions. For each block size, take the median across all instances and draw the block-size versus root-Hermite-factor curve: the expected shape decreases with block size at a diminishing rate, and the position of its plateau is the key to understanding both why block size cannot grow without limit and why estimator tools adopt the block sizes they do.
The success ledger records whether the embedding attack recovers the secret or an equivalent shortest vector: at each dimension, report successes over total instances with a confidence interval. The expected shape is a sigmoid collapse, and the collapse point is extremely sensitive to noise width — which demonstrates exactly why noise selection in real parameters is so delicate.
The cost ledger records runtime against dimension and block size, with the predictions of a public estimator model (for example an open-source estimator built on BKZ cost formulas) at the same parameters drawn on the same chart. Disagreement in the small-parameter region is normal: real estimators care about the asymptotic regime, and the lab’s job is to let students watch the two curves converge or diverge as dimension grows, not to demand agreement at small sizes.
Before the formal runs, run a small pilot and freeze an analysis plan from it: use the two lowest dimensions to verify the whole pipeline — instance generation, embedding, reduction, result collection — then write down, on one page, the instance count per parameter combination, the success criterion (recovering the secret itself, or any equivalently short vector), and the per-instance timeout that counts as failure, and do not change them mid-experiment. The success criterion in particular must be fixed in advance: embedding attacks sometimes find not the secret vector but another equally short vector, and which convention you count by changes the success rate significantly — picking the favourable convention after the fact is this experiment’s most hidden form of fabrication. Archive the analysis plan together with the random seeds and code versions, and the data earns the right to be fully reproduced by others; in grading a teaching lab, reproducibility should weigh as much as the conclusions.
Interpretation and boundaries
Three boundaries govern interpretation. First, talk only about shapes and relative relations, never absolute years: this experiment cannot produce conclusions of the form “this parameter set survives N more years”. Second, comparing root Hermite factors is a legitimate use: placing the lab-measured value next to the value an estimator assumes at real parameters shows intuitively where the security margin comes from. Third, the success-rate collapse point holds only for this experiment’s noise and embedding; change the construction or the noise and the point moves — which is precisely why parameter standardisation demands multiple independent estimates.
Common pitfalls
First, concluding from a single instance: lattice reduction runtimes have enormous variance, and one instance can sit several times away from the median. Second, reporting the embedding dimension as the problem dimension, making costs look lower than they are. Third, showing only successful runs while hiding failures and timeouts, systematically inflating the success rate. Fourth, timing on a laptop with a browser and antivirus running, mistaking environmental noise for algorithmic behaviour. Fifth — and most important — citing teaching-lab numbers in discussions of production parameters: small-parameter experiments train intuition; they are not security arguments at the evidence level.
Tags: Lattice ReductionBKZLLLTeaching Lab