galois-field-0.2.1: Galois field library

Safe HaskellNone
LanguageHaskell2010

GaloisField

Synopsis

Documentation

class (Arbitrary k, Eq k, Fractional k, Pretty k, Random k, Show k) => GaloisField k where Source #

Galois fields GF(p^q) for p prime and q non-negative.

Minimal complete definition

char, deg, frob, pow, rnd

Methods

char :: k -> Integer Source #

Characteristic p of field and order of prime subfield.

deg :: k -> Int Source #

Degree q of field as extension field over prime subfield.

frob :: k -> k Source #

Frobenius endomorphism x->x^p of prime subfield.

order :: k -> Integer Source #

Order p^q of field.

pow :: k -> Integer -> k Source #

Exponentiation x to the power of y.

rnd :: MonadRandom m => m k Source #

Randomised element x of field.