Chapter 3Lattices and Learning With Errors

Short Vectors: SVP and CVP

August 25, 20267 min readbeginner

Two problems about lattices are assumed hard, and every lattice cryptosystem rests on one or the other. Both are easy to state. Both are easy to solve in the pictures on this page.

Two problems about lattices are assumed hard, and every lattice cryptosystem rests on one or the other. Both are easy to state. Both are easy to solve in the pictures on this page. Neither is solvable in the dimensions that matter.

01.What "short" means

The length of a vector v=(v1,v2,…,vn)v = (v_1, v_2, \ldots, v_n) is

∥v∥  =  v12+v22+⋯+vn2,\|v\| \;=\; \sqrt{v_1^2 + v_2^2 + \cdots + v_n^2},

which is Pythagoras extended to nn components. It is called the Euclidean norm, and the double bars are the standard notation.

Two examples from the running lattice:

∥(3,1)∥=9+1=10≈3.162,∥(−2,1)∥=4+1=5≈2.236.\|(3,1)\| = \sqrt{9 + 1} = \sqrt{10} \approx 3.162, \qquad \|(-2,1)\| = \sqrt{4 + 1} = \sqrt{5} \approx 2.236 .

Shorter means closer to the origin. That is all the geometry needed.

02.The shortest vector problem

SVP. Given a basis of a lattice L\mathcal{L}, find the shortest non-zero vector in L\mathcal{L}.

The exclusion of zero is necessary rather than fussy. The origin is a lattice point in every lattice, taking all coefficients zero, and it has length 00. Without the exclusion every instance would have the same trivial answer.

Solve it on the running lattice. Points near the origin, with their lengths:

pointcoefficientslength
(3,1)(3, 1)b1b_110≈3.162\sqrt{10} \approx 3.162
(1,2)(1, 2)b2b_25≈2.236\sqrt{5} \approx 2.236
(2,−1)(2, -1)b1−b2b_1 - b_25≈2.236\sqrt{5} \approx 2.236
(−2,1)(-2, 1)b2−b1b_2 - b_15≈2.236\sqrt{5} \approx 2.236
(4,3)(4, 3)b1+b2b_1 + b_255

The shortest length is 5\sqrt{5}, achieved by three different points, all of which are the same two vectors up to sign. Minkowski promised something no longer than 10≈3.162\sqrt{10} \approx 3.162, and 5\sqrt{5} obliges.

That took about a minute by hand, because the lattice is two-dimensional and drawn.

Cryptography does not need the exact shortest vector, and a relaxed version is what actually gets assumed hard. For an approximation factor γ≥1\gamma \geq 1, γ\gamma-approximate SVP asks for any non-zero lattice vector no longer than γ\gamma times the true shortest. Taking γ=1\gamma = 1 recovers exact SVP. The interesting regime for cryptography is γ\gamma growing polynomially with the dimension, which is still believed hard, and which is precisely the regime the LLL and BKZ algorithms from Good and Bad Bases fail to reach.

03.The closest vector problem

CVP. Given a basis of a lattice L\mathcal{L} and an arbitrary target point tt which need not be on the lattice, find the lattice point closest to tt.

CVP is the problem that matters most for what follows, because it is what decryption turns out to be.

Work an instance. Take the target t=(4.2,  2.7)t = (4.2,\; 2.7), which is not a lattice point. Candidates nearby, with their distances to tt:

The point (4,3)(4,3) gives (4.2−4)2+(2.7−3)2=0.04+0.09=0.13≈0.361\sqrt{(4.2-4)^2 + (2.7-3)^2} = \sqrt{0.04 + 0.09} = \sqrt{0.13} \approx 0.361.

The point (3,1)(3,1) gives 1.44+2.89=4.33≈2.081\sqrt{1.44 + 2.89} = \sqrt{4.33} \approx 2.081.

The point (5,0)(5,0), which is 2b1−b22b_1 - b_2, gives 0.64+7.29=7.93≈2.816\sqrt{0.64 + 7.29} = \sqrt{7.93} \approx 2.816.

So (4,3)(4,3) wins comfortably. The target sits very close to a lattice point, and finding it was a matter of looking.

Figure 1
Figure 1. So (4,3) wins comfortably. The target sits very close to a lattice point, and finding it was a matter of looking.

The two problems are closely related. CVP is at least as hard as SVP, and an algorithm for either gives you something useful about the other. The cryptographic constructions in Chapters 5 and 6 are built on a restricted form of CVP called bounded-distance decoding, where you are promised in advance that the target is unusually close to some lattice point. That promise is exactly what the honest decryptor has and the attacker does not.

04.Why these are hard in high dimension

Nothing above was hard. Two dimensions, a picture, five candidates checked. So where does the difficulty come from?

It comes from the number of candidates.

To find a short vector you have to search over integer coefficient vectors (x1,…,xn)(x_1, \ldots, x_n). Suppose you know, generously, that each coefficient of the answer lies between −10-10 and 1010. That is 2121 choices per coefficient, so the number of combinations to check is

21n.21^n .

At n=2n = 2 that is 441441, which is a short afternoon by hand. At n=10n = 10 it is about 1.7×10131.7 \times 10^{13}, a few hours on a machine. At n=50n = 50 it is about 106610^{66}. At n=256n = 256, the dimension of one ML-KEM polynomial, it is beyond any physical description.

And the good algorithms do far better than this brute-force count. That is the point of LLL and BKZ. What they cannot do is get the approximation factor down to something useful at high dimension, and the parameters of a real scheme are chosen precisely so that they cannot.

There is a second, less obvious source of difficulty. In high dimension, geometric intuition simply fails. The volume of a high-dimensional ball is concentrated near its surface. Randomly chosen vectors are almost always nearly perpendicular to each other. The "just look at it and see which is closest" strategy that worked on the page has no high-dimensional analogue, and even the sharpened versions of it lose their grip.

05.Why Shor does not apply

This is the load-bearing paragraph of the chapter, so it is worth being precise about what is and is not being claimed.

Shor's algorithm works by turning a problem into a question about periodicity and then using quantum interference to read the period off. Factoring becomes the period of a1,a2,a3,…a^1, a^2, a^3, \ldots modulo nn. Discrete logarithms become a position inside a repeating cycle. Both problems have a hidden repeating structure, and the quantum Fourier transform is a machine for finding hidden repeating structures.

More generally, the technique solves what is called the hidden subgroup problem over commutative groups, and factoring and discrete logarithms are both instances of it.

SVP and CVP are not. They can be phrased as a hidden subgroup problem, but over a group that is not commutative, the dihedral group, and the quantum Fourier transform does not deliver there. Nobody has found a way to make the amplitudes cancel correctly. The gap has been open since the late 1990s and has had a great deal of attention.

What quantum computers do offer against lattices is Grover's algorithm, the generic square-root speedup on unstructured search. Applied to the enumeration inside lattice algorithms it takes 2n2^{n} down to roughly 2n/22^{n/2}. That is a genuine improvement and it is accounted for in the parameter choices, which is one reason the standardised parameter sets are more conservative than a classical-only analysis would require. It is nothing like Shor. A square root is a change of exponent. Shor is a change of category, from exponential to polynomial.

So the honest statement is not that lattices are proven quantum-resistant. It is that they have no known structure of the kind Shor exploits, that finding one has resisted three decades of effort, and that the best known quantum attack is a generic speedup rather than a break. That is the same standard of evidence factoring enjoyed before 1994, which is exactly why SLH-DSA exists as a hash-based backup with completely different assumptions.

The second half of this chapter takes these geometric problems and turns them into something a computer can actually encrypt with.

FeedbackBook mode
post-quantum-cryptographycryptographymathematics