Struct ark_ff::fields::models::fp::Fp

source ·
pub struct Fp<P: FpConfig<N>, const N: usize>(pub BigInt<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.

Tuple Fields§

§0: BigInt<N>

Implementations§

source§

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

source

pub const fn new(element: BigInt<N>) -> Self

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

source

pub const fn new_unchecked(element: BigInt<N>) -> Self

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: FpConfig<N>, const N: usize> Add<&'b Fp<P, N>> for &'a Fp<P, N>

§

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: FpConfig<N>, const N: usize> Add<&'a Fp<P, N>> for Fp<P, N>

§

type Output = Fp<P, N>

The resulting type after applying the + operator.
source§

fn add(self, other: &Self) -> Self

Performs the + operation. Read more
source§

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

§

type Output = Fp<P, N>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a mut Self) -> Self

Performs the + operation. Read more
source§

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

§

type Output = Fp<P, N>

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
source§

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

source§

fn add_assign(&mut self, other: &Self)

Performs the += operation. Read more
source§

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

source§

fn add_assign(&mut self, other: &'a mut Self)

Performs the += operation. Read more
source§

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

source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
source§

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

source§

fn deserialize_with_mode<R: Read>( reader: R, _compress: Compress, _validate: Validate ) -> Result<Self, SerializationError>

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: FpConfig<N>, const N: usize> CanonicalDeserializeWithFlags for Fp<P, N>

source§

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: FpConfig<N>, const N: usize> CanonicalSerialize for Fp<P, N>

source§

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

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: FpConfig<N>, const N: usize> CanonicalSerializeWithFlags for Fp<P, N>

source§

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

Serializes self and flags into writer.
source§

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

source§

fn clone(&self) -> Self

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: FpConfig<N>, const N: usize> Debug for Fp<P, N>

source§

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

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

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

source§

fn default() -> Self

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

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

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

source§

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

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

impl<P: FpConfig<N>, const N: usize> Distribution<Fp<P, N>> for Standard

source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Fp<P, N>

Generate a random value of T, using rng as the source of randomness.
source§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
source§

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

§

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: FpConfig<N>, const N: usize> Div<&'a Fp<P, N>> for Fp<P, N>

source§

fn div(self, other: &Self) -> Self

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

§

type Output = Fp<P, N>

The resulting type after applying the / operator.
source§

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

§

type Output = Fp<P, N>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a mut Self) -> Self

Performs the / operation. Read more
source§

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

§

type Output = Fp<P, N>

The resulting type after applying the / operator.
source§

fn div(self, other: Self) -> Self

Performs the / operation. Read more
source§

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

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

source§

fn div_assign(&mut self, other: &Self)

Performs the /= operation. Read more
source§

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

source§

fn div_assign(&mut self, other: &'a mut Self)

Performs the /= operation. Read more
source§

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

source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
source§

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

source§

const GENERATOR: Self = 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: Self = 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<Self> = 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: FpConfig<N>, const N: usize> Field for Fp<P, N>

source§

fn frobenius_map_in_place(&mut self, _: usize)

The Frobenius map has no effect in a prime field.

§

type BasePrimeField = Fp<P, N>

§

type BasePrimeFieldIter = Once<<Fp<P, N> as Field>::BasePrimeField>

source§

const SQRT_PRECOMP: Option<SqrtPrecomputation<Self>> = P::SQRT_PRECOMP

Determines the algorithm for computing square roots.
source§

const ZERO: Self = P::ZERO

The additive identity of the field.
source§

const ONE: Self = P::ONE

The multiplicative identity of the field.
source§

fn extension_degree() -> u64

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

fn from_base_prime_field(elem: Self::BasePrimeField) -> Self

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

fn to_base_prime_field_elements(&self) -> Self::BasePrimeFieldIter

source§

fn from_base_prime_field_elems(elems: &[Self::BasePrimeField]) -> Option<Self>

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

fn double(&self) -> Self

Returns self + self.
source§

fn double_in_place(&mut self) -> &mut Self

Doubles self in place.
source§

fn neg_in_place(&mut self) -> &mut Self

Negates self in place.
source§

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

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

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

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

fn from_random_bytes_with_flags<F: Flags>(bytes: &[u8]) -> Option<(Self, F)>

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) -> Self

Returns self * self.
source§

fn square_in_place(&mut self) -> &mut Self

Squares self in place.
source§

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>

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: AsRef<[u64]>>(&self, exp: S) -> Self

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

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

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: FpConfig<N>, const N: usize> From<BigInt<N>> for Fp<P, N>

source§

fn from(int: BigInt<N>) -> Self

Converts Self::BigInteger into Self

source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

fn from(fp: Fp<P, N>) -> Self

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

fn from(other: bool) -> Self

Converts to this type from the input type.
source§

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

source§

fn from(other: i128) -> Self

Converts to this type from the input type.
source§

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

source§

fn from(other: i16) -> Self

Converts to this type from the input type.
source§

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

source§

fn from(other: i32) -> Self

Converts to this type from the input type.
source§

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

source§

fn from(other: i64) -> Self

Converts to this type from the input type.
source§

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

source§

fn from(other: i8) -> Self

Converts to this type from the input type.
source§

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

source§

fn from(other: u128) -> Self

Converts to this type from the input type.
source§

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

source§

fn from(other: u16) -> Self

Converts to this type from the input type.
source§

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

source§

fn from(other: u32) -> Self

Converts to this type from the input type.
source§

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

source§

fn from(other: u64) -> Self

Converts to this type from the input type.
source§

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

source§

fn from(other: u8) -> Self

Converts to this type from the input type.
source§

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

source§

fn from_str(s: &str) -> Result<Self, Self::Err>

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

§

type Err = ()

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

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

source§

fn hash<__HP>(&self, __state: &mut __HP)
where __HP: 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: FpConfig<N>, const N: usize> Mul<&'b Fp<P, N>> for &'a Fp<P, N>

§

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: FpConfig<N>, const N: usize> Mul<&'a Fp<P, N>> for Fp<P, N>

§

type Output = Fp<P, N>

The resulting type after applying the * operator.
source§

fn mul(self, other: &Self) -> Self

Performs the * operation. Read more
source§

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

§

type Output = Fp<P, N>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a mut Self) -> Self

Performs the * operation. Read more
source§

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

§

type Output = Fp<P, N>

The resulting type after applying the * operator.
source§

fn mul(self, other: Self) -> Self

Performs the * operation. Read more
source§

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

source§

fn mul_assign(&mut self, other: &Self)

Performs the *= operation. Read more
source§

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

source§

fn mul_assign(&mut self, other: &'a mut Self)

Performs the *= operation. Read more
source§

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

source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
source§

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

§

type Output = Fp<P, N>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self

Performs the unary - operation. Read more
source§

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

source§

fn one() -> Self

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: FpConfig<N>, const N: usize> Ord for Fp<P, 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: &Self) -> 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 + PartialOrd,

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

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

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<P: FpConfig<N>, const N: usize> PartialOrd for Fp<P, 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: &Self) -> 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

This method 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

This method 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

This method 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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

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

§

type BigInt = BigInt<N>

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

const MODULUS: Self::BigInt = P::MODULUS

The modulus p.
source§

const MODULUS_MINUS_ONE_DIV_TWO: Self::BigInt = _

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

const MODULUS_BIT_SIZE: u32 = _

The size of the modulus in bits.
source§

const TRACE: Self::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: Self::BigInt = _

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

fn from_bigint(r: BigInt<N>) -> Option<Self>

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: FpConfig<N>, const N: usize> Product<&'a Fp<P, N>> for Fp<P, N>

source§

fn product<I: Iterator<Item = &'a Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by multiplying the items.
source§

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

source§

fn product<I: Iterator<Item = Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by multiplying the items.
source§

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

§

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: FpConfig<N>, const N: usize> Sub<&'a Fp<P, N>> for Fp<P, N>

§

type Output = Fp<P, N>

The resulting type after applying the - operator.
source§

fn sub(self, other: &Self) -> Self

Performs the - operation. Read more
source§

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

§

type Output = Fp<P, N>

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a mut Self) -> Self

Performs the - operation. Read more
source§

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

§

type Output = Fp<P, N>

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
source§

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

source§

fn sub_assign(&mut self, other: &Self)

Performs the -= operation. Read more
source§

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

source§

fn sub_assign(&mut self, other: &'a mut Self)

Performs the -= operation. Read more
source§

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

source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
source§

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

source§

fn sum<I: Iterator<Item = &'a Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

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

source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl<P: FpConfig<N>, const N: usize> Valid for Fp<P, 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: FpConfig<N>, const N: usize> Zero for Fp<P, N>

source§

fn zero() -> Self

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: FpConfig<N>, const N: usize> Zeroize for Fp<P, 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: FpConfig<N>, const N: usize> Copy for Fp<P, N>

source§

impl<P: FpConfig<N>, 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§

fn hash<H>(&self) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>
where H: Digest,

source§

fn hash_uncompressed<H>( &self ) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>
where H: Digest,

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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

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,

§

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>,

§

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>,

§

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

impl<T> UniformRand for T

§

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

§

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

§

fn vzip(self) -> V