guff 0.1.1

Implements Galois Fields for various natural sizes
Documentation

Grand Unified Finite Field library*

Implements GF(2x) for various "natural" sizes such as 28, 216 and 232.

Basic Use: doing maths in a particular field

As a user, the steps to take to use this library are:

  • decide what "class" of field you want to use (GF(28), GF(216), etc.);

  • decide if you want to use one of the optimised adaptations or are happy with the default, generic code;

  • create a new field object (we can call f) of that class with your chosen field polynomial (aka "irreducible polynomial") by calling the appropriate constructor;

  • use that object to do maths in that field: eg, result = f.mul(a,b)

use guff::{GaloisField, F4};

fn main() {
// create a GF(2<sup>4</sup>) field from a struct
// * `19` is the field's irreducible polynomial
// * `3` is the same value with bit 0x10 removed
let f = guff::F4 { full : 19, compact : 3 };

assert_eq!(f.pow(5,3), f.mul(5,f.mul(5,5)) );
}

Crate Name

* The crate name is deliberately hyperbolic:

Noun guff - unacceptable behavior (especially ludicrously false statements)