Trait snarkvm_fields::Field [−][src]
The interface for a generic field.
Required methods
fn characteristic<'a>() -> &'a [u64][src]
Returns the characteristic of the field.
#[must_use]fn double(&self) -> Self[src]
Returns self + self.
fn double_in_place(&mut self) -> &mut Self[src]
Doubles self in place.
#[must_use]fn square(&self) -> Self[src]
Returns self * self.
fn square_in_place(&mut self) -> &mut Self[src]
Squares self in place.
#[must_use]fn inverse(&self) -> Option<Self>[src]
Computes the multiplicative inverse of self if self is nonzero.
fn inverse_in_place(&mut self) -> Option<&mut Self>[src]
fn frobenius_map(&mut self, power: usize)[src]
Exponentiates this element by a power of the base prime modulus via the Frobenius automorphism.
fn from_random_bytes_with_flags(bytes: &[u8]) -> Option<(Self, u8)>[src]
Returns a field element with an extra sign bit used for group parsing if the set of bytes forms a valid field element, otherwise returns None. This function is primarily intended for sampling random field elements from a hash-function or RNG output.
Provided methods
fn pow<S: AsRef<[u64]>>(&self, exp: S) -> Self[src]
Exponentiates this element by a number represented with u64 limbs,
least significant limb first.
fn from_random_bytes(bytes: &[u8]) -> Option<Self>[src]
Returns a field element if the set of bytes forms a valid field element, otherwise returns None. This function is primarily intended for sampling random field elements from a hash-function or RNG output.