It’s my turn to cover breaking math news: Anthropic published a quasipolynomial time quantum algorithm for ring learning with errors (RLWE).

The paper is on Anthropic’s GitHub.

I will focus on the impact to fully homomorphic encryption (FHE). This is relevant to ML-KEM and ML-DSA, but I am not an expert there so I will leave that commentary to others.

Before talking about the worrying parts, I’ll cover the mitigating aspects. The first is that the main algorithms in the paper have quasipolynomial runtime (2 to the power “poly-logarithmic in some parameter”). As per the Cryptography Incident Review Group, despite this they still require “vastly more computation than the best previously known attacks.”

The second: the algorithm (like so many AI proofs these days) requires a galactic-sized amount of space to operate. What the algorithm appears to do is start from a single RLWE sample ($2N$ coefficients where $N$ is roughly $2^{16}$), and expand it before passing it to a “quantum sampler.” The expanded object is a pair of matrices each of size $D^2$ and a vector of size $D$, where $D > N^{468}$ is required. For the $N = 2^{16}$, this gives a total size of $2^{16*468*2} = 2^{14976}$ entries for one of these matrices. This does not even account for the number of qubits needed to run the sampling algorithm, which AI tells me (for these parameters) is asymptotically at most $2^{10^8}$ (there is no lower bound here).

Now the bad. The algorithm directly targets the algorithmic structures that CKKS relies on: power of two cyclotomics. Recall, CKKS uses a ring that looks like integer polynomials modulo $x^N+1$ where $N$ is a power of two. This ring has structure which I’ve lamented before is ripe for attacking.

The Anthropic paper conveniently summarizes the algebraic properties it uses in Remark 23.10. (1) Having a maximal totally real subfield of index 2. (2) Having a tower of quadratic extensions from the $\mathbb{Z}$ up to the real subfield from (1). (3) A prime ideal of norm 2. (4) An Z-basis with bounded conjugates that is orthogonal with respect to the trace form.

Apparently I’m not alone in worrying about this extra structure. The “NTRU prime” scheme was developed specifically to avoid this. It uses a modulus of $x^p - x - 1$ for prime $p$, and this fails all the properties required for the attack.

Also, it’s worth pointing out that this does not directly depend on the Galois group structure of ring, which is what CKKS uses for slot rotations and conjugation. Yesterday I feared this would be part of the attack, but this aspect of the ring structure appears unused. Having no nontrivial automorphisms (a property applauded of NTRU prime) would not automatically prevent this attack from working. Avoiding subfields turned out to be more important.

Now this raises the obvious question of what to do with FHE. For starters, standard LWE (of the kind that TFHE is based on) is not affected, but TFHE bootstrapping and programmable bootstrapping do depend on RLWE with power-of-two cyclotomics. Second, while CKKS, the leading FHE scheme in my opinion, continues to work for now, power of two cyclotomics probably won’t be part of its long-term future. I doubt post-quantum security is a negotiable property of FHE as a whole. This will pose some serious challenges because the basic encoding of CKKS heavily relies on the Galois structure of the power of two cyclotomic field. Likewise, some automorphism structure is required for efficient ciphertext rotations, which is in turn required for efficient matrix-vector multiplications. It will take some serious work to find alternatives that maintain efficiency. In the mean time, I will have to find the papers that contributed to non-power-of-two cyclotomic variants of BGV and BFV.

The last thing I want to mention is the more theoretical side of this paper, and the other 3 papers released in the same batch. Historically one nice thing about RLWE was that it enjoyed “worst case to average case” reductions. Meaning if some lattice problem was hard in the worst case, then RLWE was hard in the average case.

Part 4 of this paper breaks the worst-case assumption that the reduction relies on, by giving a quantum approximation algorithm for the Ideal Shortest Vector Problem (Ideal-SVP). While this doesn’t appear to improve or enhance any attacks, it applies to all cyclotomic instances, not just power-of-two. This shows the need for new security reductions for whatever post-quantum scheme replaces cyclotomic RLWE.

Postscript: funnily enough, the last time I covered breaking math news on my blog it was ALSO due to someone finding a quasipolynomial time algorithm (for graph isomorphism). Oh the memories of a simpler era.


Want to respond? Send me an email, post a webmention, or find me elsewhere on the internet.

This article is syndicated on: