galois-field-0.4.1: Galois field library

Safe HaskellNone
LanguageHaskell2010

GaloisField

Synopsis

Documentation

class (Euclidean k, Ring k) => Field k where Source #

Fields.

Minimal complete definition

Nothing

Methods

divide :: k -> k -> k Source #

Division.

invert :: k -> k Source #

Inversion.

minus :: k -> k -> k Source #

Subtraction.

Instances
KnownNat im => Field (BinaryField im) Source # 
Instance details

Defined in BinaryField

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

Defined in PrimeField

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

Defined in ExtensionField

class (Arbitrary k, Field k, Fractional k, Generic k, Ord 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

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.

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 field element to integer.

qnr :: k Source #

Get randomised quadratic nonresidue.

qr :: k -> Bool Source #

Check if quadratic residue.

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 field element.

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

Defined in BinaryField

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

Defined in PrimeField

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

Defined in ExtensionField