lol-0.7.0.0: A library for lattice cryptography.

Copyright(c) Eric Crockett 2011-2017
Chris Peikert 2011-2017
LicenseGPL-3
Maintainerecrockett0@email.com
Stabilityexperimental
PortabilityPOSIX \( \def\Z{\mathbb{Z}} \) \( \def\C{\mathbb{C}} \)
Safe HaskellNone
LanguageHaskell2010

Crypto.Lol.Types.Unsafe.ZqBasic

Description

An implementation of the quotient ring \(\Z_q = \Z/(q\Z)\). This module is "unsafe" because it exports the ZqBasic constructor. This module should only be used to make tensor-specific instances for ZqBasic. The safe way to use this type is to import Crypto.Lol.Types.

Synopsis

Documentation

newtype ZqBasic q z Source #

The ring \(\Z_q\) of integers modulo q, using underlying integer type z.

Constructors

ZqB 

Fields

Instances
Correct gad (CycG t m (ZqBasic q Int64)) => Correct (gad :: k2) (Cyc t m (ZqBasic q Int64)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

correct :: [Cyc t m (ZqBasic q Int64)] -> (Cyc t m (ZqBasic q Int64), [LiftOf (Cyc t m (ZqBasic q Int64))]) Source #

(Decompose gad (CycG t m (ZqBasic q Int64)), Reduce (Cyc t m Int64) (Cyc t m (ZqBasic q Int64))) => Decompose (gad :: k2) (Cyc t m (ZqBasic q Int64)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Associated Types

type DecompOf (Cyc t m (ZqBasic q Int64)) :: Type Source #

Methods

decompose :: Cyc t m (ZqBasic q Int64) -> [DecompOf (Cyc t m (ZqBasic q Int64))] Source #

Gadget gad (CycG t m (ZqBasic q z)) => Gadget (gad :: k2) (Cyc t m (ZqBasic q z)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

gadget :: [Cyc t m (ZqBasic q z)] Source #

encode :: Cyc t m (ZqBasic q z) -> [Cyc t m (ZqBasic q z)] Source #

(Reflects q z, ToInteger z) => Reduce Integer (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

reduce :: Integer -> ZqBasic q z Source #

(Reflects q z, IntegralDomain z) => Reduce z (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

reduce :: z -> ZqBasic q z Source #

(Reflects q z, ToInteger z, PID z, Enum z, NFData z) => CRTrans Maybe (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

CRTElt t (ZqBasic q z) => UnCyc t (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

cycPow :: Fact m => CycRep t P m (ZqBasic q z) -> Cyc t m (ZqBasic q z) Source #

cycDec :: Fact m => CycRep t D m (ZqBasic q z) -> Cyc t m (ZqBasic q z) Source #

unCycPow :: Fact m => Cyc t m (ZqBasic q z) -> CycRep t P m (ZqBasic q z) Source #

unCycDec :: Fact m => Cyc t m (ZqBasic q z) -> CycRep t D m (ZqBasic q z) Source #

(Reflects q z, ToInteger z, Ring z) => Correct TrivGad (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

correct :: [ZqBasic q z] -> (ZqBasic q z, [LiftOf (ZqBasic q z)]) Source #

(Reflects q z, ToInteger z) => Decompose TrivGad (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Associated Types

type DecompOf (ZqBasic q z) :: Type Source #

Methods

decompose :: ZqBasic q z -> [DecompOf (ZqBasic q z)] Source #

(Reflects q z, ToInteger z) => Gadget TrivGad (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

gadget :: [ZqBasic q z] Source #

encode :: ZqBasic q z -> [ZqBasic q z] Source #

(Reflects q z, ToInteger z, Reflects b z) => Correct (BaseBGad b :: Type) (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

correct :: [ZqBasic q z] -> (ZqBasic q z, [LiftOf (ZqBasic q z)]) Source #

(Reflects q z, ToInteger z, Reflects b z) => Decompose (BaseBGad b :: Type) (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Associated Types

type DecompOf (ZqBasic q z) :: Type Source #

Methods

decompose :: ZqBasic q z -> [DecompOf (ZqBasic q z)] Source #

(Reflects q z, ToInteger z, RealIntegral z, Reflects b z) => Gadget (BaseBGad b :: Type) (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

gadget :: [ZqBasic q z] Source #

encode :: ZqBasic q z -> [ZqBasic q z] Source #

CRTSetCyc (CycG t) (ZqBasic q z) => CRTSetCyc (Cyc t) (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

crtSet :: Divides m m' => Tagged m [Cyc t m' (ZqBasic q z)] Source #

ExtensionCyc (CycG t) (ZqBasic q z) => ExtensionCyc (Cyc t) (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

embed :: Divides m m' => Cyc t m (ZqBasic q z) -> Cyc t m' (ZqBasic q z) Source #

twace :: Divides m m' => Cyc t m' (ZqBasic q z) -> Cyc t m (ZqBasic q z) Source #

powBasis :: Divides m m' => Tagged m [Cyc t m' (ZqBasic q z)] Source #

coeffsCyc :: Divides m m' => Basis -> Cyc t m' (ZqBasic q z) -> [Cyc t m (ZqBasic q z)] Source #

(Mod (ZqBasic q z), Show z) => Show (ArgType (ZqBasic q z)) Source # 
Instance details

Defined in Crypto.Lol.Utils.ShowType

Methods

showsPrec :: Int -> ArgType (ZqBasic q z) -> ShowS #

show :: ArgType (ZqBasic q z) -> String #

showList :: [ArgType (ZqBasic q z)] -> ShowS #

(Protoable (IZipVector m (ZqBasic q Int64)), ProtoType (IZipVector m (ZqBasic q Int64)) ~ RqProduct, Protoable (IZipVector m b), ProtoType (IZipVector m b) ~ RqProduct) => Protoable (IZipVector m (ZqBasic q Int64, b)) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Associated Types

type ProtoType (IZipVector m (ZqBasic q Int64, b)) :: Type Source #

(Fact m, Reflects q Int64) => Protoable (IZipVector m (ZqBasic q Int64)) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Associated Types

type ProtoType (IZipVector m (ZqBasic q Int64)) :: Type Source #

(Fact m, Reflects q z, Reduce z b, ZeroTestable z, CRTElt t (ZqBasic q z), C b (Cyc t m b)) => RescaleCyc (Cyc t m) b (ZqBasic q z, b) Source #

rescale up by one additional modulus

Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

rescaleCyc :: Basis -> Cyc t m b -> Cyc t m (ZqBasic q z, b) Source #

(Fact m, UnCyc t Int64, UnCyc t (ZqBasic q z), IFunctor t, IFElt t Int64, IFElt t (ZqBasic q z)) => FunctorCyc (Cyc t m) Int64 (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

fmapCyc :: Maybe Basis -> (Int64 -> ZqBasic q z) -> Cyc t m Int64 -> Cyc t m (ZqBasic q z) Source #

(Fact m, UnCyc t Double, UnCyc t (ZqBasic q z), IFunctor t, IFElt t Double, IFElt t (ZqBasic q z)) => FunctorCyc (Cyc t m) Double (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

fmapCyc :: Maybe Basis -> (Double -> ZqBasic q z) -> Cyc t m Double -> Cyc t m (ZqBasic q z) Source #

(ToInteger z, Reflects q z, Reduce z b, Field b, FunctorCyc (Cyc t m) (ZqBasic q z) z, FunctorCyc (Cyc t m) z b, Additive (Cyc t m b), Module b (Cyc t m b)) => RescaleCyc (Cyc t m) (ZqBasic q z, b) b Source #

specialized (faster) rescale-down by a single \(\Z_q\)

Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

rescaleCyc :: Basis -> Cyc t m (ZqBasic q z, b) -> Cyc t m b Source #

(Fact m, UnCyc t (a, b), UnCyc t (ZqBasic q z), IFunctor t, IFElt t (a, b), IFElt t (ZqBasic q z)) => FunctorCyc (Cyc t m) (a, b) (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

fmapCyc :: Maybe Basis -> ((a, b) -> ZqBasic q z) -> Cyc t m (a, b) -> Cyc t m (ZqBasic q z) Source #

FoldableCyc (CycG t m) (ZqBasic q z) => FoldableCyc (Cyc t m) (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

foldrCyc :: Maybe Basis -> (ZqBasic q z -> b -> b) -> b -> Cyc t m (ZqBasic q z) -> b Source #

(Fact m, UnCyc t (ZqBasic q z), UnCyc t Int64, IFunctor t, IFElt t (ZqBasic q z), IFElt t Int64) => FunctorCyc (Cyc t m) (ZqBasic q z) Int64 Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

fmapCyc :: Maybe Basis -> (ZqBasic q z -> Int64) -> Cyc t m (ZqBasic q z) -> Cyc t m Int64 Source #

(Fact m, UnCyc t (ZqBasic q z), UnCyc t Double, IFunctor t, IFElt t (ZqBasic q z), IFElt t Double) => FunctorCyc (Cyc t m) (ZqBasic q z) Double Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

fmapCyc :: Maybe Basis -> (ZqBasic q z -> Double) -> Cyc t m (ZqBasic q z) -> Cyc t m Double Source #

(Fact m, Functor (t m), UnCyc t (ZqBasic q z)) => FunctorCyc (Cyc t m) (ZqBasic q z) Integer Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

fmapCyc :: Maybe Basis -> (ZqBasic q z -> Integer) -> Cyc t m (ZqBasic q z) -> Cyc t m Integer Source #

(Fact m, UnCyc t (ZqBasic q z), UnCyc t (a, b), IFunctor t, IFElt t (ZqBasic q z), IFElt t (a, b)) => FunctorCyc (Cyc t m) (ZqBasic q z) (a, b) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

fmapCyc :: Maybe Basis -> (ZqBasic q z -> (a, b)) -> Cyc t m (ZqBasic q z) -> Cyc t m (a, b) Source #

RescaleCyc (CycG t m) (ZqBasic q z) (ZqBasic p z) => RescaleCyc (Cyc t m) (ZqBasic q z) (ZqBasic p z) Source #

rescale from one modulus to another

Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

rescaleCyc :: Basis -> Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic p z) Source #

(Fact m, UnCyc t (ZqBasic q z), UnCyc t (ZqBasic q z), IFunctor t, IFElt t (ZqBasic q z), IFElt t (ZqBasic q z)) => FunctorCyc (Cyc t m) (ZqBasic q z) (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

fmapCyc :: Maybe Basis -> (ZqBasic q z -> ZqBasic q z) -> Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) Source #

(Fact m, UnCyc t (ZqBasic q z), UnCyc t (RRq q r), IFunctor t, IFElt t (ZqBasic q z), IFElt t (RRq q r)) => FunctorCyc (Cyc t m) (ZqBasic q z) (RRq q r) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

fmapCyc :: Maybe Basis -> (ZqBasic q z -> RRq q r) -> Cyc t m (ZqBasic q z) -> Cyc t m (RRq q r) Source #

(Fact m, UnCyc t (RRq q r), UnCyc t (ZqBasic q z), IFunctor t, IFElt t (RRq q r), IFElt t (ZqBasic q z)) => FunctorCyc (Cyc t m) (RRq q r) (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

fmapCyc :: Maybe Basis -> (RRq q r -> ZqBasic q z) -> Cyc t m (RRq q r) -> Cyc t m (ZqBasic q z) Source #

Eq z => Eq (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

(==) :: ZqBasic q z -> ZqBasic q z -> Bool #

(/=) :: ZqBasic q z -> ZqBasic q z -> Bool #

Eq (CycG t m (ZqBasic q z)) => Eq (Cyc t m (ZqBasic q z)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

(==) :: Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) -> Bool #

(/=) :: Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) -> Bool #

Ord z => Ord (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

compare :: ZqBasic q z -> ZqBasic q z -> Ordering #

(<) :: ZqBasic q z -> ZqBasic q z -> Bool #

(<=) :: ZqBasic q z -> ZqBasic q z -> Bool #

(>) :: ZqBasic q z -> ZqBasic q z -> Bool #

(>=) :: ZqBasic q z -> ZqBasic q z -> Bool #

max :: ZqBasic q z -> ZqBasic q z -> ZqBasic q z #

min :: ZqBasic q z -> ZqBasic q z -> ZqBasic q z #

Show z => Show (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

showsPrec :: Int -> ZqBasic q z -> ShowS #

show :: ZqBasic q z -> String #

showList :: [ZqBasic q z] -> ShowS #

Show (CycG t m (ZqBasic q z)) => Show (Cyc t m (ZqBasic q z)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

showsPrec :: Int -> Cyc t m (ZqBasic q z) -> ShowS #

show :: Cyc t m (ZqBasic q z) -> String #

showList :: [Cyc t m (ZqBasic q z)] -> ShowS #

(Reflects q z, Ring z, Random z) => Random (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

randomR :: RandomGen g => (ZqBasic q z, ZqBasic q z) -> g -> (ZqBasic q z, g) #

random :: RandomGen g => g -> (ZqBasic q z, g) #

randomRs :: RandomGen g => (ZqBasic q z, ZqBasic q z) -> g -> [ZqBasic q z] #

randoms :: RandomGen g => g -> [ZqBasic q z] #

randomRIO :: (ZqBasic q z, ZqBasic q z) -> IO (ZqBasic q z) #

randomIO :: IO (ZqBasic q z) #

Random (CycG t m (ZqBasic q z)) => Random (Cyc t m (ZqBasic q z)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

randomR :: RandomGen g => (Cyc t m (ZqBasic q z), Cyc t m (ZqBasic q z)) -> g -> (Cyc t m (ZqBasic q z), g) #

random :: RandomGen g => g -> (Cyc t m (ZqBasic q z), g) #

randomRs :: RandomGen g => (Cyc t m (ZqBasic q z), Cyc t m (ZqBasic q z)) -> g -> [Cyc t m (ZqBasic q z)] #

randoms :: RandomGen g => g -> [Cyc t m (ZqBasic q z)] #

randomRIO :: (Cyc t m (ZqBasic q z), Cyc t m (ZqBasic q z)) -> IO (Cyc t m (ZqBasic q z)) #

randomIO :: IO (Cyc t m (ZqBasic q z)) #

NFData z => NFData (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

rnf :: ZqBasic q z -> () #

NFData (CycG t m (ZqBasic q z)) => NFData (Cyc t m (ZqBasic q z)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

rnf :: Cyc t m (ZqBasic q z) -> () #

(Reflects q z, ToInteger z, PID z, Show z) => C (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

(/) :: ZqBasic q z -> ZqBasic q z -> ZqBasic q z #

recip :: ZqBasic q z -> ZqBasic q z #

fromRational' :: Rational -> ZqBasic q z #

(^-) :: ZqBasic q z -> Integer -> ZqBasic q z #

(Reflects q z, ToInteger z, PID z, Show z) => C (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

div :: ZqBasic q z -> ZqBasic q z -> ZqBasic q z #

mod :: ZqBasic q z -> ZqBasic q z -> ZqBasic q z #

divMod :: ZqBasic q z -> ZqBasic q z -> (ZqBasic q z, ZqBasic q z) #

(Reflects q z, ToInteger z) => C (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

(*) :: ZqBasic q z -> ZqBasic q z -> ZqBasic q z #

one :: ZqBasic q z #

fromInteger :: Integer -> ZqBasic q z #

(^) :: ZqBasic q z -> Integer -> ZqBasic q z #

Ring (CycG t m (ZqBasic q z)) => C (Cyc t m (ZqBasic q z)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

(*) :: Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) #

one :: Cyc t m (ZqBasic q z) #

fromInteger :: Integer -> Cyc t m (ZqBasic q z) #

(^) :: Cyc t m (ZqBasic q z) -> Integer -> Cyc t m (ZqBasic q z) #

C z => C (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

isZero :: ZqBasic q z -> Bool #

ZeroTestable (CycG t m (ZqBasic q z)) => C (Cyc t m (ZqBasic q z)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

isZero :: Cyc t m (ZqBasic q z) -> Bool #

(Reflects q z, IntegralDomain z) => C (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

zero :: ZqBasic q z #

(+) :: ZqBasic q z -> ZqBasic q z -> ZqBasic q z #

(-) :: ZqBasic q z -> ZqBasic q z -> ZqBasic q z #

negate :: ZqBasic q z -> ZqBasic q z #

Additive (CycG t m (ZqBasic q z)) => C (Cyc t m (ZqBasic q z)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

zero :: Cyc t m (ZqBasic q z) #

(+) :: Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) #

(-) :: Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) #

negate :: Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) #

(Reflects q z, Ring z, Ord z, IntegralDomain z) => Lift' (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

lift :: ZqBasic q z -> LiftOf (ZqBasic q z) Source #

(Reflects q z, ToInteger z) => Mod (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Associated Types

type ModRep (ZqBasic q z) :: Type Source #

Methods

modulus :: ModRep (ZqBasic q z) Source #

(Reflects q z, Ring z, Enum z) => Enumerable (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

values :: [ZqBasic q z] Source #

CosetGaussianCyc (CycG t m (ZqBasic q Int64)) => CosetGaussianCyc (Cyc t m (ZqBasic q Int64)) Source #

uses Double for the intermediate Gaussian samples

Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

cosetGaussian :: (ToRational v, MonadRandom rnd) => v -> Cyc t m (ZqBasic q Int64) -> rnd (LiftOf (Cyc t m (ZqBasic q Int64))) Source #

Cyclotomic (CycG t m (ZqBasic q z)) => Cyclotomic (Cyc t m (ZqBasic q z)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

mulG :: Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) Source #

divG :: Cyc t m (ZqBasic q z) -> Maybe (Cyc t m (ZqBasic q z)) Source #

advisePow :: Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) Source #

adviseDec :: Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) Source #

adviseCRT :: Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) Source #

(Reflects q z, ToInteger z, Ring (ZqBasic q z)) => CRTEmbed (ZqBasic q z) Source #

Embeds into the complex numbers \( \C \).

Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Associated Types

type CRTExt (ZqBasic q z) :: Type Source #

Methods

toExt :: ZqBasic q z -> CRTExt (ZqBasic q z) Source #

fromExt :: CRTExt (ZqBasic q z) -> ZqBasic q z Source #

Eq r => ApproxEqual (ZqBasic q r) Source # 
Instance details

Defined in Crypto.Lol.Utils.Tests

Methods

(=~=) :: ZqBasic q r -> ZqBasic q r -> Bool Source #

(Fact m, CRTElt t Double, Protoable (CycG t m (ZqBasic q z))) => Protoable (Cyc t m (ZqBasic q z)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Associated Types

type ProtoType (Cyc t m (ZqBasic q z)) :: Type Source #

Methods

toProto :: Cyc t m (ZqBasic q z) -> ProtoType (Cyc t m (ZqBasic q z)) Source #

fromProto :: MonadError String m0 => ProtoType (Cyc t m (ZqBasic q z)) -> m0 (Cyc t m (ZqBasic q z)) Source #

(Module (ZqBasic q z) (CycG t m (ZqBasic q z)), Ring (ZqBasic q z)) => C (ZqBasic q z) (Cyc t m (ZqBasic q z)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

(*>) :: ZqBasic q z -> Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) #

(Ring (GF (ZqBasic q z) d), Module (GF (ZqBasic q z) d) (CycG t m (ZqBasic q z))) => C (GF (ZqBasic q z) d) (Cyc t m (ZqBasic q z)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

(*>) :: GF (ZqBasic q z) d -> Cyc t m (ZqBasic q z) -> Cyc t m (ZqBasic q z) #

(Reflects p z, Reflects q z, IntegralDomain z, Field (ZqBasic q z), Field (ZqBasic p z)) => Encode (ZqBasic p z) (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

lsdToMSD :: (ZqBasic p z, ZqBasic q z) Source #

(Reflects q z, ToInteger z, Reflects q' z, Ring z) => Rescale (ZqBasic q z) (ZqBasic q' z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

Methods

rescale :: ZqBasic q z -> ZqBasic q' z Source #

(Reflects q Int64, Functor (t m)) => Reduce (Cyc t m Integer) (Cyc t m (ZqBasic q Int64)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

reduce :: Cyc t m Integer -> Cyc t m (ZqBasic q Int64) Source #

Reduce (CycG t m Int64) (CycG t m (ZqBasic q Int64)) => Reduce (Cyc t m Int64) (Cyc t m (ZqBasic q Int64)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

Methods

reduce :: Cyc t m Int64 -> Cyc t m (ZqBasic q Int64) Source #

(ToInteger z, RealField r, Reflects q z, Reflects q r) => Subgroup (ZqBasic q z) (RRq q r) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.RRq

Methods

fromSubgroup :: ZqBasic q z -> RRq q r Source #

newtype Cyc t m (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

newtype Cyc t m (ZqBasic q z) = CycZqB {}
type CharOf (ZqBasic p z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

type CharOf (ZqBasic p z) = p
type ProtoType (IZipVector m (ZqBasic q Int64, b)) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

type ProtoType (IZipVector m (ZqBasic q Int64)) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

type LiftOf (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

type LiftOf (ZqBasic q z) = z
type ModRep (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

type ModRep (ZqBasic q z) = z
type DecompOf (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

type DecompOf (ZqBasic q z) = z
type DecompOf (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

type DecompOf (ZqBasic q z) = z
type DecompOf (Cyc t m (ZqBasic q Int64)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

type DecompOf (Cyc t m (ZqBasic q Int64)) = Cyc t m Int64
type CRTExt (ZqBasic q z) Source # 
Instance details

Defined in Crypto.Lol.Types.Unsafe.ZqBasic

type ProtoType (Cyc t m (ZqBasic q z)) Source # 
Instance details

Defined in Crypto.Lol.Cyclotomic.Cyc

type ProtoType (Cyc t m (ZqBasic q z))

goodQs :: ToInteger a => a -> a -> [a] Source #

An infinite list of primes greater than lower and congruent to 1 mod m.