The Learning With Errors Problem
August 25, 20267 min readbeginner
The previous note demonstrated the effect. This note states the problem formally, gives its two forms, works a full instance, and explains the theorem that makes it worth building…
The previous note demonstrated the effect. This note states the problem formally, gives its two forms, works a full instance, and explains the theorem that makes it worth building a standard on.
01.The definition
Fix a dimension , a modulus , and an error distribution over the integers, concentrated near zero. Let the secret be drawn uniformly at random.
An LWE sample for the secret is a pair where
The arrow notation means "is drawn at random from". Each sample uses a fresh and a fresh , but always the same secret .
Two questions can be asked about a pile of such samples, and they have different names.
Search-LWE. Given many samples for the same unknown , recover .
Decision-LWE. Given many pairs, decide whether they are LWE samples for some hidden , or whether each was simply drawn uniformly at random from .
Search is the obvious formulation. Decision is the one cryptography actually needs, and the reason is worth spelling out.
An encryption scheme is considered secure when a ciphertext is indistinguishable from random noise. Not merely hard to decrypt, but impossible to tell apart from meaningless bytes. If Decision-LWE is hard, then an attacker holding an LWE-based ciphertext cannot even tell it is a ciphertext, let alone read it. That is a much stronger guarantee than "cannot recover the message", and it is the standard modern definitions demand.
The two forms are equivalent. Given an algorithm for one, you can build an algorithm for the other in polynomial time. So the hardness assumption can be stated in whichever form is convenient.
A full instance over
Take , , and let be uniform on . The secret is
Sample 1. Draw .
Reduce: , so . Draw . Then .
Sample 2. Draw .
Draw . Then .
Sample 3. Draw .
since . Draw , which is modulo . Then .
The attacker is handed
and nothing else. As Noise Breaks Linear Algebra showed, inverting gives , which is wrong in every component.
03.Being honest about this example
The instance above is not secure and it is important to say so.
With and there are only possible secrets. An attacker simply tries all of them, checking for each candidate whether every lands in . That check takes microseconds and of them take no time at all. The true secret is found.
Every worked example in this book has this property, and it is the same situation as factoring in Chapter 2. The pencil version is meant to show you the shape of the problem, never to demonstrate its difficulty.
Real parameters close the gap by raising and together. ML-KEM uses with lattice dimension per polynomial and two to four polynomials, so the search space is astronomically larger than , and the error distribution is arranged so that the noise is small relative to but large enough that no shortcut works.
There is a genuine tension in choosing those parameters. Too much noise and the legitimate recipient cannot decrypt either, because the error swamps the message. Too little and lattice reduction finds the secret. The parameter sets in FIPS 203 and 204 are the outcome of that trade-off, argued out over the eight years of the competition.
04.LWE is a lattice problem wearing a disguise
The connection to the first half of the chapter can be made exact.
Given an LWE instance , define the set
This is a lattice. It contains every vector that is a valid noiseless product , together with everything congruent to one modulo .
Now look at where sits. By construction with small. So is a point of the lattice, and is that point pushed off by a short distance .
Recovering means finding which lattice point is sitting next to. That is the closest vector problem from Short Vectors: SVP and CVP, in the restricted form where you know in advance that the target is unusually close to the lattice. That restricted form has its own name, bounded-distance decoding.
So the two halves of the chapter meet here. Noise turned linear algebra into geometry.
05.Regev's theorem, and why it is unusual
In 2005 Oded Regev proved the result that gives lattice cryptography a foundation nothing else in the field has.
Solving LWE on randomly chosen instances is at least as hard as solving -approximate SVP on every lattice, in the worst case.
The phrase to focus on is worst case.
Most cryptographic assumptions are statements about average instances. "Factoring a random 2048-bit product of two primes is hard" says nothing about the hardest such number, and it is entirely possible that most instances are hard while the particular one your key generator produced is easy. Choosing parameters badly, or being unlucky, is a real risk, and the history of cryptography contains many keys that turned out to be weak for reasons nobody anticipated.
Regev's reduction removes that category of worry. It says that if you can break a random LWE instance, you can break the worst lattice that exists in that dimension. So there are no weak instances hiding in the distribution. Being unlucky with your randomness cannot hand an attacker an easy key, because an easy random instance would imply an easy worst case, and the worst case is precisely what is assumed hard.
Two honest caveats. The reduction is to -approximate SVP for a specific and fairly large , not to exact SVP, and it does not prove that problem is hard. It relocates the assumption rather than discharging it. And the original reduction was quantum, meaning it used a quantum algorithm as an intermediate step, though later work established classical versions under somewhat different parameters.
What it does deliver is a guarantee that the assumption is concentrated in one place. You have to believe exactly one thing: that approximating the shortest vector in a high-dimensional lattice is hard. Everything else follows.