lol-0.7.0.0: A library for lattice cryptography.

Copyright(c) Eric Crockett 2011-2017
Chris Peikert 2011-2018
LicenseGPL-3
Maintainerecrockett0@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Crypto.Lol.RLWE.Discrete

Description

Functions and types for working with discretized ring-LWE samples.

Synopsis

Documentation

type Sample cm zq = (cm zq, cm zq) Source #

A discrete RLWE sample \( (a,b) \in R_q \times R_q \).

type RLWECtx cm zq = (Cyclotomic (cm zq), Ring (cm zq), Reduce (cm (LiftOf zq)) (cm zq)) Source #

Common constraints for working with discrete RLWE.

sample :: forall rnd v cm zq. (RLWECtx cm zq, Random (cm zq), RoundedGaussianCyc (cm (LiftOf zq)), MonadRandom rnd, ToRational v) => v -> cm zq -> rnd (Sample cm zq) Source #

A discrete RLWE sample with the given scaled variance and secret.

errorTerm :: (RLWECtx cm zq, LiftCyc (cm zq)) => cm zq -> Sample cm zq -> LiftOf (cm zq) Source #

The error term of an RLWE sample, given the purported secret.

errorGSqNorm :: (RLWECtx cm zq, GSqNormCyc cm (LiftOf zq), LiftCyc (cm zq), LiftOf (cm zq) ~ cm (LiftOf zq)) => cm zq -> Sample cm zq -> LiftOf zq Source #

The gSqNorm of the error term of an RLWE sample, given the purported secret.

errorBound Source #

Arguments

:: (Fact m, RealRing v, Transcendental v) 
=> v

the scaled variance

-> v

\(\epsilon\)

-> Int64 

A bound such that the gSqNorm of a discretized error term generated by roundedGaussian with scaled variance \(v\) (over the \(m\)th cyclotomic field) is less than the bound except with probability approximately \(\epsilon\).