Safe Haskell | None |
---|---|

Language | Haskell2010 |

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

- type Sample t m zq = (Cyc t m zq, Cyc t m zq)
- type RLWECtx t m zq = (Fact m, Ring zq, Lift' zq, ToInteger (LiftOf zq), CElt t zq, CElt t (LiftOf zq))
- 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)
- errorTerm :: RLWECtx t m zq => Cyc t m zq -> Sample t m zq -> Cyc t m (LiftOf zq)
- errorGSqNorm :: (RLWECtx t m zq, Ring (LiftOf zq)) => Cyc t m zq -> Sample t m zq -> LiftOf zq
- errorBound :: (RealRing v, Transcendental v, Fact m) => v -> v -> Tagged m Int64

# 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.

:: (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\).