pub struct F8 {
pub full: u16,
pub compact: u8,
}
Expand description
A type implementing (default) maths in GF(28)
Formats the value using the given formatter. Read more
Natural storage class (u8, u16, u32, etc.) for storing
elements of the field. Read more
The next largest natural storage class, eg if E is u8, then EE
should be U16. Used for: Read more
As EE, but signed. Used internally to implement some lookup
tables. Read more
Size of the field in bits, eg GF(28) → 8
High bit of field polynomial, eg GF(28) → 0x100
Mask for selecting all bits of field value,
eg GF(28) → 0xff Read more
High bit of field values, eg GF(28) → 0x80
The field polynomial with (implicit) high bit stripped off.
Field polynomial in full, with high poly bit set
fn add(&self, a: Self::E, b: Self::E) -> Self::E
Addition in Galois Fields GF(2x) is simply XOR
fn sub(&self, a: Self::E, b: Self::E) -> Self::E
Subtraction is the same as addition in GF(2x)
fn mul(&self, a: Self::E, b: Self::E) -> Self::E
Polynomial multiplication modulo the field polynomial
fn div(&self, a: Self::E, b: Self::E) -> Self::E
Division modulo to the field polynomial (default
implementation calculated as a・b-1) Read more
fn inv(&self, a: Self::E) -> Self::E
Calculate polynomial a-1 modulo the field
polynomial (using Extended Euclidean method) Read more
fn pow(&self, a: Self::E, b: Self::EE) -> Self::E where
Self::E: Into<Self::EE>,
Calculate polynomial ab modulo the field
polynomial Read more
Access Self::HIGH_BIT as a method
Access Self::ORDER as a method
Access Self::FIELD_MASK as a method
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.