[−][src]Struct isochronous_finite_fields::GF
Galois field wrapper struct.
It is wrapped around an u8
type, to guarantee at compile time that
all elements are in the finite field GF(28).
Methods
impl GF
[src]
pub fn multiplicative_inverse(self) -> Self
[src]
Calculates the multiplicative inverse. The multiplicative inverse is the element in the Galois field that results in a product of 1.
Example
let element = GF(148); let inverse = element.multiplicative_inverse(); assert_eq!(element * inverse, GF(1));
Trait Implementations
impl Add<GF> for GF
[src]
Adding two elements in the Galois field GF(28) is equal to doing an exclusive or (XOR) between the two elements. It is also equal to subtracting two elements.
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self::Output
[src]
impl AddAssign<GF> for GF
[src]
fn add_assign(&mut self, rhs: Self)
[src]
impl Clone for GF
[src]
fn clone(&self) -> GF
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for GF
[src]
impl Debug for GF
[src]
impl Eq for GF
[src]
impl From<u8> for GF
[src]
impl Hash for GF
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Mul<GF> for GF
[src]
Multiplication in this finite field is multiplication modulo AES standardized irreducible
polynomial
x8 + x4 + x3 + x + 1
(or 0b1_0001_1011
).
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self::Output
[src]
impl MulAssign<GF> for GF
[src]
fn mul_assign(&mut self, rhs: Self)
[src]
impl Ord for GF
[src]
fn cmp(&self, other: &GF) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<GF> for GF
[src]
impl PartialOrd<GF> for GF
[src]
fn partial_cmp(&self, other: &GF) -> Option<Ordering>
[src]
fn lt(&self, other: &GF) -> bool
[src]
fn le(&self, other: &GF) -> bool
[src]
fn gt(&self, other: &GF) -> bool
[src]
fn ge(&self, other: &GF) -> bool
[src]
impl StructuralEq for GF
[src]
impl StructuralPartialEq for GF
[src]
impl Sub<GF> for GF
[src]
Subtracting two elements in the Galois field GF(28) is equal to doing an exclusive or (XOR) between the two elements. It is also equal to adding two elements.
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self::Output
[src]
impl SubAssign<GF> for GF
[src]
fn sub_assign(&mut self, rhs: Self)
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,