Learning With Errors #
This file gives a general definition of the LWE problem. It is parameterized by the following:
n
: the dimension of the secretm
: the number of samplesp
: the modulus (not necessarily prime)errSamp : ProbComp (Fin p)
: a probabilistic sampling algorithm for the error
(errSamp
can potentially be replaced with χ : PMF (Fin p)
instead, to be used with
evalDistWhen
with non-uniform distributions)
We define the (decision) LWE problem as a security experiment on an oracle that takes as input:
- A matrix
A : Fin m → Fin n → Fin p
- A vector
u : Fin m → Fin p
, either sampled uniformly at random, or sampled from the LWE distributions * A + e
, wheres : Fin n → Fin p
is the secret ande : Fin m → Fin p
has every entry sampled fromerrSamp
.
The adversary wins if it can correctly guess which case the distribution is.
The search LWE problem instead asks that the adversary given A
and u = s * A + e
outputs the
secret s
.
The decisional LWE experiment. If b = true
, the distribution is LWE, otherwise it is uniform.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- LWE_Advantage n m p errSamp adv = (LWE_Experiment n m p errSamp adv).advantage'
Instances For
The first game of the decisional LWE assumption, where the distribution is LWE.
(we map true
to ()
and false
to failure
)
Equations
- LWE_Game_0 n m p errSamp adv = do let distr ← LWE_Distr n m p errSamp let b ← adv distr pure b
Instances For
The second game of the decisional LWE assumption, where the distribution is uniform.
(we map true
to ()
and false
to failure
)
Equations
- LWE_Game_1 n m p adv = do let distr ← LWE_Uniform_Distr n m p let b ← adv distr pure b
Instances For
The search LWE experiment. The adversary wins if it can correctly guess the secret s
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- LWE_Search_Advantage n m p errSamp adv = (LWE_Search_Experiment n m p errSamp adv).advantage'
Instances For
The two ways of defining the decisional LWE assumption (via a single experiment or via two games) are equivalent.
(probably not correct)