[][src]Trait libss::Field

pub trait Field: Sized + Eq + Copy + Clone + Send + Sync + Debug + Display + 'static + Rand + Add<Output = Self> + AddAssign + Div<Output = Self> + DivAssign + Mul<Output = Self> + MulAssign + Neg<Output = Self> + Sub<Output = Self> + SubAssign {
    fn zero() -> Self;
fn one() -> Self;
fn is_zero(&self) -> bool;
fn inverse(&self) -> Option<Self>;
fn square(&mut self); }

The Field trait is taken from zkcrypto/ff This trait represents an element of a field.

Required methods

fn zero() -> Self

Returns the zero element of the field, the additive identity.

fn one() -> Self

Returns the one element of the field, the multiplicative identity.

fn is_zero(&self) -> bool

Returns true iff this element is zero.

fn inverse(&self) -> Option<Self>

Computes the multiplicative inverse of this element, if nonzero.

fn square(&mut self)

Squares this element.

Loading content...

Implementors

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)

Loading content...