estimator.lwe_guess.Distinguisher

estimator.lwe_guess.Distinguisher#

class estimator.lwe_guess.Distinguisher[source]#
__call__(params: LWEParameters, success_probability=0.99)[source]#

Estimate cost of distinguishing a 0-dimensional LWE instance from uniformly random, which is essentially the number of samples required.

Parameters:
  • params – LWE parameters

  • success_probability – the targeted success probability

Returns:

A cost dictionary

The returned cost dictionary has the following entries:

  • rop: Total number of word operations (≈ CPU cycles).

  • mem: memory requirement in integers mod q.

  • m: Required number of samples to distinguish.

EXAMPLE:

>>> from estimator import *
>>> from estimator.lwe_guess import distinguish
>>> params = LWE.Parameters(n=0, q=2 ** 32, Xs=ND.UniformMod(2), Xe=ND.DiscreteGaussian(2 ** 32))
>>> distinguish(params)
rop: ≈2^60.0, mem: ≈2^60.0, m: ≈2^60.0

Methods