Trait pairing_ce::Field

source ·
pub trait Field: Sized + Eq + Copy + Clone + Send + Sync + Debug + Display + 'static + Rand + Hash + Default + Serialize + DeserializeOwned {
    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]>
, { ... } }
Expand description

This trait represents an element of a field.

Required Methods§

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

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

Returns true iff this element is zero.

Squares this element.

Doubles this element.

Negates this element.

Adds another element to this element.

Subtracts another element from this element.

Multiplies another element by this element.

Computes the multiplicative inverse of this element, if nonzero.

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

Provided Methods§

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

Implementors§