Trait snarkvm_wasm::Field [−][src]
The interface for a generic field.
Required methods
pub fn characteristic<'a>() -> &'a [u64]ⓘ[src]
Returns the characteristic of the field.
#[must_use]pub fn double(&self) -> Self[src]
Returns self + self.
pub fn double_in_place(&mut self) -> &mut Self[src]
Doubles self in place.
#[must_use]pub fn square(&self) -> Self[src]
Returns self * self.
pub fn square_in_place(&mut self) -> &mut Self[src]
Squares self in place.
#[must_use]pub fn inverse(&self) -> Option<Self>[src]
Computes the multiplicative inverse of self if self is nonzero.
pub fn inverse_in_place(&mut self) -> Option<&mut Self>[src]
pub fn frobenius_map(&mut self, power: usize)[src]
Exponentiates this element by a power of the base prime modulus via the Frobenius automorphism.
pub 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
pub fn pow<S>(&self, exp: S) -> Self where
S: AsRef<[u64]>, [src]
S: AsRef<[u64]>,
Exponentiates this element by a number represented with u64 limbs,
least significant limb first.
pub 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.
Implementors
impl<P> Field for snarkvm_wasm::fp6_2over3::Fp6<P> where
P: Fp6Parameters, [src]
P: Fp6Parameters,
pub fn characteristic<'a>() -> &'a [u64]ⓘ[src]
pub fn double(&self) -> Fp6<P>[src]
pub fn double_in_place(&mut self) -> &mut Fp6<P>[src]
pub fn square(&self) -> Fp6<P>[src]
pub fn from_random_bytes_with_flags(bytes: &[u8]) -> Option<(Fp6<P>, u8)>[src]
pub fn from_random_bytes(bytes: &[u8]) -> Option<Fp6<P>>[src]
pub fn square_in_place(&mut self) -> &mut Fp6<P>[src]
pub fn inverse(&self) -> Option<Fp6<P>>[src]
pub fn inverse_in_place(&mut self) -> Option<&mut Fp6<P>>[src]
pub fn frobenius_map(&mut self, power: usize)[src]
impl<P> Field for snarkvm_wasm::fp6_3over2::Fp6<P> where
P: Fp6Parameters, [src]
P: Fp6Parameters,
pub fn characteristic<'a>() -> &'a [u64]ⓘ[src]
pub fn double(&self) -> Fp6<P>[src]
pub fn double_in_place(&mut self) -> &mut Fp6<P>[src]
pub fn from_random_bytes_with_flags(bytes: &[u8]) -> Option<(Fp6<P>, u8)>[src]
pub fn from_random_bytes(bytes: &[u8]) -> Option<Fp6<P>>[src]
pub fn square(&self) -> Fp6<P>[src]
pub fn square_in_place(&mut self) -> &mut Fp6<P>[src]
pub fn inverse(&self) -> Option<Fp6<P>>[src]
pub fn inverse_in_place(&mut self) -> Option<&mut Fp6<P>>[src]
pub fn frobenius_map(&mut self, power: usize)[src]
impl<P> Field for Fp2<P> where
P: Fp2Parameters, [src]
P: Fp2Parameters,
pub fn characteristic<'a>() -> &'a [u64]ⓘ[src]
pub fn double(&self) -> Fp2<P>[src]
pub fn double_in_place(&mut self) -> &mut Fp2<P>[src]
pub fn square(&self) -> Fp2<P>[src]
pub fn from_random_bytes_with_flags(bytes: &[u8]) -> Option<(Fp2<P>, u8)>[src]
pub fn from_random_bytes(bytes: &[u8]) -> Option<Fp2<P>>[src]
pub fn square_in_place(&mut self) -> &mut Fp2<P>[src]
pub fn inverse(&self) -> Option<Fp2<P>>[src]
pub fn inverse_in_place(&mut self) -> Option<&mut Fp2<P>>[src]
pub fn frobenius_map(&mut self, power: usize)[src]
impl<P> Field for Fp3<P> where
P: Fp3Parameters, [src]
P: Fp3Parameters,
pub fn characteristic<'a>() -> &'a [u64]ⓘ[src]
pub fn double(&self) -> Fp3<P>[src]
pub fn double_in_place(&mut self) -> &mut Fp3<P>[src]
pub fn from_random_bytes_with_flags(bytes: &[u8]) -> Option<(Fp3<P>, u8)>[src]
pub fn from_random_bytes(bytes: &[u8]) -> Option<Fp3<P>>[src]
pub fn square(&self) -> Fp3<P>[src]
pub fn square_in_place(&mut self) -> &mut Fp3<P>[src]
pub fn inverse(&self) -> Option<Fp3<P>>[src]
pub fn inverse_in_place(&mut self) -> Option<&mut Fp3<P>>[src]
pub fn frobenius_map(&mut self, power: usize)[src]
impl<P> Field for Fp12<P> where
P: Fp12Parameters, [src]
P: Fp12Parameters,
pub fn characteristic<'a>() -> &'a [u64]ⓘ[src]
pub fn double(&self) -> Fp12<P>[src]
pub fn from_random_bytes_with_flags(bytes: &[u8]) -> Option<(Fp12<P>, u8)>[src]
pub fn from_random_bytes(bytes: &[u8]) -> Option<Fp12<P>>[src]
pub fn double_in_place(&mut self) -> &mut Fp12<P>[src]
pub fn frobenius_map(&mut self, power: usize)[src]
pub fn square(&self) -> Fp12<P>[src]
pub fn square_in_place(&mut self) -> &mut Fp12<P>[src]
pub fn inverse(&self) -> Option<Fp12<P>>[src]
pub fn inverse_in_place(&mut self) -> Option<&mut Fp12<P>>[src]
impl<P> Field for Fp256<P> where
P: Fp256Parameters, [src]
P: Fp256Parameters,
pub fn from_random_bytes_with_flags(bytes: &[u8]) -> Option<(Fp256<P>, u8)>[src]
pub fn double(&self) -> Fp256<P>[src]
pub fn double_in_place(&mut self) -> &mut Fp256<P>[src]
pub fn characteristic<'a>() -> &'a [u64]ⓘ[src]
pub fn square(&self) -> Fp256<P>[src]
pub fn square_in_place(&mut self) -> &mut Fp256<P>[src]
pub fn inverse(&self) -> Option<Fp256<P>>[src]
pub fn inverse_in_place(&mut self) -> Option<&mut Fp256<P>>[src]
pub fn frobenius_map(&mut self, usize)[src]
impl<P> Field for Fp320<P> where
P: Fp320Parameters, [src]
P: Fp320Parameters,
pub fn from_random_bytes_with_flags(bytes: &[u8]) -> Option<(Fp320<P>, u8)>[src]
pub fn double(&self) -> Fp320<P>[src]
pub fn double_in_place(&mut self) -> &mut Fp320<P>[src]
pub fn characteristic<'a>() -> &'a [u64]ⓘ[src]
pub fn square(&self) -> Fp320<P>[src]
pub fn square_in_place(&mut self) -> &mut Fp320<P>[src]
pub fn inverse(&self) -> Option<Fp320<P>>[src]
pub fn inverse_in_place(&mut self) -> Option<&mut Fp320<P>>[src]
pub fn frobenius_map(&mut self, usize)[src]
impl<P> Field for Fp384<P> where
P: Fp384Parameters, [src]
P: Fp384Parameters,
pub fn from_random_bytes_with_flags(bytes: &[u8]) -> Option<(Fp384<P>, u8)>[src]
pub fn double(&self) -> Fp384<P>[src]
pub fn double_in_place(&mut self) -> &mut Fp384<P>[src]
pub fn characteristic<'a>() -> &'a [u64]ⓘ[src]
pub fn square(&self) -> Fp384<P>[src]
pub fn square_in_place(&mut self) -> &mut Fp384<P>[src]
pub fn inverse(&self) -> Option<Fp384<P>>[src]
pub fn inverse_in_place(&mut self) -> Option<&mut Fp384<P>>[src]
pub fn frobenius_map(&mut self, usize)[src]
impl<P> Field for Fp768<P> where
P: Fp768Parameters, [src]
P: Fp768Parameters,
pub fn from_random_bytes_with_flags(bytes: &[u8]) -> Option<(Fp768<P>, u8)>[src]
pub fn double(&self) -> Fp768<P>[src]
pub fn double_in_place(&mut self) -> &mut Fp768<P>[src]
pub fn characteristic<'a>() -> &'a [u64]ⓘ[src]
pub fn square(&self) -> Fp768<P>[src]
pub fn square_in_place(&mut self) -> &mut Fp768<P>[src]
pub fn inverse(&self) -> Option<Fp768<P>>[src]
pub fn inverse_in_place(&mut self) -> Option<&mut Fp768<P>>[src]
pub fn frobenius_map(&mut self, usize)[src]
impl<P> Field for Fp832<P> where
P: Fp832Parameters, [src]
P: Fp832Parameters,