pub struct Fp256<P: Fp256Parameters>(pub BigInteger256, _);
Tuple Fields§
§0: BigInteger256
Trait Implementations§
Source§impl<P: Fp256Parameters> Add for Fp256<P>
impl<P: Fp256Parameters> Add for Fp256<P>
Source§impl<P: Fp256Parameters> AddAssign<&&Fp256<P>> for Fp256<P>
impl<P: Fp256Parameters> AddAssign<&&Fp256<P>> for Fp256<P>
Source§fn add_assign(&mut self, other: &&Self)
fn add_assign(&mut self, other: &&Self)
Performs the
+=
operation. Read moreSource§impl<'a, P: Fp256Parameters> AddAssign<&'a Fp256<P>> for Fp256<P>
impl<'a, P: Fp256Parameters> AddAssign<&'a Fp256<P>> for Fp256<P>
Source§fn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
Performs the
+=
operation. Read moreSource§impl<'a, P: Fp256Parameters> AddAssign<&'a mut Fp256<P>> for Fp256<P>
impl<'a, P: Fp256Parameters> AddAssign<&'a mut Fp256<P>> for Fp256<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: Fp256Parameters> AddAssign for Fp256<P>
impl<P: Fp256Parameters> AddAssign for Fp256<P>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moreSource§impl<P: Fp256Parameters> CanonicalDeserialize for Fp256<P>
impl<P: Fp256Parameters> CanonicalDeserialize for Fp256<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: Fp256Parameters> CanonicalDeserializeWithFlags for Fp256<P>
impl<P: Fp256Parameters> CanonicalDeserializeWithFlags for Fp256<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: Fp256Parameters> CanonicalSerialize for Fp256<P>
impl<P: Fp256Parameters> CanonicalSerialize for Fp256<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: Fp256Parameters> CanonicalSerializeWithFlags for Fp256<P>
impl<P: Fp256Parameters> CanonicalSerializeWithFlags for Fp256<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: Fp256Parameters> Debug for Fp256<P>
impl<P: Fp256Parameters> Debug for Fp256<P>
Source§impl<'de, P: Fp256Parameters> Deserialize<'de> for Fp256<P>
impl<'de, P: Fp256Parameters> Deserialize<'de> for Fp256<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: Fp256Parameters> Display for Fp256<P>
impl<P: Fp256Parameters> Display for Fp256<P>
Source§impl<P: Fp256Parameters> Distribution<Fp256<P>> for Standard
impl<P: Fp256Parameters> Distribution<Fp256<P>> for Standard
Source§impl<P: Fp256Parameters> Div for Fp256<P>
impl<P: Fp256Parameters> Div for Fp256<P>
Source§impl<P: Fp256Parameters> DivAssign<&&Fp256<P>> for Fp256<P>
impl<P: Fp256Parameters> DivAssign<&&Fp256<P>> for Fp256<P>
Source§fn div_assign(&mut self, other: &&Self)
fn div_assign(&mut self, other: &&Self)
Performs the
/=
operation. Read moreSource§impl<'a, P: Fp256Parameters> DivAssign<&'a Fp256<P>> for Fp256<P>
impl<'a, P: Fp256Parameters> DivAssign<&'a Fp256<P>> for Fp256<P>
Source§fn div_assign(&mut self, other: &Self)
fn div_assign(&mut self, other: &Self)
Performs the
/=
operation. Read moreSource§impl<'a, P: Fp256Parameters> DivAssign<&'a mut Fp256<P>> for Fp256<P>
impl<'a, P: Fp256Parameters> DivAssign<&'a mut Fp256<P>> for Fp256<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: Fp256Parameters> DivAssign for Fp256<P>
impl<P: Fp256Parameters> DivAssign for Fp256<P>
Source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the
/=
operation. Read moreSource§impl<P: Fp256Parameters> FftField for Fp256<P>
impl<P: Fp256Parameters> FftField for Fp256<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: Fp256Parameters> Field for Fp256<P>
impl<P: Fp256Parameters> Field for Fp256<P>
type BasePrimeField = Fp256<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: Fp256Parameters> FromBytes for Fp256<P>
impl<P: Fp256Parameters> FromBytes for Fp256<P>
Source§impl<P: Fp256Parameters> FromStr for Fp256<P>
impl<P: Fp256Parameters> FromStr for Fp256<P>
Source§impl<P: Fp256Parameters> Into<BigInteger256> for Fp256<P>
impl<P: Fp256Parameters> Into<BigInteger256> for Fp256<P>
Source§fn into(self) -> BigInteger256
fn into(self) -> BigInteger256
Converts this type into the (usually inferred) input type.
Source§impl<P: Fp256Parameters> Mul for Fp256<P>
impl<P: Fp256Parameters> Mul for Fp256<P>
Source§impl<P: Fp256Parameters> MulAssign<&&Fp256<P>> for Fp256<P>
impl<P: Fp256Parameters> MulAssign<&&Fp256<P>> for Fp256<P>
Source§fn mul_assign(&mut self, other: &&Self)
fn mul_assign(&mut self, other: &&Self)
Performs the
*=
operation. Read moreSource§impl<'a, P: Fp256Parameters> MulAssign<&'a Fp256<P>> for Fp256<P>
impl<'a, P: Fp256Parameters> MulAssign<&'a Fp256<P>> for Fp256<P>
Source§fn mul_assign(&mut self, other: &Self)
fn mul_assign(&mut self, other: &Self)
Performs the
*=
operation. Read moreSource§impl<'a, P: Fp256Parameters> MulAssign<&'a mut Fp256<P>> for Fp256<P>
impl<'a, P: Fp256Parameters> MulAssign<&'a mut Fp256<P>> for Fp256<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: Fp256Parameters> MulAssign for Fp256<P>
impl<P: Fp256Parameters> MulAssign for Fp256<P>
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*=
operation. Read moreSource§impl<P: Fp256Parameters> Neg for Fp256<P>
impl<P: Fp256Parameters> Neg for Fp256<P>
Source§impl<P: Fp256Parameters> One for Fp256<P>
impl<P: Fp256Parameters> One for Fp256<P>
Source§impl<P: Fp256Parameters> Ord for Fp256<P>
impl<P: Fp256Parameters> Ord for Fp256<P>
Fp
elements are ordered lexicographically.
Source§impl<P: Fp256Parameters> PartialOrd for Fp256<P>
impl<P: Fp256Parameters> PartialOrd for Fp256<P>
Source§impl<P: Fp256Parameters + PoseidonDefaultParameters> PoseidonDefaultField for Fp256<P>
impl<P: Fp256Parameters + PoseidonDefaultParameters> PoseidonDefaultField for Fp256<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: Fp256Parameters> PrimeField for Fp256<P>
impl<P: Fp256Parameters> PrimeField for Fp256<P>
type BigInteger = BigInteger256
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: Fp256Parameters> Product for Fp256<P>
impl<P: Fp256Parameters> Product for Fp256<P>
Source§impl<P: Fp256Parameters> Serialize for Fp256<P>
impl<P: Fp256Parameters> Serialize for Fp256<P>
Source§impl<P: Fp256Parameters> SquareRootField for Fp256<P>
impl<P: Fp256Parameters> SquareRootField for Fp256<P>
Source§impl<P: Fp256Parameters> Sub for Fp256<P>
impl<P: Fp256Parameters> Sub for Fp256<P>
Source§impl<P: Fp256Parameters> SubAssign<&&Fp256<P>> for Fp256<P>
impl<P: Fp256Parameters> SubAssign<&&Fp256<P>> for Fp256<P>
Source§fn sub_assign(&mut self, other: &&Self)
fn sub_assign(&mut self, other: &&Self)
Performs the
-=
operation. Read moreSource§impl<'a, P: Fp256Parameters> SubAssign<&'a Fp256<P>> for Fp256<P>
impl<'a, P: Fp256Parameters> SubAssign<&'a Fp256<P>> for Fp256<P>
Source§fn sub_assign(&mut self, other: &Self)
fn sub_assign(&mut self, other: &Self)
Performs the
-=
operation. Read moreSource§impl<'a, P: Fp256Parameters> SubAssign<&'a mut Fp256<P>> for Fp256<P>
impl<'a, P: Fp256Parameters> SubAssign<&'a mut Fp256<P>> for Fp256<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: Fp256Parameters> SubAssign for Fp256<P>
impl<P: Fp256Parameters> SubAssign for Fp256<P>
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moreSource§impl<P: Fp256Parameters> Sum for Fp256<P>
impl<P: Fp256Parameters> Sum for Fp256<P>
Source§impl<P: Fp256Parameters> ToBits for Fp256<P>
impl<P: Fp256Parameters> ToBits for Fp256<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 num_bits() -> Option<usize>
fn num_bits() -> Option<usize>
An optional indication of how many bits an object can be represented with.
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: Fp256Parameters> ToBytes for Fp256<P>
impl<P: Fp256Parameters> ToBytes for Fp256<P>
Source§impl<P: Fp256Parameters> Valid for Fp256<P>
impl<P: Fp256Parameters> Valid for Fp256<P>
fn check(&self) -> Result<(), SerializationError>
fn batch_check<'a>(
_batch: impl Iterator<Item = &'a Self> + Send,
) -> Result<(), SerializationError>where
Self: 'a,
Source§impl<P: Fp256Parameters> Zero for Fp256<P>
impl<P: Fp256Parameters> Zero for Fp256<P>
Source§impl<P: Fp256Parameters> Zeroize for Fp256<P>
impl<P: Fp256Parameters> Zeroize for Fp256<P>
impl<P: Copy + Fp256Parameters> Copy for Fp256<P>
impl<P: Eq + Fp256Parameters> Eq for Fp256<P>
impl<P: Fp256Parameters> StructuralPartialEq for Fp256<P>
Auto Trait Implementations§
impl<P> Freeze for Fp256<P>
impl<P> RefUnwindSafe for Fp256<P>where
P: RefUnwindSafe,
impl<P> Send for Fp256<P>
impl<P> Sync for Fp256<P>
impl<P> Unpin for Fp256<P>where
P: Unpin,
impl<P> UnwindSafe for Fp256<P>where
P: 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