[][src]Trait blstrs::Field

pub trait Field: 'static + Clone + Eq + Send + Copy + Sync + Debug + Display {
    fn random<R>(rng: &mut R) -> Self
    where
        R: RngCore
;
fn zero() -> Self;
fn one() -> Self;
fn is_zero(&self) -> bool;
fn square(&mut self);
fn double(&mut self);
fn negate(&mut self);
fn add_assign(&mut self, other: &Self);
fn sub_assign(&mut self, other: &Self);
fn mul_assign(&mut self, other: &Self);
fn inverse(&self) -> Option<Self>;
fn frobenius_map(&mut self, power: usize); fn pow<S>(&self, exp: S) -> Self
    where
        S: AsRef<[u64]>
, { ... } }

This trait represents an element of a field.

Required methods

fn random<R>(rng: &mut R) -> Self where
    R: RngCore

Returns an element chosen uniformly at random using a user-provided RNG.

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 square(&mut self)

Squares this element.

fn double(&mut self)

Doubles this element.

fn negate(&mut self)

Negates this element.

fn add_assign(&mut self, other: &Self)

Adds another element to this element.

fn sub_assign(&mut self, other: &Self)

Subtracts another element from this element.

fn mul_assign(&mut self, other: &Self)

Multiplies another element by this element.

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

Computes the multiplicative inverse of this element, if nonzero.

fn frobenius_map(&mut self, power: usize)

Exponentiates this element by a power of the base prime modulus via the Frobenius automorphism.

Loading content...

Provided methods

fn pow<S>(&self, exp: S) -> Self where
    S: AsRef<[u64]>, 

Exponentiates this element by a number represented with u64 limbs, least significant digit first.

Loading content...

Implementors

impl Field for Fp2[src]

impl Field for Fp6[src]

impl Field for Fp12[src]

impl Field for Fp[src]

impl Field for Scalar[src]

Loading content...