Copyright | (c) Eric Crockett 2011-2018 Chris Peikert 2011-2018 |
---|---|
License | GPL-3 |
Maintainer | ecrockett0@gmail.com |
Stability | experimental |
Portability | POSIX \( \def\lcm{\text{lcm}} \) |
Safe Haskell | None |
Language | Haskell2010 |
Functions from one cyclotomic ring to another that are linear over a common subring.
Synopsis
- data Linear c (e :: Factored) (r :: Factored) (s :: Factored) z
- type ExtendLinCtx c e r s e' r' s' z = (e ~ FGCD r e', FLCM r e' `Divides` r', e' `Divides` s', s `Divides` s', ExtensionCyc c z, Additive (c s' z))
- linearDec :: forall c e r s z. (e `Divides` r, e `Divides` s, Cyclotomic (c s z), ExtensionCyc c z) => [c s z] -> Linear c e r s z
- evalLin :: forall c e r s z. (e `Divides` r, e `Divides` s, Ring (c s z), ExtensionCyc c z) => Linear c e r s z -> c r z -> c s z
- liftLin :: (LiftCyc (c s zp), LiftOf (c s zp) ~ c s (LiftOf zp)) => Maybe Basis -> Linear c e r s zp -> Linear c e r s (LiftOf zp)
- fmapLin :: (c s z -> c' s z) -> Linear c e r s z -> Linear c' e r s z
- extendLin :: forall c e r s e' r' s' z. ExtendLinCtx c e r s e' r' s' z => Linear c e r s z -> Linear c e' r' s' z
Documentation
data Linear c (e :: Factored) (r :: Factored) (s :: Factored) z Source #
An \(E\)-linear function from \(R\) to \(S\).
Instances
Show (c s z) => Show (Linear c e r s z) Source # | |
NFData (c s z) => NFData (Linear c e r s z) Source # | |
Defined in Crypto.Lol.Cyclotomic.Linear | |
Additive (c s z) => C (Linear c e r s z) Source # | |
(Reflects e Word32, Reflects r Word32, Protoable (c s zq), ProtoType (c s zq) ~ RqProduct) => Protoable (Linear c e r s zq) Source # | |
Reduce (c s z) (c s zp) => Reduce (Linear c e r s z) (Linear c e r s zp) Source # | |
type LiftOf (Linear c e r s zp) Source # | |
Defined in Crypto.Lol.Cyclotomic.Linear | |
type ProtoType (Linear c e r s zq) Source # | |
Defined in Crypto.Lol.Cyclotomic.Linear |
type ExtendLinCtx c e r s e' r' s' z = (e ~ FGCD r e', FLCM r e' `Divides` r', e' `Divides` s', s `Divides` s', ExtensionCyc c z, Additive (c s' z)) Source #
A convenient constraint synonym for extending a linear function to larger rings.
linearDec :: forall c e r s z. (e `Divides` r, e `Divides` s, Cyclotomic (c s z), ExtensionCyc c z) => [c s z] -> Linear c e r s z Source #
Construct an \(E\)-linear function given a list of its output values (in \(S\)) on the relative decoding basis of \(R/E\). The number of elements in the list must not exceed the size of the basis.
evalLin :: forall c e r s z. (e `Divides` r, e `Divides` s, Ring (c s z), ExtensionCyc c z) => Linear c e r s z -> c r z -> c s z Source #
Evaluates the given linear function on the input.
liftLin :: (LiftCyc (c s zp), LiftOf (c s zp) ~ c s (LiftOf zp)) => Maybe Basis -> Linear c e r s zp -> Linear c e r s (LiftOf zp) Source #
Lift the linear function in the specified basis (or any, if
Nothing
is given). The powerful basis is generally best,
geometrically.