Trait snarkvm_wasm::Field[][src]

pub trait Field: 'static + Zero + One + Clone + Eq + Ord + From<u128> + From<u64> + From<u32> + From<u16> + From<u8> + Default + Send + Copy + Sync + for<'a> Add<&'a Self, Output = Self> + for<'a> Sub<&'a Self, Output = Self> + for<'a> Mul<&'a Self, Output = Self> + for<'a> Div<&'a Self, Output = Self> + Neg<Output = Self> + for<'a> AddAssign<&'a Self> + for<'a> SubAssign<&'a Self> + for<'a> MulAssign<&'a Self> + for<'a> DivAssign<&'a Self> + Debug + Display + Hash + ToBytes + FromBytes + UniformRand + CanonicalSerializeWithFlags + ConstantSerializedSize + CanonicalSerialize + CanonicalDeserializeWithFlags + CanonicalDeserialize + for<'a> Deserialize<'a> + Serialize {
    pub fn characteristic<'a>() -> &'a [u64]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
;
#[must_use] pub fn double(&self) -> Self;
pub fn double_in_place(&mut self) -> &mut Self;
#[must_use] pub fn square(&self) -> Self;
pub fn square_in_place(&mut self) -> &mut Self;
#[must_use] pub fn inverse(&self) -> Option<Self>;
pub fn inverse_in_place(&mut self) -> Option<&mut Self>;
pub fn frobenius_map(&mut self, power: usize);
pub fn from_random_bytes_with_flags(bytes: &[u8]) -> Option<(Self, u8)>; pub fn pow<S>(&self, exp: S) -> Self
    where
        S: AsRef<[u64]>
, { ... }
pub fn from_random_bytes(bytes: &[u8]) -> Option<Self> { ... } }

The interface for a generic field.

Required methods

pub fn characteristic<'a>() -> &'a [u64]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[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.

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

Loading content...

Implementors

impl<P> Field for snarkvm_wasm::fp6_2over3::Fp6<P> where
    P: Fp6Parameters
[src]

impl<P> Field for snarkvm_wasm::fp6_3over2::Fp6<P> where
    P: Fp6Parameters
[src]

impl<P> Field for Fp2<P> where
    P: Fp2Parameters
[src]

impl<P> Field for Fp3<P> where
    P: Fp3Parameters
[src]

impl<P> Field for Fp12<P> where
    P: Fp12Parameters
[src]

impl<P> Field for Fp256<P> where
    P: Fp256Parameters
[src]

impl<P> Field for Fp320<P> where
    P: Fp320Parameters
[src]

impl<P> Field for Fp384<P> where
    P: Fp384Parameters
[src]

impl<P> Field for Fp768<P> where
    P: Fp768Parameters
[src]

impl<P> Field for Fp832<P> where
    P: Fp832Parameters
[src]

Loading content...