galois-field-0.3.0: Galois field library

Safe HaskellNone




class (Arbitrary k, Eq k, Fractional k, Pretty k, Random k, Read 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, quad, rnd, sr


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.

order :: k -> Integer Source #

Order p^q of field.

frob :: k -> k Source #

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

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

Exponentiation of a field element to an integer.

quad :: k -> k -> k -> Maybe k Source #

Solve quadratic ax^2+bx+c=0 over field.

rnd :: MonadRandom m => m k Source #

Randomised field element.

sr :: k -> Maybe k Source #

Square root of a field element.

KnownNat im => GaloisField (BinaryField im) Source # 
Instance details

Defined in BinaryField

KnownNat p => GaloisField (PrimeField p) Source # 
Instance details

Defined in PrimeField

(GaloisField k, IrreducibleMonic k im) => GaloisField (ExtensionField k im) Source # 
Instance details

Defined in ExtensionField