Struct snarkvm_fields::Fp384
source · pub struct Fp384<P: Fp384Parameters>(pub BigInteger, _);
Tuple Fields§
§0: BigInteger
Implementations§
Trait Implementations§
source§impl<P: Fp384Parameters> AddAssign<&&Fp384<P>> for Fp384<P>
impl<P: Fp384Parameters> AddAssign<&&Fp384<P>> for Fp384<P>
source§fn add_assign(&mut self, other: &&Self)
fn add_assign(&mut self, other: &&Self)
Performs the
+=
operation. Read moresource§impl<'a, P: Fp384Parameters> AddAssign<&'a Fp384<P>> for Fp384<P>
impl<'a, P: Fp384Parameters> AddAssign<&'a Fp384<P>> for Fp384<P>
source§fn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
Performs the
+=
operation. Read moresource§impl<'a, P: Fp384Parameters> AddAssign<&'a mut Fp384<P>> for Fp384<P>
impl<'a, P: Fp384Parameters> AddAssign<&'a mut Fp384<P>> for Fp384<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: Fp384Parameters> AddAssign<Fp384<P>> for Fp384<P>
impl<P: Fp384Parameters> AddAssign<Fp384<P>> for Fp384<P>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moresource§impl<P: Fp384Parameters> CanonicalDeserialize for Fp384<P>
impl<P: Fp384Parameters> CanonicalDeserialize for Fp384<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: Fp384Parameters> CanonicalDeserializeWithFlags for Fp384<P>
impl<P: Fp384Parameters> CanonicalDeserializeWithFlags for Fp384<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: Fp384Parameters> CanonicalSerialize for Fp384<P>
impl<P: Fp384Parameters> CanonicalSerialize for Fp384<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: Fp384Parameters> CanonicalSerializeWithFlags for Fp384<P>
impl<P: Fp384Parameters> CanonicalSerializeWithFlags for Fp384<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<P> Clone for Fp384<P>where
P: Fp384Parameters,
impl<P> Clone for Fp384<P>where
P: Fp384Parameters,
source§impl<P: Fp384Parameters> Debug for Fp384<P>
impl<P: Fp384Parameters> Debug for Fp384<P>
source§impl<P> Default for Fp384<P>where
P: Fp384Parameters,
impl<P> Default for Fp384<P>where
P: Fp384Parameters,
source§impl<'de, P: Fp384Parameters> Deserialize<'de> for Fp384<P>
impl<'de, P: Fp384Parameters> Deserialize<'de> for Fp384<P>
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl<P: Fp384Parameters> Display for Fp384<P>
impl<P: Fp384Parameters> Display for Fp384<P>
source§impl<P: Fp384Parameters> Distribution<Fp384<P>> for Standard
impl<P: Fp384Parameters> Distribution<Fp384<P>> for Standard
source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Fp384<P>
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Fp384<P>
Generate a random value of
T
, using rng
as the source of randomness.source§impl<P: Fp384Parameters> DivAssign<&&Fp384<P>> for Fp384<P>
impl<P: Fp384Parameters> DivAssign<&&Fp384<P>> for Fp384<P>
source§fn div_assign(&mut self, other: &&Self)
fn div_assign(&mut self, other: &&Self)
Performs the
/=
operation. Read moresource§impl<'a, P: Fp384Parameters> DivAssign<&'a Fp384<P>> for Fp384<P>
impl<'a, P: Fp384Parameters> DivAssign<&'a Fp384<P>> for Fp384<P>
source§fn div_assign(&mut self, other: &Self)
fn div_assign(&mut self, other: &Self)
Performs the
/=
operation. Read moresource§impl<'a, P: Fp384Parameters> DivAssign<&'a mut Fp384<P>> for Fp384<P>
impl<'a, P: Fp384Parameters> DivAssign<&'a mut Fp384<P>> for Fp384<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: Fp384Parameters> DivAssign<Fp384<P>> for Fp384<P>
impl<P: Fp384Parameters> DivAssign<Fp384<P>> for Fp384<P>
source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the
/=
operation. Read moresource§impl<P: Fp384Parameters> FftField for Fp384<P>
impl<P: Fp384Parameters> FftField for Fp384<P>
type FftParameters = P
source§fn two_adic_root_of_unity() -> Self
fn two_adic_root_of_unity() -> Self
Returns the 2^s root of unity.
source§fn large_subgroup_root_of_unity() -> Option<Self>
fn large_subgroup_root_of_unity() -> Option<Self>
Returns the 2^s * small_subgroup_base^small_subgroup_base_adicity root of unity
if a small subgroup is defined.
source§fn multiplicative_generator() -> Self
fn multiplicative_generator() -> Self
Returns the multiplicative generator of
char()
- 1 order.source§fn get_root_of_unity(n: usize) -> Option<Self>
fn get_root_of_unity(n: usize) -> Option<Self>
Returns the root of unity of order n, if one exists.
If no small multiplicative subgroup is defined, this is the 2-adic root of unity of order n
(for n a power of 2).
If a small multiplicative subgroup is defined, this is the root of unity of order n for
the larger subgroup generated by
FftParams::LARGE_SUBGROUP_ROOT_OF_UNITY
(for n = 2^i * FftParams::SMALL_SUBGROUP_BASE^j for some i, j).source§impl<P: Fp384Parameters> Field for Fp384<P>
impl<P: Fp384Parameters> Field for Fp384<P>
type BasePrimeField = Fp384<P>
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_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.fn sum_of_products<'a>(
a: impl Iterator<Item = &'a Self> + Clone,
b: impl Iterator<Item = &'a Self> + Clone
) -> Self
source§fn double_in_place(&mut self)
fn double_in_place(&mut self)
Doubles
self
in place.source§fn characteristic<'a>() -> &'a [u64]
fn characteristic<'a>() -> &'a [u64]
Returns the characteristic of the field.
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.source§fn frobenius_map(&mut self, _: usize)
fn frobenius_map(&mut self, _: usize)
Exponentiates this element by a power of the base prime modulus via
the Frobenius automorphism.
source§fn pow<S: AsRef<[u64]>>(&self, exp: S) -> Self
fn pow<S: AsRef<[u64]>>(&self, exp: S) -> Self
Exponentiates this element by a number represented with
u64
limbs,
least significant limb first.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§impl<P: Fp384Parameters> FromBytes for Fp384<P>
impl<P: Fp384Parameters> FromBytes for Fp384<P>
source§impl<P: Fp384Parameters> FromStr for Fp384<P>
impl<P: Fp384Parameters> FromStr for Fp384<P>
source§impl<P> Hash for Fp384<P>where
P: Fp384Parameters,
impl<P> Hash for Fp384<P>where
P: Fp384Parameters,
source§impl<P: Fp384Parameters> Into<BigInteger384> for Fp384<P>
impl<P: Fp384Parameters> Into<BigInteger384> for Fp384<P>
source§fn into(self) -> BigInteger384
fn into(self) -> BigInteger384
Converts this type into the (usually inferred) input type.
source§impl<P: Fp384Parameters> MulAssign<&&Fp384<P>> for Fp384<P>
impl<P: Fp384Parameters> MulAssign<&&Fp384<P>> for Fp384<P>
source§fn mul_assign(&mut self, other: &&Self)
fn mul_assign(&mut self, other: &&Self)
Performs the
*=
operation. Read moresource§impl<'a, P: Fp384Parameters> MulAssign<&'a Fp384<P>> for Fp384<P>
impl<'a, P: Fp384Parameters> MulAssign<&'a Fp384<P>> for Fp384<P>
source§fn mul_assign(&mut self, other: &Self)
fn mul_assign(&mut self, other: &Self)
Performs the
*=
operation. Read moresource§impl<'a, P: Fp384Parameters> MulAssign<&'a mut Fp384<P>> for Fp384<P>
impl<'a, P: Fp384Parameters> MulAssign<&'a mut Fp384<P>> for Fp384<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: Fp384Parameters> MulAssign<Fp384<P>> for Fp384<P>
impl<P: Fp384Parameters> MulAssign<Fp384<P>> for Fp384<P>
source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*=
operation. Read moresource§impl<P: Fp384Parameters> Neg for Fp384<P>
impl<P: Fp384Parameters> Neg for Fp384<P>
source§impl<P: Fp384Parameters> One for Fp384<P>
impl<P: Fp384Parameters> One for Fp384<P>
source§impl<P: Fp384Parameters> Ord for Fp384<P>
impl<P: Fp384Parameters> Ord for Fp384<P>
source§impl<P> PartialEq<Fp384<P>> for Fp384<P>where
P: Fp384Parameters,
impl<P> PartialEq<Fp384<P>> for Fp384<P>where
P: Fp384Parameters,
source§impl<P: Fp384Parameters> PartialOrd<Fp384<P>> for Fp384<P>
impl<P: Fp384Parameters> PartialOrd<Fp384<P>> for Fp384<P>
1.0.0 · source§fn 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 moresource§impl<P: Fp384Parameters + PoseidonDefaultParameters> PoseidonDefaultField for Fp384<P>
impl<P: Fp384Parameters + PoseidonDefaultParameters> PoseidonDefaultField for Fp384<P>
source§fn default_poseidon_parameters<const RATE: usize>(
) -> Result<PoseidonParameters<Self, RATE, 1>>where
Self: PrimeField,
fn default_poseidon_parameters<const RATE: usize>(
) -> Result<PoseidonParameters<Self, RATE, 1>>where
Self: PrimeField,
Obtain the default Poseidon parameters for this rate and for this prime field,
with a specific optimization goal.
source§impl<P: Fp384Parameters> PrimeField for Fp384<P>
impl<P: Fp384Parameters> PrimeField for Fp384<P>
type BigInteger = BigInteger384
type Parameters = P
source§fn from_bigint(r: BigInteger) -> Option<Self>
fn from_bigint(r: BigInteger) -> Option<Self>
Constructs a
PrimeField
element given a human-readable Self::BigInteger
.source§fn to_bigint(&self) -> BigInteger
fn to_bigint(&self) -> BigInteger
Returns a human-readable
Self::BigInteger
in the range 0..(Self::MODULUS - 1)
.source§fn decompose(
&self,
_q1: &[u64; 4],
_q2: &[u64; 4],
_b1: Self,
_b2: Self,
_r128: Self,
_half_r: &[u64; 8]
) -> (Self, Self, bool, bool)
fn decompose(
&self,
_q1: &[u64; 4],
_q2: &[u64; 4],
_b1: Self,
_b2: Self,
_r128: Self,
_half_r: &[u64; 8]
) -> (Self, Self, bool, bool)
Returns the decomposition of the scalar.
source§const SIZE_IN_BITS: usize = _
const SIZE_IN_BITS: usize = _
Returns the field size in bits.
source§const SIZE_IN_DATA_BITS: usize = _
const SIZE_IN_DATA_BITS: usize = _
Returns the field capacity for data bits.
source§fn size_in_bits() -> usize
fn size_in_bits() -> usize
Returns the field size in bits.
source§fn size_in_data_bits() -> usize
fn size_in_data_bits() -> usize
Returns the capacity size for data bits.
source§fn modulus() -> Self::BigInteger
fn modulus() -> Self::BigInteger
Returns the modulus.
source§fn modulus_minus_one_div_two() -> Self::BigInteger
fn modulus_minus_one_div_two() -> Self::BigInteger
Returns the modulus minus one divided by two.
source§fn trace() -> Self::BigInteger
fn trace() -> Self::BigInteger
Returns the trace.
source§fn trace_minus_one_div_two() -> Self::BigInteger
fn trace_minus_one_div_two() -> Self::BigInteger
Returns the trace minus one divided by two.
source§fn from_bytes_be_mod_order(bytes: &[u8]) -> Self
fn from_bytes_be_mod_order(bytes: &[u8]) -> Self
Reads bytes in big-endian, and converts them to a field element.
If the bytes are larger than the modulus, it will reduce them.
source§fn from_bytes_le_mod_order(bytes: &[u8]) -> Self
fn from_bytes_le_mod_order(bytes: &[u8]) -> Self
Reads bytes in little-endian, and converts them to a field element.
If the bytes are larger than the modulus, it will reduce them.
source§impl<P: Fp384Parameters> Serialize for Fp384<P>
impl<P: Fp384Parameters> Serialize for Fp384<P>
source§impl<P: Fp384Parameters> SquareRootField for Fp384<P>
impl<P: Fp384Parameters> SquareRootField for Fp384<P>
source§impl<P: Fp384Parameters> SubAssign<&&Fp384<P>> for Fp384<P>
impl<P: Fp384Parameters> SubAssign<&&Fp384<P>> for Fp384<P>
source§fn sub_assign(&mut self, other: &&Self)
fn sub_assign(&mut self, other: &&Self)
Performs the
-=
operation. Read moresource§impl<'a, P: Fp384Parameters> SubAssign<&'a Fp384<P>> for Fp384<P>
impl<'a, P: Fp384Parameters> SubAssign<&'a Fp384<P>> for Fp384<P>
source§fn sub_assign(&mut self, other: &Self)
fn sub_assign(&mut self, other: &Self)
Performs the
-=
operation. Read moresource§impl<'a, P: Fp384Parameters> SubAssign<&'a mut Fp384<P>> for Fp384<P>
impl<'a, P: Fp384Parameters> SubAssign<&'a mut Fp384<P>> for Fp384<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: Fp384Parameters> SubAssign<Fp384<P>> for Fp384<P>
impl<P: Fp384Parameters> SubAssign<Fp384<P>> for Fp384<P>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moresource§impl<P: Fp384Parameters> ToBits for Fp384<P>
impl<P: Fp384Parameters> ToBits for Fp384<P>
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.