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§
Source§impl<P: Fp12Parameters> Fp12<P>
impl<P: Fp12Parameters> Fp12<P>
Source§impl<P: Fp12Parameters> Fp12<P>
impl<P: Fp12Parameters> Fp12<P>
pub fn conjugate(&mut self)
pub fn mul_by_fp( &mut self, element: &<<P::Fp6Params as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp, )
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§
Source§impl<P: Fp12Parameters> Add for Fp12<P>
impl<P: Fp12Parameters> Add for Fp12<P>
Source§impl<P: Fp12Parameters> AddAssign<&&Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> AddAssign<&&Fp12<P>> for Fp12<P>
Source§fn add_assign(&mut self, other: &&Self)
fn add_assign(&mut self, other: &&Self)
Performs the
+=
operation. Read moreSource§impl<'a, P: Fp12Parameters> AddAssign<&'a Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> AddAssign<&'a Fp12<P>> for Fp12<P>
Source§fn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
Performs the
+=
operation. Read moreSource§impl<'a, P: Fp12Parameters> AddAssign<&'a mut Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> AddAssign<&'a mut Fp12<P>> for Fp12<P>
Source§fn add_assign(&mut self, other: &'a mut Self)
fn add_assign(&mut self, other: &'a mut Self)
Performs the
+=
operation. Read moreSource§impl<P: Fp12Parameters> AddAssign for Fp12<P>
impl<P: Fp12Parameters> AddAssign for Fp12<P>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moreSource§impl<P: Fp12Parameters> CanonicalDeserialize for Fp12<P>
impl<P: Fp12Parameters> CanonicalDeserialize for Fp12<P>
fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>
fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_compressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
Source§impl<P: Fp12Parameters> CanonicalDeserializeWithFlags for Fp12<P>
impl<P: Fp12Parameters> CanonicalDeserializeWithFlags for Fp12<P>
Source§fn deserialize_with_flags<R: Read, F: Flags>(
reader: R,
) -> Result<(Self, F), SerializationError>
fn deserialize_with_flags<R: Read, F: Flags>( reader: R, ) -> Result<(Self, F), SerializationError>
Reads
Self
and Flags
from reader
.
Returns empty flags by default.Source§impl<P: Fp12Parameters> CanonicalSerialize for Fp12<P>
impl<P: Fp12Parameters> CanonicalSerialize for Fp12<P>
fn serialize_with_mode<W: Write>( &self, writer: W, _compress: Compress, ) -> Result<(), SerializationError>
fn serialized_size(&self, compress: Compress) -> usize
fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn compressed_size(&self) -> usize
fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn uncompressed_size(&self) -> usize
Source§impl<P: Fp12Parameters> CanonicalSerializeWithFlags for Fp12<P>
impl<P: Fp12Parameters> CanonicalSerializeWithFlags for Fp12<P>
Source§fn serialize_with_flags<W: Write, F: Flags>(
&self,
writer: W,
flags: F,
) -> Result<(), SerializationError>
fn serialize_with_flags<W: Write, F: Flags>( &self, writer: W, flags: F, ) -> Result<(), SerializationError>
Serializes
self
and flags
into writer
.Source§fn serialized_size_with_flags<F: Flags>(&self) -> usize
fn serialized_size_with_flags<F: Flags>(&self) -> usize
Serializes
self
and flags
into writer
.Source§impl<'de, P: Fp12Parameters> Deserialize<'de> for Fp12<P>
impl<'de, P: Fp12Parameters> Deserialize<'de> for Fp12<P>
Source§fn 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
Source§impl<P: Fp12Parameters> Display for Fp12<P>
impl<P: Fp12Parameters> Display for Fp12<P>
Source§impl<P: Fp12Parameters> Distribution<Fp12<P>> for Standard
impl<P: Fp12Parameters> Distribution<Fp12<P>> for Standard
Source§impl<P: Fp12Parameters> Div for Fp12<P>
impl<P: Fp12Parameters> Div for Fp12<P>
Source§impl<P: Fp12Parameters> DivAssign<&&Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> DivAssign<&&Fp12<P>> for Fp12<P>
Source§fn div_assign(&mut self, other: &&Self)
fn div_assign(&mut self, other: &&Self)
Performs the
/=
operation. Read moreSource§impl<'a, P: Fp12Parameters> DivAssign<&'a Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> DivAssign<&'a Fp12<P>> for Fp12<P>
Source§fn div_assign(&mut self, other: &Self)
fn div_assign(&mut self, other: &Self)
Performs the
/=
operation. Read moreSource§impl<'a, P: Fp12Parameters> DivAssign<&'a mut Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> DivAssign<&'a mut Fp12<P>> for Fp12<P>
Source§fn div_assign(&mut self, other: &'a mut Self)
fn div_assign(&mut self, other: &'a mut Self)
Performs the
/=
operation. Read moreSource§impl<P: Fp12Parameters> DivAssign for Fp12<P>
impl<P: Fp12Parameters> DivAssign for Fp12<P>
Source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the
/=
operation. Read moreSource§impl<P: Fp12Parameters> Field for Fp12<P>
impl<P: Fp12Parameters> Field for Fp12<P>
type BasePrimeField = <Fp6<<P as Fp12Parameters>::Fp6Params> as Field>::BasePrimeField
Source§fn from_base_prime_field(other: Self::BasePrimeField) -> Self
fn from_base_prime_field(other: Self::BasePrimeField) -> Self
Constructs an element of
Self
from an element of the base
prime field.Source§fn characteristic<'a>() -> &'a [u64]
fn characteristic<'a>() -> &'a [u64]
Returns the characteristic of the field.
Source§fn 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.
Source§fn 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.
Source§fn double_in_place(&mut self)
fn double_in_place(&mut self)
Doubles
self
in place.Source§fn 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.
Source§fn square_in_place(&mut self) -> &mut Self
fn square_in_place(&mut self) -> &mut Self
Squares
self
in place.Source§fn inverse(&self) -> Option<Self>
fn inverse(&self) -> Option<Self>
Computes the multiplicative inverse of
self
if self
is nonzero.Source§fn 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.fn sum_of_products<'a>( a: impl Iterator<Item = &'a Self> + Clone, b: impl Iterator<Item = &'a Self> + Clone, ) -> Self
Source§impl<P: Fp12Parameters> FromBytes for Fp12<P>
impl<P: Fp12Parameters> FromBytes for Fp12<P>
Source§impl<P: Fp12Parameters> Mul for Fp12<P>
impl<P: Fp12Parameters> Mul for Fp12<P>
Source§impl<P: Fp12Parameters> MulAssign<&&Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> MulAssign<&&Fp12<P>> for Fp12<P>
Source§fn mul_assign(&mut self, other: &&Self)
fn mul_assign(&mut self, other: &&Self)
Performs the
*=
operation. Read moreSource§impl<'a, P: Fp12Parameters> MulAssign<&'a Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> MulAssign<&'a Fp12<P>> for Fp12<P>
Source§fn mul_assign(&mut self, other: &Self)
fn mul_assign(&mut self, other: &Self)
Performs the
*=
operation. Read moreSource§impl<'a, P: Fp12Parameters> MulAssign<&'a mut Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> MulAssign<&'a mut Fp12<P>> for Fp12<P>
Source§fn mul_assign(&mut self, other: &'a mut Self)
fn mul_assign(&mut self, other: &'a mut Self)
Performs the
*=
operation. Read moreSource§impl<P: Fp12Parameters> MulAssign for Fp12<P>
impl<P: Fp12Parameters> MulAssign for Fp12<P>
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*=
operation. Read moreSource§impl<P: Fp12Parameters> Neg for Fp12<P>
impl<P: Fp12Parameters> Neg for Fp12<P>
Source§impl<P: Fp12Parameters> One for Fp12<P>
impl<P: Fp12Parameters> One for Fp12<P>
Source§impl<P: Fp12Parameters> Ord for Fp12<P>
impl<P: Fp12Parameters> Ord for Fp12<P>
Source§impl<P: Fp12Parameters> PartialOrd for Fp12<P>
impl<P: Fp12Parameters> PartialOrd for Fp12<P>
Source§impl<P: Fp12Parameters> Product for Fp12<P>
impl<P: Fp12Parameters> Product for Fp12<P>
Source§impl<P: Fp12Parameters> Serialize for Fp12<P>
impl<P: Fp12Parameters> Serialize for Fp12<P>
Source§impl<P: Fp12Parameters> Sub for Fp12<P>
impl<P: Fp12Parameters> Sub for Fp12<P>
Source§impl<P: Fp12Parameters> SubAssign<&&Fp12<P>> for Fp12<P>
impl<P: Fp12Parameters> SubAssign<&&Fp12<P>> for Fp12<P>
Source§fn sub_assign(&mut self, other: &&Self)
fn sub_assign(&mut self, other: &&Self)
Performs the
-=
operation. Read moreSource§impl<'a, P: Fp12Parameters> SubAssign<&'a Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> SubAssign<&'a Fp12<P>> for Fp12<P>
Source§fn sub_assign(&mut self, other: &Self)
fn sub_assign(&mut self, other: &Self)
Performs the
-=
operation. Read moreSource§impl<'a, P: Fp12Parameters> SubAssign<&'a mut Fp12<P>> for Fp12<P>
impl<'a, P: Fp12Parameters> SubAssign<&'a mut Fp12<P>> for Fp12<P>
Source§fn sub_assign(&mut self, other: &'a mut Self)
fn sub_assign(&mut self, other: &'a mut Self)
Performs the
-=
operation. Read moreSource§impl<P: Fp12Parameters> SubAssign for Fp12<P>
impl<P: Fp12Parameters> SubAssign for Fp12<P>
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moreSource§impl<P: Fp12Parameters> Sum for Fp12<P>
impl<P: Fp12Parameters> Sum for Fp12<P>
Source§impl<P: Fp12Parameters> ToBits for Fp12<P>
impl<P: Fp12Parameters> ToBits for Fp12<P>
Source§fn write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
Writes
self
into the given vector as a boolean array in little-endian order.Source§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
Writes
self
into the given vector as a boolean array in big-endian order.Source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Returns
self
as a boolean array in little-endian order.Source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Returns
self
as a boolean array in big-endian order.Source§impl<P: Fp12Parameters> ToBytes for Fp12<P>
impl<P: Fp12Parameters> ToBytes for Fp12<P>
Source§impl<P: Fp12Parameters> Valid for Fp12<P>
impl<P: Fp12Parameters> Valid for Fp12<P>
fn check(&self) -> Result<(), SerializationError>
fn batch_check<'a>(
_batch: impl Iterator<Item = &'a Self>,
) -> Result<(), SerializationError>where
Self: 'a,
Source§impl<P: Fp12Parameters> Zero for Fp12<P>
impl<P: Fp12Parameters> Zero for Fp12<P>
impl<P: Copy + Fp12Parameters> Copy for Fp12<P>
impl<P: Eq + Fp12Parameters> Eq for Fp12<P>
impl<P: Fp12Parameters> StructuralPartialEq for Fp12<P>
Auto Trait Implementations§
impl<P> Freeze for Fp12<P>where
<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp: Freeze,
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>
impl<P> UnwindSafe for Fp12<P>where
<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
fn take_from_value<D>(
value: &mut Value,
field: &str,
) -> Result<T, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more