lol-0.3.0.0: A library for lattice cryptography.

Safe HaskellNone
LanguageHaskell2010

Crypto.Lol.Cyclotomic.RescaleCyc

Description

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

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

generic instance

(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 Zqs: ~2x faster algorithm

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.