Learning with errors
The learning with errors (LWE) assumption is a standard assumption in lattice-based cryptography, especially in post-quantum cryptography. It is a generalization of the LPN assumption.
Assumption
Informally, the LWE problem concerns solving a system of noisy linear equations over . Given random linear equations in variables, the goal is to find a secret vector . Without errors the system can be solved in polynomial time by Gaussian elimination; the LWE assumption states that adding a small additive error drawn from an error distribution makes the problem hard.
The assumption is parameterized by a lattice dimension (which also serves as the security parameter), a modulus , an error distribution over , and a sample count .
Decision LWE
In the decision variant, the adversary must distinguish LWE samples from uniformly random pairs .
\begin{algorithm}
\algname{Game}
\caption{$\Game^{\text{lwe}}_{n,q,\chi,m,\calA}(\secpar)$}
\begin{algorithmic}
\State $\mathbf{A} \getsr \ZZ_q^{m \times n}$ ; $\mathbf{s} \getsr \ZZ_q^n$ ; $\mathbf{e} \getsr \chi^m$
\State $b \getsr \bits$
\State $\mathbf{u}_0 \gets \mathbf{A}\mathbf{s} + \mathbf{e}$ ; $\mathbf{u}_1 \getsr \ZZ_q^m$
\State $\hat{b} \gets \calA(1^\secpar, \mathbf{A}, \mathbf{u}_b)$
\Return $[\hat{b} = b]$
\end{algorithmic}
\end{algorithm}
(Decision) LWE is hard for the tuple if for all efficient
is negligible.
Search LWE
In the search variant, the adversary must recover the secret from LWE samples.
\begin{algorithm}
\algname{Game}
\caption{$\Game^{\text{slwe}}_{n,q,\chi,m,\calA}(\secpar)$}
\begin{algorithmic}
\State $\mathbf{A} \getsr \ZZ_q^{m \times n}$ ; $\mathbf{s} \getsr \ZZ_q^n$ ; $\mathbf{e} \getsr \chi^m$
\State $\hat{\mathbf{s}} \gets \calA(1^\secpar, \mathbf{A},\, \mathbf{A}\mathbf{s}+\mathbf{e})$
\Return $[\hat{\mathbf{s}} = \mathbf{s}]$
\end{algorithmic}
\end{algorithm}
Search LWE is hard for the tuple if for all efficient
is negligible.
Known Results
Search–Decision equivalence
The search and decision variants of LWE are equivalent — breaking one suffices to break the other.
Search Decision (easy direction): A search solver gives a decision adversary for free. Given a challenge , run and check whether is small (i.e., looks like a sample from ). If so, guess (LWE world); otherwise guess (uniform world).
Decision Search (hard direction): Recover one coordinate at a time. For each index and each candidate , construct modified samples that effectively zero out the contribution of under the hypothesis , then query the decision oracle to test whether the result is still an LWE instance or has become uniform. The candidate that keeps the distribution looking like LWE reveals the true . Running over all pairs uses samples in total when decision can be broken with samples.
Reduction to lattice problems
The hardness of LWE rests on worst-case lattice problems via a quantum reduction — Reg05:
- Solving decision (or search) LWE on a noticeable fraction of inputs is at least as hard as quantum-approximating the Shortest Vector Problem (GapSVP) and the Shortest Independent Vectors Problem (SIVP) to within polynomial factors in the worst case
- Because GapSVP and SIVP are believed hard even for quantum computers, this gives a strong post-quantum security guarantee for LWE-based schemes
- Classical reductions (without quantum steps) are known for certain parameter regimes — see subsequent work by Peikert
Cryptographic constructions
- PKE from LWE: to encrypt a bit , send a random linear combination of the LWE samples plus ; decryption uses to remove the LWE component — Reg05
Attacks
Variations
LWE with is the LPN problem, where is a Bernoulli distribution.
Ring LWE (RLWE) replaces the random matrix with structured elements from a polynomial ring , yielding more efficient constructions at the cost of additional algebraic structure.
Ring LWE
Ring LWE (RLWE) restricts LWE to the polynomial ring , where is the -th cyclotomic polynomial (typically for a power of 2). A Ring LWE sample is a pair where is a random ring element and for a secret and small error drawn from an error distribution over .
The key advantage is efficiency: the random matrix in plain LWE (requiring space) is replaced by a single ring element (requiring space), and multiplication in can be computed in time via the Number Theoretic Transform (NTT). This yields:
- Key size: bits (vs. for plain LWE)
- Computation: per operation (vs. )
Ring LWE admits a quantum worst-case to average-case reduction from the Ideal-SVP problem (shortest vector in ideal lattices), giving a hardness foundation analogous to LWE’s reduction from SVP — LPR10.
Ring LWE is the basis for NewHope and is closely related to the NTRU cryptosystem.
Module LWE
Module LWE (MLWE) interpolates between plain LWE (large random matrices, no algebraic structure) and Ring LWE (maximum structure, ring elements) by considering rank- modules over . A Module LWE sample is: where is a random module matrix, is the secret vector, and is a small error vector.
- When : recovers Ring LWE (one ring element per equation)
- When : recovers plain LWE (fully unstructured, ring )
The module structure provides a flexible trade-off between efficiency (like Ring LWE) and conservative security assumptions (less algebraic structure than Ring LWE). Module LWE is the basis for the NIST post-quantum standards:
- Kyber / ML-KEM (FIPS 203): IND-CCA KEM from Module LWE with
- Dilithium / ML-DSA (FIPS 204): EUF-CMA digital signatures from Module LWE/SIS
Hardness of Module LWE reduces to worst-case problems on module lattices — LS15.
Hint LWE
Hint LWE augments the standard LWE problem with auxiliary “hint” information about the secret . Concretely, the adversary receives, in addition to LWE samples , one or more noisy inner products for known hint vectors .
Hint LWE arises in:
- Amortized bootstrapping for FHE: refreshing many ciphertexts simultaneously leaks hints about the bootstrapping key
- Attacks on LWE with side channels: partial key leakage reduces to Hint LWE
- Leftover hash lemma applications: certain compressed LWE constructions produce hint-like structures
The hardness of Hint LWE is closely related to LWE: mild hints (few, low-precision) can be handled by modifying the error distribution, but many exact hints break LWE entirely (since enough linear equations determine ).