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 \( \def\Z{\mathbb{Z}} \) \( \def\R{\mathbb{R}} \)
Safe HaskellNone
LanguageHaskell2010

Crypto.Lol.RLWE.Continuous

Description

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

Synopsis

Documentation

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

A continuous RLWE sample \( (a,b) \in R_q \times K/(qR) \). The base type rrq represents \( \R/q\Z \), the additive group of reals modulo \( q \).

type RLWECtx cm zq rrq = (Cyclotomic (cm zq), Ring (cm zq), Additive (cm rrq), Subgroup zq rrq, FunctorCyc cm zq rrq) Source #

Common constraints for working with continuous RLWE.

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

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

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

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

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

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

tailGaussian :: forall m v. (Fact m, Ord v, Transcendental v) => v -> v Source #

Gives \( c^2 \) such that the Gaussian mass outside a ball of radius \( c \) is approximately \( \epsilon \) (i.e., the Gaussian measure for \( \| x^2 \| > c^2 \cdot n \) is ( approx epsilon ).)

errorBound Source #

Arguments

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

the scaled variance

-> v

\( \varepsilon \)

-> v 

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