Copyright | (c) Eric Crockett 2011-2017 Chris Peikert 2011-2018 |
---|---|
License | GPL-3 |
Maintainer | ecrockett0@gmail.com |
Stability | experimental |
Portability | POSIX \( \def\Z{\mathbb{Z}} \) \( \def\R{\mathbb{R}} \) |
Safe Haskell | None |
Language | Haskell2010 |
Functions and types for working with continuous ring-LWE samples.
Synopsis
- type Sample cm zq rrq = (cm zq, cm rrq)
- type RLWECtx cm zq rrq = (Cyclotomic (cm zq), Ring (cm zq), Additive (cm rrq), Subgroup zq rrq, FunctorCyc cm zq rrq)
- 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)
- errorTerm :: (RLWECtx cm zq rrq, LiftCyc (cm rrq)) => cm zq -> Sample cm zq rrq -> LiftOf (cm rrq)
- 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
- tailGaussian :: forall m v. (Fact m, Ord v, Transcendental v) => v -> v
- errorBound :: forall m v. (Fact m, Ord v, Transcendental v) => v -> v -> v
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 ).)
:: (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 \).