Struct snarkvm_fields::Fp2
source · [−]pub struct Fp2<P: Fp2Parameters> {
pub c0: P::Fp,
pub c1: P::Fp,
}
Fields
c0: P::Fp
c1: P::Fp
Implementations
sourceimpl<P: Fp2Parameters> Fp2<P>
impl<P: Fp2Parameters> Fp2<P>
Trait Implementations
sourceimpl<P: Fp2Parameters> Add<&'_ &'_ Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> Add<&'_ &'_ Fp2<P>> for Fp2<P>
sourceimpl<'a, P: Fp2Parameters> Add<&'a Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> Add<&'a Fp2<P>> for Fp2<P>
sourceimpl<'a, P: Fp2Parameters> Add<&'a mut Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> Add<&'a mut Fp2<P>> for Fp2<P>
sourceimpl<P: Fp2Parameters> Add<Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> Add<Fp2<P>> for Fp2<P>
sourceimpl<P: Fp2Parameters> AddAssign<&'_ &'_ Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> AddAssign<&'_ &'_ Fp2<P>> for Fp2<P>
sourcefn add_assign(&mut self, other: &&Self)
fn add_assign(&mut self, other: &&Self)
Performs the +=
operation. Read more
sourceimpl<'a, P: Fp2Parameters> AddAssign<&'a Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> AddAssign<&'a Fp2<P>> for Fp2<P>
sourcefn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
Performs the +=
operation. Read more
sourceimpl<'a, P: Fp2Parameters> AddAssign<&'a mut Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> AddAssign<&'a mut Fp2<P>> for Fp2<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: Fp2Parameters> AddAssign<Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> AddAssign<Fp2<P>> for Fp2<P>
sourcefn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the +=
operation. Read more
sourceimpl<P: Fp2Parameters> CanonicalDeserialize for Fp2<P>
impl<P: Fp2Parameters> CanonicalDeserialize for Fp2<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: Fp2Parameters> CanonicalDeserializeWithFlags for Fp2<P>
impl<P: Fp2Parameters> CanonicalDeserializeWithFlags for Fp2<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: Fp2Parameters> CanonicalSerialize for Fp2<P>
impl<P: Fp2Parameters> CanonicalSerialize for Fp2<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: Fp2Parameters> CanonicalSerializeWithFlags for Fp2<P>
impl<P: Fp2Parameters> CanonicalSerializeWithFlags for Fp2<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: Fp2Parameters> Clone for Fp2<P> where
P: Fp2Parameters,
impl<P: Fp2Parameters> Clone for Fp2<P> where
P: Fp2Parameters,
sourceimpl<P: Fp2Parameters> ConstantSerializedSize for Fp2<P>
impl<P: Fp2Parameters> ConstantSerializedSize for Fp2<P>
const SERIALIZED_SIZE: usize
const UNCOMPRESSED_SIZE: usize
sourceimpl<P: Fp2Parameters> Debug for Fp2<P> where
P: Fp2Parameters,
impl<P: Fp2Parameters> Debug for Fp2<P> where
P: Fp2Parameters,
sourceimpl<P: Fp2Parameters> Default for Fp2<P> where
P: Fp2Parameters,
impl<P: Fp2Parameters> Default for Fp2<P> where
P: Fp2Parameters,
sourceimpl<'de, P: Fp2Parameters> Deserialize<'de> for Fp2<P> where
P::Fp: Deserialize<'de>,
P::Fp: Deserialize<'de>,
impl<'de, P: Fp2Parameters> Deserialize<'de> for Fp2<P> where
P::Fp: Deserialize<'de>,
P::Fp: Deserialize<'de>,
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: Fp2Parameters> Display for Fp2<P>
impl<P: Fp2Parameters> Display for Fp2<P>
sourceimpl<P: Fp2Parameters> Distribution<Fp2<P>> for Standard
impl<P: Fp2Parameters> Distribution<Fp2<P>> for Standard
sourcefn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Fp2<P>
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Fp2<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: Fp2Parameters> Div<&'_ &'_ Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> Div<&'_ &'_ Fp2<P>> for Fp2<P>
sourceimpl<'a, P: Fp2Parameters> Div<&'a Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> Div<&'a Fp2<P>> for Fp2<P>
sourceimpl<'a, P: Fp2Parameters> Div<&'a mut Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> Div<&'a mut Fp2<P>> for Fp2<P>
sourceimpl<P: Fp2Parameters> Div<Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> Div<Fp2<P>> for Fp2<P>
sourceimpl<P: Fp2Parameters> DivAssign<&'_ &'_ Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> DivAssign<&'_ &'_ Fp2<P>> for Fp2<P>
sourcefn div_assign(&mut self, other: &&Self)
fn div_assign(&mut self, other: &&Self)
Performs the /=
operation. Read more
sourceimpl<'a, P: Fp2Parameters> DivAssign<&'a Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> DivAssign<&'a Fp2<P>> for Fp2<P>
sourcefn div_assign(&mut self, other: &Self)
fn div_assign(&mut self, other: &Self)
Performs the /=
operation. Read more
sourceimpl<'a, P: Fp2Parameters> DivAssign<&'a mut Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> DivAssign<&'a mut Fp2<P>> for Fp2<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: Fp2Parameters> DivAssign<Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> DivAssign<Fp2<P>> for Fp2<P>
sourcefn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the /=
operation. Read more
sourceimpl<P: Fp2Parameters> Field for Fp2<P>
impl<P: Fp2Parameters> Field for Fp2<P>
sourcefn characteristic<'a>() -> &'a [u64]
fn characteristic<'a>() -> &'a [u64]
Returns the characteristic of the field.
sourcefn double_in_place(&mut self)
fn double_in_place(&mut self)
Doubles self
in place.
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 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.
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
sourceimpl<P: Fp2Parameters> From<u128> for Fp2<P>
impl<P: Fp2Parameters> From<u128> for Fp2<P>
sourceimpl<P: Fp2Parameters> From<u16> for Fp2<P>
impl<P: Fp2Parameters> From<u16> for Fp2<P>
sourceimpl<P: Fp2Parameters> From<u32> for Fp2<P>
impl<P: Fp2Parameters> From<u32> for Fp2<P>
sourceimpl<P: Fp2Parameters> From<u64> for Fp2<P>
impl<P: Fp2Parameters> From<u64> for Fp2<P>
sourceimpl<P: Fp2Parameters> From<u8> for Fp2<P>
impl<P: Fp2Parameters> From<u8> for Fp2<P>
sourceimpl<P: Fp2Parameters> FromBytes for Fp2<P>
impl<P: Fp2Parameters> FromBytes for Fp2<P>
sourceimpl<P: Fp2Parameters> Hash for Fp2<P> where
P: Fp2Parameters,
impl<P: Fp2Parameters> Hash for Fp2<P> where
P: Fp2Parameters,
sourceimpl<P: Fp2Parameters> Mul<&'_ &'_ Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> Mul<&'_ &'_ Fp2<P>> for Fp2<P>
sourceimpl<'a, P: Fp2Parameters> Mul<&'a Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> Mul<&'a Fp2<P>> for Fp2<P>
sourceimpl<'a, P: Fp2Parameters> Mul<&'a mut Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> Mul<&'a mut Fp2<P>> for Fp2<P>
sourceimpl<P: Fp2Parameters> Mul<Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> Mul<Fp2<P>> for Fp2<P>
sourceimpl<P: Fp2Parameters> MulAssign<&'_ &'_ Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> MulAssign<&'_ &'_ Fp2<P>> for Fp2<P>
sourcefn mul_assign(&mut self, other: &&Self)
fn mul_assign(&mut self, other: &&Self)
Performs the *=
operation. Read more
sourceimpl<'a, P: Fp2Parameters> MulAssign<&'a Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> MulAssign<&'a Fp2<P>> for Fp2<P>
sourcefn mul_assign(&mut self, other: &Self)
fn mul_assign(&mut self, other: &Self)
Performs the *=
operation. Read more
sourceimpl<'a, P: Fp2Parameters> MulAssign<&'a mut Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> MulAssign<&'a mut Fp2<P>> for Fp2<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: Fp2Parameters> MulAssign<Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> MulAssign<Fp2<P>> for Fp2<P>
sourcefn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the *=
operation. Read more
sourceimpl<P: Fp2Parameters> Neg for Fp2<P>
impl<P: Fp2Parameters> Neg for Fp2<P>
sourceimpl<P: Fp2Parameters> Ord for Fp2<P>
impl<P: Fp2Parameters> Ord for Fp2<P>
Fp2
elements are ordered lexicographically.
sourceimpl<P: Fp2Parameters> PartialEq<Fp2<P>> for Fp2<P> where
P: Fp2Parameters,
impl<P: Fp2Parameters> PartialEq<Fp2<P>> for Fp2<P> where
P: Fp2Parameters,
sourceimpl<P: Fp2Parameters> PartialOrd<Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> PartialOrd<Fp2<P>> for Fp2<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: Fp2Parameters> Product<&'a Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> Product<&'a Fp2<P>> for Fp2<P>
sourceimpl<P: Fp2Parameters> Product<Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> Product<Fp2<P>> for Fp2<P>
sourceimpl<'a, P: Fp2Parameters> SquareRootField for Fp2<P> where
P::Fp: SquareRootField,
impl<'a, P: Fp2Parameters> SquareRootField for Fp2<P> where
P::Fp: SquareRootField,
sourcefn legendre(&self) -> LegendreSymbol
fn legendre(&self) -> LegendreSymbol
Returns the Legendre symbol.
sourcefn sqrt_in_place(&mut self) -> Option<&mut Self>
fn sqrt_in_place(&mut self) -> Option<&mut Self>
Sets self
to be the square root of self
, if it exists.
sourceimpl<P: Fp2Parameters> Sub<&'_ &'_ Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> Sub<&'_ &'_ Fp2<P>> for Fp2<P>
sourceimpl<'a, P: Fp2Parameters> Sub<&'a Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> Sub<&'a Fp2<P>> for Fp2<P>
sourceimpl<'a, P: Fp2Parameters> Sub<&'a mut Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> Sub<&'a mut Fp2<P>> for Fp2<P>
sourceimpl<P: Fp2Parameters> Sub<Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> Sub<Fp2<P>> for Fp2<P>
sourceimpl<P: Fp2Parameters> SubAssign<&'_ &'_ Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> SubAssign<&'_ &'_ Fp2<P>> for Fp2<P>
sourcefn sub_assign(&mut self, other: &&Self)
fn sub_assign(&mut self, other: &&Self)
Performs the -=
operation. Read more
sourceimpl<'a, P: Fp2Parameters> SubAssign<&'a Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> SubAssign<&'a Fp2<P>> for Fp2<P>
sourcefn sub_assign(&mut self, other: &Self)
fn sub_assign(&mut self, other: &Self)
Performs the -=
operation. Read more
sourceimpl<'a, P: Fp2Parameters> SubAssign<&'a mut Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> SubAssign<&'a mut Fp2<P>> for Fp2<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: Fp2Parameters> SubAssign<Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> SubAssign<Fp2<P>> for Fp2<P>
sourcefn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the -=
operation. Read more
sourceimpl<'a, P: Fp2Parameters> Sum<&'a Fp2<P>> for Fp2<P>
impl<'a, P: Fp2Parameters> Sum<&'a Fp2<P>> for Fp2<P>
sourceimpl<P: Fp2Parameters> Sum<Fp2<P>> for Fp2<P>
impl<P: Fp2Parameters> Sum<Fp2<P>> for Fp2<P>
sourceimpl<P: Fp2Parameters> ToBits for Fp2<P>
impl<P: Fp2Parameters> ToBits for Fp2<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: Fp2Parameters> ToBytes for Fp2<P>
impl<P: Fp2Parameters> ToBytes for Fp2<P>
sourceimpl<P: Fp2Parameters> ToConstraintField<<P as Fp2Parameters>::Fp> for Fp2<P>
impl<P: Fp2Parameters> ToConstraintField<<P as Fp2Parameters>::Fp> for Fp2<P>
fn to_field_elements(&self) -> Result<Vec<P::Fp>, ConstraintFieldError>
impl<P: Fp2Parameters> Copy for Fp2<P> where
P: Fp2Parameters,
impl<P: Fp2Parameters> Eq for Fp2<P> where
P: Fp2Parameters,
Auto Trait Implementations
impl<P> RefUnwindSafe for Fp2<P> where
<P as Fp2Parameters>::Fp: RefUnwindSafe,
impl<P> Send for Fp2<P>
impl<P> Sync for Fp2<P>
impl<P> Unpin for Fp2<P> where
<P as Fp2Parameters>::Fp: Unpin,
impl<P> UnwindSafe for Fp2<P> where
<P 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