lol-0.1.0.0: A library for lattice cryptography.

Safe HaskellNone
LanguageHaskell2010

Crypto.Lol.Types.FiniteField

Description

Basic (unoptimized) finite field arithmetic.

Synopsis

Documentation

type PrimeField fp = (Enumerable fp, Eq fp, ZeroTestable fp, Field fp, IrreduciblePoly fp) Source

Constraint synonym for prime-order fields.

type family CharOf fp :: Nat Source

The characteristic of a field, represented as a type.

Instances

type CharOf * (ZqBasic Nat p z) = p Source 

data GF fp deg Source

A finite field of given degree over F_p.

Instances

(Eq fp, C fp) => Eq (GF k fp deg) Source 
Show fp => Show (GF k fp deg) Source 
NFData fp => NFData (GF k fp deg) Source 
GFCtx k fp deg => C (GF k fp deg) Source 
GFCtx k fp deg => C (GF k fp deg) Source 
C fp => C (GF k fp deg) Source 
C fp => C (GF k fp deg) Source 
GFCtx k fp deg => Enumerable (GF k fp deg) Source 
GFCtx k fp deg => CRTrans (GF k fp deg) Source 

trace :: forall fp deg. GFCtx fp deg => GF fp deg -> fp Source

Trace into the prime subfield.

size :: GFCtx fp deg => Tagged (GF fp deg) Int Source

The order of the field: size (GF fp deg) = p^deg