Copyright | (c) Eric Crockett 2011-2017 Chris Peikert 2011-2018 |
---|---|
License | GPL-3 |
Maintainer | ecrockett0@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Functions and types for working with discretized ring-LWE samples.
Synopsis
- type Sample cm zq = (cm zq, cm zq)
- type RLWECtx cm zq = (Cyclotomic (cm zq), Ring (cm zq), Reduce (cm (LiftOf zq)) (cm zq))
- 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)
- errorTerm :: (RLWECtx cm zq, LiftCyc (cm zq)) => cm zq -> Sample cm zq -> LiftOf (cm zq)
- errorGSqNorm :: (RLWECtx cm zq, GSqNormCyc cm (LiftOf zq), LiftCyc (cm zq), LiftOf (cm zq) ~ cm (LiftOf zq)) => cm zq -> Sample cm zq -> LiftOf zq
- errorBound :: forall m v. (Fact m, RealRing v, Transcendental v) => v -> v -> Int64
Documentation
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.
:: (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\).