ark_test_curves

Struct Fp

Source
pub struct Fp<P, const N: usize>(/* private fields */)
where
    P: FpConfig<N>;
Expand description

Represents an element of the prime field F_p, where p == P::MODULUS. This type can represent elements in any field of size at most N * 64 bits.

Implementations§

Source§

impl<T, const N: usize> Fp<MontBackend<T, N>, N>
where T: MontConfig<N>,

Source

pub const fn new(element: BigInt<N>) -> Fp<MontBackend<T, N>, N>

Construct a new field element from its underlying BigInt data type.

Source

pub const fn new_unchecked(element: BigInt<N>) -> Fp<MontBackend<T, N>, N>

Construct a new field element from its underlying BigInt data type.

Unlike Self::new, this method does not perform Montgomery reduction. Thus, this method should be used only when constructing an element from an integer that has already been put in Montgomery form.

Trait Implementations§

Source§

impl<'a, 'b, P, const N: usize> Add<&'b Fp<P, N>> for &'a Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'b Fp<P, N>) -> Fp<P, N>

Performs the + operation. Read more
Source§

impl<'a, P, const N: usize> Add<&'a Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the + operator.
Source§

fn add(self, other: &Fp<P, N>) -> Fp<P, N>

Performs the + operation. Read more
Source§

impl<'a, P, const N: usize> Add<&'a mut Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'a mut Fp<P, N>) -> Fp<P, N>

Performs the + operation. Read more
Source§

impl<P, const N: usize> Add for Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the + operator.
Source§

fn add(self, other: Fp<P, N>) -> Fp<P, N>

Performs the + operation. Read more
Source§

impl<'a, P, const N: usize> AddAssign<&'a Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn add_assign(&mut self, other: &Fp<P, N>)

Performs the += operation. Read more
Source§

impl<'a, P, const N: usize> AddAssign<&'a mut Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn add_assign(&mut self, other: &'a mut Fp<P, N>)

Performs the += operation. Read more
Source§

impl<P, const N: usize> AddAssign for Fp<P, N>
where P: FpConfig<N>,

Source§

fn add_assign(&mut self, other: Fp<P, N>)

Performs the += operation. Read more
Source§

impl<P, const N: usize> AdditiveGroup for Fp<P, N>
where P: FpConfig<N>,

Source§

const ZERO: Fp<P, N> = P::ZERO

The additive identity of the field.
Source§

type Scalar = Fp<P, N>

Source§

fn double(&self) -> Fp<P, N>

Doubles self.
Source§

fn double_in_place(&mut self) -> &mut Fp<P, N>

Doubles self in place.
Source§

fn neg_in_place(&mut self) -> &mut Fp<P, N>

Negates self in place.
Source§

impl<P, const N: usize> CanonicalDeserialize for Fp<P, N>
where P: FpConfig<N>,

Source§

fn deserialize_with_mode<R>( reader: R, _compress: Compress, _validate: Validate, ) -> Result<Fp<P, N>, SerializationError>
where R: Read,

The general deserialize method that takes in customization flags.
Source§

fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>
where R: Read,

Source§

fn deserialize_compressed_unchecked<R>( reader: R, ) -> Result<Self, SerializationError>
where R: Read,

Source§

fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>
where R: Read,

Source§

fn deserialize_uncompressed_unchecked<R>( reader: R, ) -> Result<Self, SerializationError>
where R: Read,

Source§

impl<P, const N: usize> CanonicalDeserializeWithFlags for Fp<P, N>
where P: FpConfig<N>,

Source§

fn deserialize_with_flags<R, F>( reader: R, ) -> Result<(Fp<P, N>, F), SerializationError>
where R: Read, F: Flags,

Reads Self and Flags from reader. Returns empty flags by default.
Source§

impl<P, const N: usize> CanonicalSerialize for Fp<P, N>
where P: FpConfig<N>,

Source§

fn serialize_with_mode<W>( &self, writer: W, _compress: Compress, ) -> Result<(), SerializationError>
where W: Write,

The general serialize method that takes in customization flags.
Source§

fn serialized_size(&self, _compress: Compress) -> usize

Source§

fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>
where W: Write,

Source§

fn compressed_size(&self) -> usize

Source§

fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>
where W: Write,

Source§

fn uncompressed_size(&self) -> usize

Source§

impl<P, const N: usize> CanonicalSerializeWithFlags for Fp<P, N>
where P: FpConfig<N>,

Source§

fn serialize_with_flags<W, F>( &self, writer: W, flags: F, ) -> Result<(), SerializationError>
where W: Write, F: Flags,

Serializes self and flags into writer.
Source§

fn serialized_size_with_flags<F>(&self) -> usize
where F: Flags,

Serializes self and flags into writer.
Source§

impl<P, const N: usize> Clone for Fp<P, N>
where P: FpConfig<N>, BigInt<N>: Copy, PhantomData<P>: Copy,

Source§

fn clone(&self) -> Fp<P, N>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P, const N: usize> Debug for Fp<P, N>
where P: FpConfig<N>,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<P, const N: usize> Default for Fp<P, N>
where P: FpConfig<N>, BigInt<N>: Default, PhantomData<P>: Default,

Source§

fn default() -> Fp<P, N>

Returns the “default value” for a type. Read more
Source§

impl<P, const N: usize> Display for Fp<P, N>
where P: FpConfig<N>,

Outputs a string containing the value of self, represented as a decimal without leading zeroes.

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a, 'b, P, const N: usize> Div<&'b Fp<P, N>> for &'a Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the / operator.
Source§

fn div(self, other: &Fp<P, N>) -> Fp<P, N>

Performs the / operation. Read more
Source§

impl<'a, P, const N: usize> Div<&'a Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn div(self, other: &Fp<P, N>) -> Fp<P, N>

Returns self * other.inverse() if other.inverse() is Some, and panics otherwise.

Source§

type Output = Fp<P, N>

The resulting type after applying the / operator.
Source§

impl<'a, P, const N: usize> Div<&'a mut Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'a mut Fp<P, N>) -> Fp<P, N>

Performs the / operation. Read more
Source§

impl<P, const N: usize> Div for Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the / operator.
Source§

fn div(self, other: Fp<P, N>) -> Fp<P, N>

Performs the / operation. Read more
Source§

impl<'a, P, const N: usize> DivAssign<&'a Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Computes self *= other.inverse() if other.inverse() is Some, and panics otherwise.

Source§

fn div_assign(&mut self, other: &Fp<P, N>)

Performs the /= operation. Read more
Source§

impl<'a, P, const N: usize> DivAssign<&'a mut Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn div_assign(&mut self, other: &'a mut Fp<P, N>)

Performs the /= operation. Read more
Source§

impl<P, const N: usize> DivAssign for Fp<P, N>
where P: FpConfig<N>,

Source§

fn div_assign(&mut self, other: Fp<P, N>)

Performs the /= operation. Read more
Source§

impl<P, const N: usize> FftField for Fp<P, N>
where P: FpConfig<N>,

Source§

const GENERATOR: Fp<P, N> = P::GENERATOR

The generator of the multiplicative group of the field
Source§

const TWO_ADICITY: u32 = P::TWO_ADICITY

Let N be the size of the multiplicative group defined by the field. Then TWO_ADICITY is the two-adicity of N, i.e. the integer s such that N = 2^s * t for some odd integer t.
Source§

const TWO_ADIC_ROOT_OF_UNITY: Fp<P, N> = P::TWO_ADIC_ROOT_OF_UNITY

2^s root of unity computed by GENERATOR^t
Source§

const SMALL_SUBGROUP_BASE: Option<u32> = P::SMALL_SUBGROUP_BASE

An integer b such that there exists a multiplicative subgroup of size b^k for some integer k.
Source§

const SMALL_SUBGROUP_BASE_ADICITY: Option<u32> = P::SMALL_SUBGROUP_BASE_ADICITY

The integer k such that there exists a multiplicative subgroup of size Self::SMALL_SUBGROUP_BASE^k.
Source§

const LARGE_SUBGROUP_ROOT_OF_UNITY: Option<Fp<P, N>> = P::LARGE_SUBGROUP_ROOT_OF_UNITY

GENERATOR^((MODULUS-1) / (2^s * SMALL_SUBGROUP_BASE^SMALL_SUBGROUP_BASE_ADICITY)) Used for mixed-radix FFT.
Source§

fn get_root_of_unity(n: u64) -> 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 FftConfig::LARGE_SUBGROUP_ROOT_OF_UNITY (for n = 2^i * FftConfig::SMALL_SUBGROUP_BASE^j for some i, j).
Source§

impl<P, const N: usize> Field for Fp<P, N>
where P: FpConfig<N>,

Source§

fn frobenius_map_in_place(&mut self, _: usize)

The Frobenius map has no effect in a prime field.

Source§

fn mul_by_base_prime_field( &self, elem: &<Fp<P, N> as Field>::BasePrimeField, ) -> Fp<P, N>

Fp is already a “BasePrimeField”, so it’s just mul by self

Source§

const SQRT_PRECOMP: Option<SqrtPrecomputation<Fp<P, N>>> = P::SQRT_PRECOMP

Determines the algorithm for computing square roots.
Source§

const ONE: Fp<P, N> = P::ONE

The multiplicative identity of the field.
Source§

type BasePrimeField = Fp<P, N>

Source§

fn extension_degree() -> u64

Returns the extension degree of this field with respect to Self::BasePrimeField.
Source§

fn from_base_prime_field(elem: <Fp<P, N> as Field>::BasePrimeField) -> Fp<P, N>

Constructs a field element from a single base prime field elements. Read more
Source§

fn to_base_prime_field_elements( &self, ) -> impl Iterator<Item = <Fp<P, N> as Field>::BasePrimeField>

Source§

fn from_base_prime_field_elems( elems: impl IntoIterator<Item = <Fp<P, N> as Field>::BasePrimeField>, ) -> Option<Fp<P, N>>

Convert a slice of base prime field elements into a field element. If the slice length != Self::extension_degree(), must return None.
Source§

fn characteristic() -> &'static [u64]

Returns the characteristic of the field, in little-endian representation.
Source§

fn sum_of_products<const T: usize>( a: &[Fp<P, N>; T], b: &[Fp<P, N>; T], ) -> Fp<P, N>

Returns sum([a_i * b_i]).
Source§

fn from_random_bytes_with_flags<F>(bytes: &[u8]) -> Option<(Fp<P, N>, F)>
where F: Flags,

Attempt to deserialize a field element, splitting the bitflags metadata according to F specification. Returns None if the deserialization fails. Read more
Source§

fn square(&self) -> Fp<P, N>

Returns self * self.
Source§

fn square_in_place(&mut self) -> &mut Fp<P, N>

Squares self in place.
Source§

fn inverse(&self) -> Option<Fp<P, N>>

Computes the multiplicative inverse of self if self is nonzero.
Source§

fn inverse_in_place(&mut self) -> Option<&mut Fp<P, N>>

If self.inverse().is_none(), this just returns None. Otherwise, it sets self to self.inverse().unwrap().
Source§

fn legendre(&self) -> LegendreSymbol

Returns a LegendreSymbol, which indicates whether this field element is 1 : a quadratic residue 0 : equal to 0 -1 : a quadratic non-residue
Source§

fn from_random_bytes(bytes: &[u8]) -> Option<Self>

Attempt to deserialize a field element. Returns None if the deserialization fails. Read more
Source§

fn sqrt(&self) -> Option<Self>

Returns the square root of self, if it exists.
Source§

fn sqrt_in_place(&mut self) -> Option<&mut Self>

Sets self to be the square root of self, if it exists.
Source§

fn frobenius_map(&self, power: usize) -> Self

Returns self^s, where s = Self::BasePrimeField::MODULUS^power. This is also called the Frobenius automorphism.
Source§

fn pow<S>(&self, exp: S) -> Self
where S: AsRef<[u64]>,

Returns self^exp, where exp is an integer represented with u64 limbs, least significant limb first.
Source§

fn pow_with_table<S>(powers_of_2: &[Self], exp: S) -> Option<Self>
where S: AsRef<[u64]>,

Exponentiates a field element f by a number represented with u64 limbs, using a precomputed table containing as many powers of 2 of f as the 1 + the floor of log2 of the exponent exp, starting from the 1st power. That is, powers_of_2 should equal &[p, p^2, p^4, ..., p^(2^n)] when exp has at most n bits. Read more
Source§

impl<P, const N: usize> From<BigInt<N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn from(int: BigInt<N>) -> Fp<P, N>

Converts Self::BigInteger into Self

Source§

impl<P, const N: usize> From<BigUint> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn from(val: BigUint) -> Fp<P, N>

Converts to this type from the input type.
Source§

impl<P, const N: usize> From<bool> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn from(other: bool) -> Fp<P, N>

Converts to this type from the input type.
Source§

impl<P, const N: usize> From<i128> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn from(other: i128) -> Fp<P, N>

Converts to this type from the input type.
Source§

impl<P, const N: usize> From<i16> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn from(other: i16) -> Fp<P, N>

Converts to this type from the input type.
Source§

impl<P, const N: usize> From<i32> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn from(other: i32) -> Fp<P, N>

Converts to this type from the input type.
Source§

impl<P, const N: usize> From<i64> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn from(other: i64) -> Fp<P, N>

Converts to this type from the input type.
Source§

impl<P, const N: usize> From<i8> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn from(other: i8) -> Fp<P, N>

Converts to this type from the input type.
Source§

impl<P, const N: usize> From<u128> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn from(other: u128) -> Fp<P, N>

Converts to this type from the input type.
Source§

impl<P, const N: usize> From<u16> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn from(other: u16) -> Fp<P, N>

Converts to this type from the input type.
Source§

impl<P, const N: usize> From<u32> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn from(other: u32) -> Fp<P, N>

Converts to this type from the input type.
Source§

impl<P, const N: usize> From<u64> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn from(other: u64) -> Fp<P, N>

Converts to this type from the input type.
Source§

impl<P, const N: usize> From<u8> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn from(other: u8) -> Fp<P, N>

Converts to this type from the input type.
Source§

impl<P, const N: usize> FromStr for Fp<P, N>
where P: FpConfig<N>,

Source§

fn from_str(s: &str) -> Result<Fp<P, N>, <Fp<P, N> as FromStr>::Err>

Interpret a string of numbers as a (congruent) prime field element. Does not accept unnecessary leading zeroes or a blank string.

Source§

type Err = ()

The associated error which can be returned from parsing.
Source§

impl<P, const N: usize> Hash for Fp<P, N>
where P: FpConfig<N>, BigInt<N>: Hash, PhantomData<P>: Hash,

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a, 'b, P, const N: usize> Mul<&'b Fp<P, N>> for &'a Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Fp<P, N>) -> Fp<P, N>

Performs the * operation. Read more
Source§

impl<'a, P, const N: usize> Mul<&'a Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Fp<P, N>) -> Fp<P, N>

Performs the * operation. Read more
Source§

impl<'a, P, const N: usize> Mul<&'a mut Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a mut Fp<P, N>) -> Fp<P, N>

Performs the * operation. Read more
Source§

impl<P, const N: usize> Mul for Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Fp<P, N>) -> Fp<P, N>

Performs the * operation. Read more
Source§

impl<'a, P, const N: usize> MulAssign<&'a Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn mul_assign(&mut self, other: &Fp<P, N>)

Performs the *= operation. Read more
Source§

impl<'a, P, const N: usize> MulAssign<&'a mut Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn mul_assign(&mut self, other: &'a mut Fp<P, N>)

Performs the *= operation. Read more
Source§

impl<P, const N: usize> MulAssign for Fp<P, N>
where P: FpConfig<N>,

Source§

fn mul_assign(&mut self, other: Fp<P, N>)

Performs the *= operation. Read more
Source§

impl<P, const N: usize> Neg for Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Fp<P, N>

Performs the unary - operation. Read more
Source§

impl<P, const N: usize> One for Fp<P, N>
where P: FpConfig<N>,

Source§

fn one() -> Fp<P, N>

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn is_one(&self) -> bool

Returns true if self is equal to the multiplicative identity. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

impl<P, const N: usize> Ord for Fp<P, N>
where P: FpConfig<N>,

Note that this implementation of Ord compares field elements viewing them as integers in the range 0, 1, …, P::MODULUS - 1. However, other implementations of PrimeField might choose a different ordering, and as such, users should use this Ord for applications where any ordering suffices (like in a BTreeMap), and not in applications where a particular ordering is required.

Source§

fn cmp(&self, other: &Fp<P, N>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<P, const N: usize> PartialEq for Fp<P, N>

Source§

fn eq(&self, other: &Fp<P, N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<P, const N: usize> PartialOrd for Fp<P, N>
where P: FpConfig<N>,

Note that this implementation of PartialOrd compares field elements viewing them as integers in the range 0, 1, …, P::MODULUS - 1. However, other implementations of PrimeField might choose a different ordering, and as such, users should use this PartialOrd for applications where any ordering suffices (like in a BTreeMap), and not in applications where a particular ordering is required.

Source§

fn partial_cmp(&self, other: &Fp<P, N>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<P, const N: usize> PrimeField for Fp<P, N>
where P: FpConfig<N>,

Source§

const MODULUS: <Fp<P, N> as PrimeField>::BigInt = P::MODULUS

The modulus p.
Source§

const MODULUS_MINUS_ONE_DIV_TWO: <Fp<P, N> as PrimeField>::BigInt = _

The value (p - 1)/ 2.
Source§

const MODULUS_BIT_SIZE: u32 = _

The size of the modulus in bits.
Source§

const TRACE: <Fp<P, N> as PrimeField>::BigInt = _

The trace of the field is defined as the smallest integer t such that by 2^s * t = p - 1, and t is coprime to 2.
Source§

const TRACE_MINUS_ONE_DIV_TWO: <Fp<P, N> as PrimeField>::BigInt = _

The value (t - 1)/ 2.
Source§

type BigInt = BigInt<N>

A BigInteger type that can represent elements of this field.
Source§

fn from_bigint(r: BigInt<N>) -> Option<Fp<P, N>>

Construct a prime field element from an integer in the range 0..(p - 1).
Source§

fn into_bigint(self) -> BigInt<N>

Converts an element of the prime field into an integer in the range 0..(p - 1).
Source§

fn from_be_bytes_mod_order(bytes: &[u8]) -> Self

Reads bytes in big-endian, and converts them to a field element. If the integer represented by bytes is larger than the modulus p, this method performs the appropriate reduction.
Source§

fn from_le_bytes_mod_order(bytes: &[u8]) -> Self

Reads bytes in little-endian, and converts them to a field element. If the integer represented by bytes is larger than the modulus p, this method performs the appropriate reduction.
Source§

impl<'a, P, const N: usize> Product<&'a Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn product<I>(iter: I) -> Fp<P, N>
where I: Iterator<Item = &'a Fp<P, N>>,

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<P, const N: usize> Product for Fp<P, N>
where P: FpConfig<N>,

Source§

fn product<I>(iter: I) -> Fp<P, N>
where I: Iterator<Item = Fp<P, N>>,

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<'a, 'b, P, const N: usize> Sub<&'b Fp<P, N>> for &'a Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Fp<P, N>) -> Fp<P, N>

Performs the - operation. Read more
Source§

impl<'a, P, const N: usize> Sub<&'a Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Fp<P, N>) -> Fp<P, N>

Performs the - operation. Read more
Source§

impl<'a, P, const N: usize> Sub<&'a mut Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'a mut Fp<P, N>) -> Fp<P, N>

Performs the - operation. Read more
Source§

impl<P, const N: usize> Sub for Fp<P, N>
where P: FpConfig<N>,

Source§

type Output = Fp<P, N>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Fp<P, N>) -> Fp<P, N>

Performs the - operation. Read more
Source§

impl<'a, P, const N: usize> SubAssign<&'a Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn sub_assign(&mut self, other: &Fp<P, N>)

Performs the -= operation. Read more
Source§

impl<'a, P, const N: usize> SubAssign<&'a mut Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn sub_assign(&mut self, other: &'a mut Fp<P, N>)

Performs the -= operation. Read more
Source§

impl<P, const N: usize> SubAssign for Fp<P, N>
where P: FpConfig<N>,

Source§

fn sub_assign(&mut self, other: Fp<P, N>)

Performs the -= operation. Read more
Source§

impl<'a, P, const N: usize> Sum<&'a Fp<P, N>> for Fp<P, N>
where P: FpConfig<N>,

Source§

fn sum<I>(iter: I) -> Fp<P, N>
where I: Iterator<Item = &'a Fp<P, N>>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<P, const N: usize> Sum for Fp<P, N>
where P: FpConfig<N>,

Source§

fn sum<I>(iter: I) -> Fp<P, N>
where I: Iterator<Item = Fp<P, N>>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<P, const N: usize> Valid for Fp<P, N>
where P: FpConfig<N>,

Source§

fn check(&self) -> Result<(), SerializationError>

Source§

fn batch_check<'a>( batch: impl Iterator<Item = &'a Self> + Send, ) -> Result<(), SerializationError>
where Self: 'a,

Source§

impl<P, const N: usize> Zero for Fp<P, N>
where P: FpConfig<N>,

Source§

fn zero() -> Fp<P, N>

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl<P, const N: usize> Zeroize for Fp<P, N>
where P: FpConfig<N>,

Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
Source§

impl<P, const N: usize> Copy for Fp<P, N>
where P: FpConfig<N>, BigInt<N>: Copy, PhantomData<P>: Copy,

Source§

impl<P, const N: usize> Eq for Fp<P, N>

Auto Trait Implementations§

§

impl<P, const N: usize> Freeze for Fp<P, N>

§

impl<P, const N: usize> RefUnwindSafe for Fp<P, N>
where P: RefUnwindSafe,

§

impl<P, const N: usize> Send for Fp<P, N>

§

impl<P, const N: usize> Sync for Fp<P, N>

§

impl<P, const N: usize> Unpin for Fp<P, N>
where P: Unpin,

§

impl<P, const N: usize> UnwindSafe for Fp<P, N>
where P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CanonicalSerializeHashExt for T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<F> ToConstraintField<F> for F
where F: PrimeField,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UniformRand for T

Source§

fn rand<R>(rng: &mut R) -> T
where R: Rng + ?Sized,

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T, F> DomainCoeff<F> for T
where F: FftField, T: Copy + Send + Sync + Add<Output = T> + Sub<Output = T> + AddAssign + SubAssign + Zero + MulAssign<F> + Debug + PartialEq,