Trait guff::GaloisField[][src]

pub trait GaloisField {
    type E: ElementStore;
    type EE: ElementStore;
    fn poly(&self) -> Self::E;
fn full_poly(&self) -> Self::EE;
fn high_bit() -> Self::E;
fn order() -> u16;
fn field_mask() -> Self::E; fn add(&self, a: Self::E, b: Self::E) -> Self::E { ... }
fn mul(&self, a: Self::E, b: Self::E) -> Self::E { ... }
fn div(&self, a: Self::E, b: Self::E) -> Self::E { ... }
fn inv(&self, a: Self::E) -> Self::E { ... }
fn pow(&self, a: Self::E, b: Self::EE) -> Self::E { ... } }
Expand description

Associated Types

Natural storage class (u8, u16, u32, etc.) for storing elements of the field.

The next largest natural storage class, eg if E is u8, then EE should be U16. Used for:

  • storing/returning field polynomial, which is always larger than the largest field element

  • storing the result of a non-modular (overflowing) multiply of two field elements

Required methods

The field polynomial with (implicit) high bit stripped off.

Field polynomial in full

These will become associated constants

Provided methods

Implementors