Ring-LWE
August 25, 20265 min readbeginner
Plain Learning With Errors puts the secret in Z_q^n, an ordinary vector with no structure connecting its components.
Plain Learning With Errors puts the secret in , an ordinary vector with no structure connecting its components. Ring-LWE puts it in instead, so the secret is a polynomial and the components are its coefficients.
That sounds like a change of notation. It is a change of substance, and this note shows exactly what is bought.
01.The definition
Fix the ring from Chapter 1, and an error distribution producing polynomials with small coefficients.
A Ring-LWE sample for a secret is a pair
where is drawn uniformly from , the error is drawn from , and is multiplication in .
Compare that with the plain LWE sample from Chapter 3. There, was a vector, was a vector, the product was an inner product, and the result was a single number in . Here everything is a polynomial and is a whole polynomial too.
That last difference is the whole point. A plain sample yields one equation. A ring sample yields of them.
One ring sample carries plain samples
Work it out on the running parameters , .
Let the secret be , so . Draw the uniform element and a small error , so .
Multiply by in , reducing with as in Chapter 1. Doing it symbolically, in the unknowns through , the four coefficients of the product come out as
Substituting the actual secret and reducing modulo gives , and adding the error gives
Now read those four displayed lines as what they are. Each is a linear equation in the four unknown coefficients of the secret, and each has had a small error added. Four plain-LWE equations, produced from a single pair of ring elements.
That is the compression, stated precisely. To publish four plain-LWE equations you would have to write down four independent vectors , sixteen numbers in total. To publish the same four equations here you write down one polynomial , which is four numbers.
03.Where the missing numbers went
The sixteen numbers did not vanish. They became implicit.
Collect the coefficients of those four equations into a matrix:
Look at how it is built. Read down the first column: , which is itself. Each subsequent column is the previous one shifted down by one position, with the entry that falls off the bottom reappearing at the top with its sign flipped.
That sign flip is , showing up as a structural property of the matrix. A matrix built this way is called a negacyclic circulant.
So multiplying by in is the same as multiplying by this matrix. The matrix has entries and every one of them is determined by the coefficients of . Storing stores the matrix.
This is where the factor-of- key compression from Chapter 3 comes from, and now it is visible rather than asserted.
04.What it costs
Nothing is free, and the price here is an assumption.
In plain LWE the matrix is fully random, all entries independent. In Ring-LWE it is a negacyclic circulant, so of its entries are forced by the other . An attacker therefore knows a great deal about the matrix before seeing it, and can look for attacks that exploit that structure.
Ring-LWE is consequently a stronger assumption than plain LWE. Believing it means believing not only that lattice problems are hard, but that they remain hard on this restricted family of structured lattices.
That worry is not theoretical. Attacks exploiting ring structure have been found for some choices of the modulus polynomial, which is a large part of why with a power of two is the choice that survived the competition. It is the best-studied case and the one with the fewest exploitable features.
The next note describes the compromise the standards actually adopted, which keeps most of the compression while giving back some of the structure.