Trait blstrs::Field[][src]

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

This trait represents an element of a field.

Required methods

pub fn random<R>(rng: &mut R) -> Self where
    R: RngCore
[src]

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

pub fn zero() -> Self[src]

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

pub fn one() -> Self[src]

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

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

Returns true iff this element is zero.

pub fn square(&mut self)[src]

Squares this element.

pub fn double(&mut self)[src]

Doubles this element.

pub fn negate(&mut self)[src]

Negates this element.

pub fn add_assign(&mut self, other: &Self)[src]

Adds another element to this element.

pub fn sub_assign(&mut self, other: &Self)[src]

Subtracts another element from this element.

pub fn mul_assign(&mut self, other: &Self)[src]

Multiplies another element by this element.

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

Computes the multiplicative inverse of this element, if nonzero.

pub fn frobenius_map(&mut self, power: usize)[src]

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

Loading content...

Provided methods

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

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...