[][src]Struct libss::gf256::GF256

pub struct GF256(pub u8);

Represents an element in the field GF(2**8) without the use of lookup tables. This module uses subtle to hopefully achieve constant time guarantees, however this code has not been audited and should not be used in production.

Methods

impl GF256[src]

pub fn pow(self, elem: u8) -> Self[src]

Trait Implementations

impl Field for GF256[src]

fn zero() -> Self[src]

Returns the zero element of the field (additive identity)

fn one() -> Self[src]

Returns the zero element of the field (multiplicative identity)

fn is_zero(&self) -> bool[src]

Returns true if this element is the additive identity

fn square(&mut self)[src]

Squares the element

fn inverse(&self) -> Option<Self>[src]

Returns multiplicative inverse (self^254)

impl Eq for GF256[src]

impl PartialEq<GF256> for GF256[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Copy for GF256[src]

impl Clone for GF256[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for GF256[src]

impl Display for GF256[src]

impl Sub<GF256> for GF256[src]

type Output = GF256

The resulting type after applying the - operator.

impl Add<GF256> for GF256[src]

type Output = GF256

The resulting type after applying the + operator.

impl Mul<GF256> for GF256[src]

type Output = GF256

The resulting type after applying the * operator.

impl Div<GF256> for GF256[src]

type Output = Self

The resulting type after applying the / operator.

impl Neg for GF256[src]

type Output = GF256

The resulting type after applying the - operator.

impl AddAssign<GF256> for GF256[src]

impl SubAssign<GF256> for GF256[src]

impl MulAssign<GF256> for GF256[src]

impl DivAssign<GF256> for GF256[src]

impl Rand for GF256[src]

impl ConstantTimeEq for GF256[src]

impl ConditionallySelectable for GF256[src]

fn conditional_assign(&mut self, other: &Self, choice: Choice)[src]

Conditionally assign other to self, according to choice. Read more

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)[src]

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more

Auto Trait Implementations

impl Send for GF256

impl Sync for GF256

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]