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
type E: ElementStore
type E: ElementStore
Natural storage class (u8, u16, u32, etc.) for storing elements of the field.
type EE: ElementStore
type EE: ElementStore
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
fn field_mask() -> Self::E