lol-0.5.0.1: A library for lattice cryptography.

Safe HaskellNone
LanguageHaskell2010

Crypto.Lol.Cyclotomic.RescaleCyc

Description

\( \def\Z{\mathbb{Z}} \)

A class and helper functions for rescaling cycltomic ring elements.

Synopsis

Documentation

data Basis Source #

Represents the basis used to rescale a cyclotomic ring element.

Constructors

Pow 
Dec 

class RescaleCyc c a b where Source #

Represents cyclotomic rings that are rescalable over their base rings. (This is a class because it allows for more efficient specialized implementations.)

Minimal complete definition

rescaleCyc

Methods

rescaleCyc :: Fact m => Basis -> c m a -> c m b Source #

Rescale in the given basis.

Instances

(Rescale a b, CElt t a, TElt t b) => RescaleCyc (Cyc t) a b Source # 

Methods

rescaleCyc :: Fact m => Basis -> Cyc t m a -> Cyc t m b Source #

(Mod a, Field b, Lift a (ModRep a), Reduce (LiftOf a) b, CElt t (a, b), CElt t a, CElt t b, CElt t (LiftOf a)) => RescaleCyc (Cyc t) (a, b) b Source #

specialized instance for product rings of \(\Z_q\)s: ~2x faster algorithm

Methods

rescaleCyc :: Fact m => Basis -> Cyc t m (a, b) -> Cyc t m b Source #

rescalePow :: (RescaleCyc c a b, Fact m) => c m a -> c m b Source #

Specialized convenience functions.

rescaleDec :: (RescaleCyc c a b, Fact m) => c m a -> c m b Source #

Specialized convenience functions.