Struct snarkvm_fields::Fp12
source · [−]pub struct Fp12<P: Fp12Parameters> {
pub c0: Fp6<P::Fp6Params>,
pub c1: Fp6<P::Fp6Params>,
}
Expand description
An element of Fp12, represented by c0 + c1 * v
Fields
c0: Fp6<P::Fp6Params>
c1: Fp6<P::Fp6Params>
Implementations
sourceimpl<P: Fp12Parameters> Fp12<P>
impl<P: Fp12Parameters> Fp12<P>
pub fn new(c0: Fp6<P::Fp6Params>, c1: Fp6<P::Fp6Params>) -> Self
pub fn mul_by_fp(
&mut self,
element: &<<P::Fp6Params as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp
)
pub fn conjugate(&mut self)
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>
)
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>
)
pub fn cyclotomic_square(&self) -> Self
pub fn cyclotomic_exp<S: AsRef<[u64]>>(&self, exp: S) -> Self
Trait Implementations
sourceimpl<P: Fp12Parameters> Add<&'_ &'_ Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> Add<&'_ &'_ Fp12<P>> for Fp12<P>
sourceimpl<'a, P: Fp12Parameters> Add<&'a Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> Add<&'a Fp12<P>> for Fp12<P>
sourceimpl<'a, P: Fp12Parameters> Add<&'a mut Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> Add<&'a mut Fp12<P>> for Fp12<P>
sourceimpl<P: Fp12Parameters> Add<Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> Add<Fp12<P>> for Fp12<P>
sourceimpl<P: Fp12Parameters> AddAssign<&'_ &'_ Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> AddAssign<&'_ &'_ Fp12<P>> for Fp12<P>
sourcefn add_assign(&mut self, other: &&Self)
fn add_assign(&mut self, other: &&Self)
Performs the +=
operation. Read more
sourceimpl<'a, P: Fp12Parameters> AddAssign<&'a Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> AddAssign<&'a Fp12<P>> for Fp12<P>
sourcefn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
Performs the +=
operation. Read more
sourceimpl<'a, P: Fp12Parameters> AddAssign<&'a mut Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> AddAssign<&'a mut Fp12<P>> for Fp12<P>
sourcefn add_assign(&mut self, other: &'a mut Self)
fn add_assign(&mut self, other: &'a mut Self)
Performs the +=
operation. Read more
sourceimpl<P: Fp12Parameters> AddAssign<Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> AddAssign<Fp12<P>> for Fp12<P>
sourcefn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the +=
operation. Read more
sourceimpl<P: Fp12Parameters> CanonicalDeserialize for Fp12<P>
impl<P: Fp12Parameters> CanonicalDeserialize for Fp12<P>
sourcefn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
fn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
Reads Self
from reader
.
sourcefn deserialize_uncompressed<R>(
reader: &mut R
) -> Result<Self, SerializationError> where
R: Read,
fn deserialize_uncompressed<R>(
reader: &mut R
) -> Result<Self, SerializationError> where
R: Read,
Reads Self
from reader
without compression.
sourceimpl<P: Fp12Parameters> CanonicalDeserializeWithFlags for Fp12<P>
impl<P: Fp12Parameters> CanonicalDeserializeWithFlags for Fp12<P>
sourcefn deserialize_with_flags<R: Read, F: Flags>(
reader: &mut R
) -> Result<(Self, F), SerializationError>
fn deserialize_with_flags<R: Read, F: Flags>(
reader: &mut R
) -> Result<(Self, F), SerializationError>
Reads Self
and Flags
from reader
.
Returns empty flags by default. Read more
sourceimpl<P: Fp12Parameters> CanonicalSerialize for Fp12<P>
impl<P: Fp12Parameters> CanonicalSerialize for Fp12<P>
sourcefn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
Serializes self
into writer
.
fn serialized_size(&self) -> usize
sourcefn serialize_uncompressed<W>(
&self,
writer: &mut W
) -> Result<(), SerializationError> where
W: Write,
fn serialize_uncompressed<W>(
&self,
writer: &mut W
) -> Result<(), SerializationError> where
W: Write,
Serializes self
into writer
without compression.
fn uncompressed_size(&self) -> usize
sourceimpl<P: Fp12Parameters> CanonicalSerializeWithFlags for Fp12<P>
impl<P: Fp12Parameters> CanonicalSerializeWithFlags for Fp12<P>
sourcefn serialize_with_flags<W: Write, F: Flags>(
&self,
writer: &mut W,
flags: F
) -> Result<(), SerializationError>
fn serialize_with_flags<W: Write, F: Flags>(
&self,
writer: &mut W,
flags: F
) -> Result<(), SerializationError>
Serializes self
and flags
into writer
.
sourceimpl<P: Fp12Parameters> Clone for Fp12<P> where
P: Fp12Parameters,
impl<P: Fp12Parameters> Clone for Fp12<P> where
P: Fp12Parameters,
sourceimpl<P: Fp12Parameters> ConstantSerializedSize for Fp12<P>
impl<P: Fp12Parameters> ConstantSerializedSize for Fp12<P>
const SERIALIZED_SIZE: usize
const UNCOMPRESSED_SIZE: usize
sourceimpl<P: Fp12Parameters> Debug for Fp12<P> where
P: Fp12Parameters,
impl<P: Fp12Parameters> Debug for Fp12<P> where
P: Fp12Parameters,
sourceimpl<P: Fp12Parameters> Default for Fp12<P> where
P: Fp12Parameters,
impl<P: Fp12Parameters> Default for Fp12<P> where
P: Fp12Parameters,
sourceimpl<'de, P: Fp12Parameters> Deserialize<'de> for Fp12<P>
impl<'de, P: Fp12Parameters> Deserialize<'de> for Fp12<P>
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<P: Fp12Parameters> Display for Fp12<P>
impl<P: Fp12Parameters> Display for Fp12<P>
sourceimpl<P: Fp12Parameters> Distribution<Fp12<P>> for Standard
impl<P: Fp12Parameters> Distribution<Fp12<P>> for Standard
sourcefn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Fp12<P>
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Fp12<P>
Generate a random value of T
, using rng
as the source of randomness.
sourcefn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
sourceimpl<P: Fp12Parameters> Div<&'_ &'_ Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> Div<&'_ &'_ Fp12<P>> for Fp12<P>
sourceimpl<'a, P: Fp12Parameters> Div<&'a Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> Div<&'a Fp12<P>> for Fp12<P>
sourceimpl<'a, P: Fp12Parameters> Div<&'a mut Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> Div<&'a mut Fp12<P>> for Fp12<P>
sourceimpl<P: Fp12Parameters> Div<Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> Div<Fp12<P>> for Fp12<P>
sourceimpl<P: Fp12Parameters> DivAssign<&'_ &'_ Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> DivAssign<&'_ &'_ Fp12<P>> for Fp12<P>
sourcefn div_assign(&mut self, other: &&Self)
fn div_assign(&mut self, other: &&Self)
Performs the /=
operation. Read more
sourceimpl<'a, P: Fp12Parameters> DivAssign<&'a Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> DivAssign<&'a Fp12<P>> for Fp12<P>
sourcefn div_assign(&mut self, other: &Self)
fn div_assign(&mut self, other: &Self)
Performs the /=
operation. Read more
sourceimpl<'a, P: Fp12Parameters> DivAssign<&'a mut Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> DivAssign<&'a mut Fp12<P>> for Fp12<P>
sourcefn div_assign(&mut self, other: &'a mut Self)
fn div_assign(&mut self, other: &'a mut Self)
Performs the /=
operation. Read more
sourceimpl<P: Fp12Parameters> DivAssign<Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> DivAssign<Fp12<P>> for Fp12<P>
sourcefn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the /=
operation. Read more
sourceimpl<P: Fp12Parameters> Field for Fp12<P>
impl<P: Fp12Parameters> Field for Fp12<P>
sourcefn characteristic<'a>() -> &'a [u64]
fn characteristic<'a>() -> &'a [u64]
Returns the characteristic of the field.
sourcefn from_random_bytes_with_flags<F: Flags>(bytes: &[u8]) -> Option<(Self, F)>
fn from_random_bytes_with_flags<F: Flags>(bytes: &[u8]) -> Option<(Self, F)>
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
sourcefn from_random_bytes(bytes: &[u8]) -> Option<Self>
fn from_random_bytes(bytes: &[u8]) -> Option<Self>
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
sourcefn double_in_place(&mut self)
fn double_in_place(&mut self)
Doubles self
in place.
sourcefn frobenius_map(&mut self, power: usize)
fn frobenius_map(&mut self, power: usize)
Exponentiates this element by a power of the base prime modulus via the Frobenius automorphism. Read more
sourcefn square_in_place(&mut self) -> &mut Self
fn square_in_place(&mut self) -> &mut Self
Squares self
in place.
sourcefn inverse(&self) -> Option<Self>
fn inverse(&self) -> Option<Self>
Computes the multiplicative inverse of self
if self
is nonzero.
sourcefn inverse_in_place(&mut self) -> Option<&mut Self>
fn inverse_in_place(&mut self) -> Option<&mut Self>
Sets self
to self
’s inverse if it exists. Otherwise it is a no-op.
sourceimpl<P: Fp12Parameters> From<u128> for Fp12<P>
impl<P: Fp12Parameters> From<u128> for Fp12<P>
sourceimpl<P: Fp12Parameters> From<u16> for Fp12<P>
impl<P: Fp12Parameters> From<u16> for Fp12<P>
sourceimpl<P: Fp12Parameters> From<u32> for Fp12<P>
impl<P: Fp12Parameters> From<u32> for Fp12<P>
sourceimpl<P: Fp12Parameters> From<u64> for Fp12<P>
impl<P: Fp12Parameters> From<u64> for Fp12<P>
sourceimpl<P: Fp12Parameters> From<u8> for Fp12<P>
impl<P: Fp12Parameters> From<u8> for Fp12<P>
sourceimpl<P: Fp12Parameters> FromBytes for Fp12<P>
impl<P: Fp12Parameters> FromBytes for Fp12<P>
sourceimpl<P: Fp12Parameters> Hash for Fp12<P> where
P: Fp12Parameters,
impl<P: Fp12Parameters> Hash for Fp12<P> where
P: Fp12Parameters,
sourceimpl<P: Fp12Parameters> Mul<&'_ &'_ Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> Mul<&'_ &'_ Fp12<P>> for Fp12<P>
sourceimpl<'a, P: Fp12Parameters> Mul<&'a Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> Mul<&'a Fp12<P>> for Fp12<P>
sourceimpl<'a, P: Fp12Parameters> Mul<&'a mut Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> Mul<&'a mut Fp12<P>> for Fp12<P>
sourceimpl<P: Fp12Parameters> Mul<Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> Mul<Fp12<P>> for Fp12<P>
sourceimpl<P: Fp12Parameters> MulAssign<&'_ &'_ Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> MulAssign<&'_ &'_ Fp12<P>> for Fp12<P>
sourcefn mul_assign(&mut self, other: &&Self)
fn mul_assign(&mut self, other: &&Self)
Performs the *=
operation. Read more
sourceimpl<'a, P: Fp12Parameters> MulAssign<&'a Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> MulAssign<&'a Fp12<P>> for Fp12<P>
sourcefn mul_assign(&mut self, other: &Self)
fn mul_assign(&mut self, other: &Self)
Performs the *=
operation. Read more
sourceimpl<'a, P: Fp12Parameters> MulAssign<&'a mut Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> MulAssign<&'a mut Fp12<P>> for Fp12<P>
sourcefn mul_assign(&mut self, other: &'a mut Self)
fn mul_assign(&mut self, other: &'a mut Self)
Performs the *=
operation. Read more
sourceimpl<P: Fp12Parameters> MulAssign<Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> MulAssign<Fp12<P>> for Fp12<P>
sourcefn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the *=
operation. Read more
sourceimpl<P: Fp12Parameters> Neg for Fp12<P>
impl<P: Fp12Parameters> Neg for Fp12<P>
sourceimpl<P: Fp12Parameters> Ord for Fp12<P>
impl<P: Fp12Parameters> Ord for Fp12<P>
sourceimpl<P: Fp12Parameters> PartialEq<Fp12<P>> for Fp12<P> where
P: Fp12Parameters,
impl<P: Fp12Parameters> PartialEq<Fp12<P>> for Fp12<P> where
P: Fp12Parameters,
sourceimpl<P: Fp12Parameters> PartialOrd<Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> PartialOrd<Fp12<P>> for Fp12<P>
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<'a, P: Fp12Parameters> Product<&'a Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> Product<&'a Fp12<P>> for Fp12<P>
sourceimpl<P: Fp12Parameters> Product<Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> Product<Fp12<P>> for Fp12<P>
sourceimpl<P: Fp12Parameters> Serialize for Fp12<P>
impl<P: Fp12Parameters> Serialize for Fp12<P>
sourceimpl<P: Fp12Parameters> Sub<&'_ &'_ Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> Sub<&'_ &'_ Fp12<P>> for Fp12<P>
sourceimpl<'a, P: Fp12Parameters> Sub<&'a Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> Sub<&'a Fp12<P>> for Fp12<P>
sourceimpl<'a, P: Fp12Parameters> Sub<&'a mut Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> Sub<&'a mut Fp12<P>> for Fp12<P>
sourceimpl<P: Fp12Parameters> Sub<Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> Sub<Fp12<P>> for Fp12<P>
sourceimpl<P: Fp12Parameters> SubAssign<&'_ &'_ Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> SubAssign<&'_ &'_ Fp12<P>> for Fp12<P>
sourcefn sub_assign(&mut self, other: &&Self)
fn sub_assign(&mut self, other: &&Self)
Performs the -=
operation. Read more
sourceimpl<'a, P: Fp12Parameters> SubAssign<&'a Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> SubAssign<&'a Fp12<P>> for Fp12<P>
sourcefn sub_assign(&mut self, other: &Self)
fn sub_assign(&mut self, other: &Self)
Performs the -=
operation. Read more
sourceimpl<'a, P: Fp12Parameters> SubAssign<&'a mut Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> SubAssign<&'a mut Fp12<P>> for Fp12<P>
sourcefn sub_assign(&mut self, other: &'a mut Self)
fn sub_assign(&mut self, other: &'a mut Self)
Performs the -=
operation. Read more
sourceimpl<P: Fp12Parameters> SubAssign<Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> SubAssign<Fp12<P>> for Fp12<P>
sourcefn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the -=
operation. Read more
sourceimpl<'a, P: Fp12Parameters> Sum<&'a Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> Sum<&'a Fp12<P>> for Fp12<P>
sourceimpl<P: Fp12Parameters> Sum<Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> Sum<Fp12<P>> for Fp12<P>
sourceimpl<P: Fp12Parameters> ToBits for Fp12<P>
impl<P: Fp12Parameters> ToBits for Fp12<P>
sourcefn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns self
as a boolean array in little-endian order.
sourcefn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns self
as a boolean array in big-endian order.
sourceimpl<P: Fp12Parameters> ToBytes for Fp12<P>
impl<P: Fp12Parameters> ToBytes for Fp12<P>
sourceimpl<P: Fp12Parameters> Zero for Fp12<P>
impl<P: Fp12Parameters> Zero for Fp12<P>
impl<P: Fp12Parameters> Copy for Fp12<P> where
P: Fp12Parameters,
impl<P: Fp12Parameters> Eq for Fp12<P> where
P: Fp12Parameters,
Auto Trait Implementations
impl<P> RefUnwindSafe for Fp12<P> where
<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp: RefUnwindSafe,
impl<P> Send for Fp12<P>
impl<P> Sync for Fp12<P>
impl<P> Unpin for Fp12<P> where
<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp: Unpin,
impl<P> UnwindSafe for Fp12<P> where
<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more