Struct snarkvm_fields::Fp12[][src]

pub struct Fp12<P: Fp12Parameters> {
    pub c0: Fp6<P::Fp6Params>,
    pub c1: Fp6<P::Fp6Params>,
    // some fields omitted
}
Expand description

An element of Fp12, represented by c0 + c1 * v

Fields

c0: Fp6<P::Fp6Params>c1: Fp6<P::Fp6Params>

Implementations

impl<P: Fp12Parameters> Fp12<P>[src]

pub fn new(c0: Fp6<P::Fp6Params>, c1: Fp6<P::Fp6Params>) -> Self[src]

pub fn mul_by_fp(
    &mut self,
    element: &<<P::Fp6Params as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp
)
[src]

pub fn conjugate(&mut self)[src]

pub fn mul_by_034(
    &mut self,
    c0: &Fp2<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params>,
    c3: &Fp2<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params>,
    c4: &Fp2<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params>
)
[src]

pub fn mul_by_014(
    &mut self,
    c0: &Fp2<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params>,
    c1: &Fp2<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params>,
    c4: &Fp2<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params>
)
[src]

pub fn cyclotomic_square(&self) -> Self[src]

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

Trait Implementations

impl<'a, P: Fp12Parameters> Add<&'a Fp12<P>> for Fp12<P>[src]

type Output = Self

The resulting type after applying the + operator.

fn add(self, other: &Self) -> Self[src]

Performs the + operation. Read more

impl<'a, P: Fp12Parameters> AddAssign<&'a Fp12<P>> for Fp12<P>[src]

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

Performs the += operation. Read more

impl<P: Fp12Parameters> CanonicalDeserialize for Fp12<P>[src]

fn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>[src]

Reads Self from reader.

fn deserialize_uncompressed<R>(
    reader: &mut R
) -> Result<Self, SerializationError> where
    R: Read
[src]

Reads Self from reader without compression.

impl<P: Fp12Parameters> CanonicalDeserializeWithFlags for Fp12<P>[src]

fn deserialize_with_flags<R: Read, F: Flags>(
    reader: &mut R
) -> Result<(Self, F), SerializationError>
[src]

Reads Self and Flags from reader. Returns empty flags by default. Read more

impl<P: Fp12Parameters> CanonicalSerialize for Fp12<P>[src]

fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>[src]

Serializes self into writer.

fn serialized_size(&self) -> usize[src]

fn serialize_uncompressed<W>(
    &self,
    writer: &mut W
) -> Result<(), SerializationError> where
    W: Write
[src]

Serializes self into writer without compression.

fn uncompressed_size(&self) -> usize[src]

impl<P: Fp12Parameters> CanonicalSerializeWithFlags for Fp12<P>[src]

fn serialize_with_flags<W: Write, F: Flags>(
    &self,
    writer: &mut W,
    flags: F
) -> Result<(), SerializationError>
[src]

Serializes self and flags into writer.

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

fn clone(&self) -> Self[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<P: Fp12Parameters> ConstantSerializedSize for Fp12<P>[src]

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

fn fmt(&self, __f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl<'de, P: Fp12Parameters> Deserialize<'de> for Fp12<P>[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl<P: Fp12Parameters> Display for Fp12<P>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<'a, P: Fp12Parameters> Div<&'a Fp12<P>> for Fp12<P>[src]

type Output = Self

The resulting type after applying the / operator.

fn div(self, other: &Self) -> Self[src]

Performs the / operation. Read more

impl<'a, P: Fp12Parameters> DivAssign<&'a Fp12<P>> for Fp12<P>[src]

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

Performs the /= operation. Read more

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

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

Returns the characteristic of the field.

fn double(&self) -> Self[src]

Returns self + self.

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

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

fn double_in_place(&mut self) -> &mut Self[src]

Doubles self in place.

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

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

fn square(&self) -> Self[src]

Returns self * self.

fn square_in_place(&mut self) -> &mut Self[src]

Squares self in place.

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 pow<S: AsRef<[u64]>>(&self, exp: S) -> Self[src]

Exponentiates this element by a number represented with u64 limbs, least significant limb first. Read more

impl<P: Fp12Parameters> From<u128> for Fp12<P>[src]

fn from(other: u128) -> Self[src]

Performs the conversion.

impl<P: Fp12Parameters> From<u16> for Fp12<P>[src]

fn from(other: u16) -> Self[src]

Performs the conversion.

impl<P: Fp12Parameters> From<u32> for Fp12<P>[src]

fn from(other: u32) -> Self[src]

Performs the conversion.

impl<P: Fp12Parameters> From<u64> for Fp12<P>[src]

fn from(other: u64) -> Self[src]

Performs the conversion.

impl<P: Fp12Parameters> From<u8> for Fp12<P>[src]

fn from(other: u8) -> Self[src]

Performs the conversion.

impl<P: Fp12Parameters> FromBytes for Fp12<P>[src]

fn read<R: Read>(reader: R) -> IoResult<Self>[src]

Reads Self from reader.

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

fn hash<__HP>(&self, __state: &mut __HP) where
    __HP: Hasher
[src]

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

impl<'a, P: Fp12Parameters> Mul<&'a Fp12<P>> for Fp12<P>[src]

type Output = Self

The resulting type after applying the * operator.

fn mul(self, other: &Self) -> Self[src]

Performs the * operation. Read more

impl<'a, P: Fp12Parameters> MulAssign<&'a Fp12<P>> for Fp12<P>[src]

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

Performs the *= operation. Read more

impl<P: Fp12Parameters> Neg for Fp12<P>[src]

type Output = Self

The resulting type after applying the - operator.

#[must_use]
fn neg(self) -> Self
[src]

Performs the unary - operation. Read more

impl<P: Fp12Parameters> One for Fp12<P>[src]

fn one() -> Self[src]

fn is_one(&self) -> bool[src]

impl<P: Fp12Parameters> Ord for Fp12<P>[src]

fn cmp(&self, other: &Self) -> Ordering[src]

This method returns an Ordering between self and other. Read more

#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]

Compares and returns the maximum of two values. Read more

#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]

Compares and returns the minimum of two values. Read more

#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]

Restrict a value to a certain interval. Read more

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

fn eq(&self, other: &Self) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<P: Fp12Parameters> PartialOrd<Fp12<P>> for Fp12<P>[src]

fn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<P: Fp12Parameters> Serialize for Fp12<P>[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl<'a, P: Fp12Parameters> Sub<&'a Fp12<P>> for Fp12<P>[src]

type Output = Self

The resulting type after applying the - operator.

fn sub(self, other: &Self) -> Self[src]

Performs the - operation. Read more

impl<'a, P: Fp12Parameters> SubAssign<&'a Fp12<P>> for Fp12<P>[src]

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

Performs the -= operation. Read more

impl<P: Fp12Parameters> ToBytes for Fp12<P>[src]

fn write<W: Write>(&self, writer: W) -> IoResult<()>[src]

Serializes self into writer.

impl<P: Fp12Parameters> Zero for Fp12<P>[src]

fn zero() -> Self[src]

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

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

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

Auto Trait Implementations

impl<P> RefUnwindSafe for Fp12<P> where
    P: RefUnwindSafe,
    <<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp: RefUnwindSafe,
    <<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params: RefUnwindSafe,
    <P as Fp12Parameters>::Fp6Params: RefUnwindSafe

impl<P> Send for Fp12<P>

impl<P> Sync for Fp12<P>

impl<P> Unpin for Fp12<P> where
    P: Unpin,
    <<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp: Unpin,
    <<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params: Unpin,
    <P as Fp12Parameters>::Fp6Params: Unpin

impl<P> UnwindSafe for Fp12<P> where
    P: UnwindSafe,
    <<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp: UnwindSafe,
    <<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params: UnwindSafe,
    <P as Fp12Parameters>::Fp6Params: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> UniformRand for T where
    Standard: Distribution<T>, 
[src]

pub fn rand<R>(rng: &mut R) -> T where
    R: Rng + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]