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 standard LWE with auxiliary “hint” information about the secret — DDRG20. The adversary receives, in addition to the LWE challenge, hint pairs for known vectors and small noise . Both the LWE samples and the hints share the same secret .
\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{hlwe}}_{n,q,\chi,\chi',m,\ell,\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 $\mathbf{v}_1, \ldots, \mathbf{v}_\ell \getsr \ZZ_q^n$; $e'_1, \ldots, e'_\ell \getsr \chi'$
\State $h_i \gets \mathbf{v}_i^\top \mathbf{s} + e'_i$ for each $i \in [\ell]$
\Comment{Hints computed from the same $\mathbf{s}$ in both worlds}
\State $b \getsr \bits$
\State $\mathbf{u}_0 \gets \mathbf{A}\mathbf{s} + \mathbf{e}$; $\mathbf{u}_1 \getsr \ZZ_q^m$
\State $b' \gets \calA(1^\secpar, \mathbf{A}, \mathbf{u}_b,\, \{(\mathbf{v}_i, h_i)\}_{i \in [\ell]})$
\Return $[b' = b]$
\end{algorithmic}
\end{algorithm}
Hint LWE is hard for if for all efficient ,
is negligible.
Hint LWE arises in:
- Amortized FHE bootstrapping: refreshing many ciphertexts simultaneously leaks hints about the bootstrapping key — DDRG20
- Side-channel and leakage attacks: partial key leakage from implementation attacks can be modeled as hint information, enabling lattice reduction with fewer samples — DDRG20
The hardness depends sensitively on the number and precision of hints: few low-precision hints can be absorbed by adjusting the error distribution (LWE remains hard), but enough exact hints determine entirely and break the assumption.
Evasive LWE
Evasive LWE strengthens decision LWE by giving the adversary a trapdoor for a matrix related to the LWE matrix, yet conjecturing that distinguishing is still hard. Introduced by Wee — Wee22 — to construct optimal broadcast encryption and attribute-based encryption.
Concretely, the public setup produces a matrix , an auxiliary matrix , and a trapdoor for the concatenated matrix (where denotes the Kronecker product and is a parameter). The adversary receives all of as part of its input.
\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{elwe}}_{n,q,\chi,m,\ell,\calA}(\secpar)$}
\begin{algorithmic}
\State $(\mathbf{B}, \mathbf{W}, T) \gets \mathrm{TrapGen}(1^\secpar, m, n, \ell)$
\Comment{$T$ is a trapdoor for $[I_\ell \otimes \mathbf{B} \mid \mathbf{W}]$}
\State $\mathbf{s} \getsr \ZZ_q^n$; $\mathbf{e} \getsr \chi^m$; $b \getsr \bits$
\State $\mathbf{u}_0 \gets \mathbf{B}\mathbf{s} + \mathbf{e}$; $\mathbf{u}_1 \getsr \ZZ_q^m$
\State $b' \gets \calA(1^\secpar, \mathbf{B}, \mathbf{W}, T, \mathbf{u}_b)$
\Return $[b' = b]$
\end{algorithmic}
\end{algorithm}
Evasive LWE is hard if for all efficient ,
is negligible. The name “evasive” refers to the fact that the trapdoor information should not help the adversary — the LWE instance “evades” the trapdoor.
The assumption comes in public-coin and private-coin variants. Private-coin variants have known counterexamples — BUW24, AMYY25. A circular variant of evasive LWE was proposed for ABE for unbounded-depth circuits, but has also been shown vulnerable to zeroizing attacks — AMYY25.
Succinct LWE
Succinct LWE is a strengthening of Evasive LWE introduced by Wee — Wee25. The -succinct LWE assumption uses the same trapdoor setup as Evasive LWE, but the parameter is allowed to be — large enough to encode circuit-depth information succinctly.
\begin{algorithm}
\algname{Game}
\caption{$\Game^{\mathrm{slwe}}_{\ell,n,q,\chi,m,\calA}(\secpar)$}
\begin{algorithmic}
\State $(\mathbf{B}, \mathbf{W}, T) \gets \mathrm{TrapGen}(1^\secpar, m, n, \ell)$
\Comment{$T$ trapdoor for $[I_\ell \otimes \mathbf{B} \mid \mathbf{W}]$; $\ell = \poly(\secpar)$}
\State $\mathbf{s} \getsr \ZZ_q^n$; $\mathbf{e} \getsr \chi^m$; $b \getsr \bits$
\State $\mathbf{u}_0 \gets \mathbf{B}\mathbf{s} + \mathbf{e}$; $\mathbf{u}_1 \getsr \ZZ_q^m$
\State $b' \gets \calA(1^\secpar, \mathbf{B}, \mathbf{W}, T, \mathbf{u}_b)$
\Return $[b' = b]$
\end{algorithmic}
\end{algorithm}
-Succinct LWE is hard if for all efficient ,
is negligible. Succinct LWE implies Evasive LWE (the regime subsumes the constant- regime). A circular small-secret variant (where the trapdoor preimage is related to a low-norm secret) is also used in applications.
The primary application is attribute-based encryption with -size ciphertexts and secret keys for arbitrary circuits — Wee25.