lol-0.4.0.0: A library for lattice cryptography.

Safe HaskellNone
LanguageHaskell2010

Crypto.Lol.RLWE.Discrete

Description

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

Synopsis

Documentation

type Sample t m zq = (Cyc t m zq, Cyc t m zq) Source #

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

type RLWECtx t m zq = (Fact m, Ring zq, Lift' zq, ToInteger (LiftOf zq), CElt t zq, CElt t (LiftOf zq)) Source #

Common constraints for working with discrete RLWE.

sample :: forall rnd v t m zq. (RLWECtx t m zq, Random zq, MonadRandom rnd, ToRational v) => v -> Cyc t m zq -> rnd (Sample t m zq) Source #

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

errorTerm :: RLWECtx t m zq => Cyc t m zq -> Sample t m zq -> Cyc t m (LiftOf zq) Source #

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

errorGSqNorm :: (RLWECtx t m zq, Ring (LiftOf zq)) => Cyc t m zq -> Sample t m zq -> LiftOf zq Source #

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

errorBound Source #

Arguments

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

the scaled variance

-> v

\(\epsilon\)

-> Tagged m Int64 

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