Fp

Struct Fp 

Source
pub struct Fp<P: FpParams<N>, const N: usize> { /* private fields */ }
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<P: FpParams<N>, const N: usize> Fp<P, N>

Source

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

A multiplicative generator of the field. Self::GENERATOR is an element having multiplicative order MODULUS - 1.

Every element of the field should be represented as GENERATOR^i

Source

pub const ONE: Fp<P, N>

Multiplicative identity of the field, i.e., the element e such that, for all elements f of the field, e * f = f.

Source

pub const ZERO: Fp<P, N>

Additive identity of the field, i.e., the element e such that, for all elements f of the field, e + f = f.

Source

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

Construct a new field element from Uint.

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

Source

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

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

Source

pub const fn mul(&self, rhs: &Self) -> Self

Multiply self to rhs and return the result (constant).

Implements the Montgomery multiplication algorithm reference.

Source

pub const fn neg(self) -> Self

Negate self and return the result (constant).

Source

pub const fn is_zero(&self) -> bool

Returns true if this number is zero (constant).

Source

pub const fn from_fp<P2: FpParams<N2>, const N2: usize>( value: Fp<P2, N2>, ) -> Self

Construct Self from the other Fp element of different size (constant).

§Panics
  • If value is bigger than Self maximum size.
Source

pub const fn from_bigint(num: Uint<N>) -> Self

Construct a field element from an integer (constant).

By the end element will be converted to a montgomery form and reduced.

Source

pub const fn into_bigint(self) -> Uint<N>

Convert a field element to an integer less than Self::MODULUS (constant).

Trait Implementations§

Source§

impl<P: FpParams<N>, const N: usize> Add<&Fp<P, N>> for &Fp<P, 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<P: FpParams<N>, const N: usize> Add<&Fp<P, N>> for Fp<P, N>

Source§

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<P: FpParams<N>, const N: usize> Add<&mut Fp<P, N>> for Fp<P, N>

Source§

type Output = Fp<P, N>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

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

Source§

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<P: FpParams<N>, const N: usize> AddAssign<&Fp<P, N>> for Fp<P, N>

Source§

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

Performs the += operation. Read more
Source§

impl<P: FpParams<N>, const N: usize> AddAssign<&mut Fp<P, N>> for Fp<P, N>

Source§

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

Performs the += operation. Read more
Source§

impl<P: FpParams<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: FpParams<N>, const N: usize> AdditiveGroup for Fp<P, N>

Source§

const ZERO: Self = Self::ZERO

Additive identity of the group.
Source§

type Scalar = Fp<P, N>

Scalar associated with the group.
Source§

fn double(&self) -> Self

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

impl<P: FpParams<N>, const N: usize> Clone for Fp<P, N>
where Uint<N>: Copy, PhantomData<P>: Copy,

Source§

fn clone(&self) -> Self

Returns a duplicate 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: FpParams<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: FpParams<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: FpParams<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<'_>) -> Result

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

impl<P: FpParams<N>, const N: usize> Div<&Fp<P, N>> for &Fp<P, 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<P: FpParams<N>, const N: usize> Div<&Fp<P, N>> for Fp<P, N>

Source§

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<P: FpParams<N>, const N: usize> Div<&mut Fp<P, N>> for Fp<P, N>

Source§

type Output = Fp<P, N>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

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

Source§

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<P: FpParams<N>, const N: usize> DivAssign<&Fp<P, N>> for Fp<P, N>

Source§

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

Performs the /= operation. Read more
Source§

impl<P: FpParams<N>, const N: usize> DivAssign<&mut Fp<P, N>> for Fp<P, N>

Source§

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

Performs the /= operation. Read more
Source§

impl<P: FpParams<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: FpParams<N>, const N: usize> Field for Fp<P, N>

Source§

const ONE: Self

The multiplicative identity of the field.
Source§

fn extension_degree() -> usize

Returns the extension degree of this field.
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 pow<S: BitIteratorBE>(&self, exp: S) -> Self

Returns self^exp, where exp is an integer. Read more
Source§

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

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

impl<P: FpParams<1>> From<Fp<P, 1>> for i128

Source§

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

Converts to this type from the input type.
Source§

impl<P: FpParams<1>> From<Fp<P, 1>> for i16

Source§

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

Converts to this type from the input type.
Source§

impl<P: FpParams<1>> From<Fp<P, 1>> for i32

Source§

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

Converts to this type from the input type.
Source§

impl<P: FpParams<1>> From<Fp<P, 1>> for i64

Source§

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

Converts to this type from the input type.
Source§

impl<P: FpParams<1>> From<Fp<P, 1>> for i8

Source§

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

Converts to this type from the input type.
Source§

impl<P: FpParams<1>> From<Fp<P, 1>> for u128

Source§

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

Converts to this type from the input type.
Source§

impl<P: FpParams<1>> From<Fp<P, 1>> for u16

Source§

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

Converts to this type from the input type.
Source§

impl<P: FpParams<1>> From<Fp<P, 1>> for u32

Source§

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

Converts to this type from the input type.
Source§

impl<P: FpParams<1>> From<Fp<P, 1>> for u64

Source§

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

Converts to this type from the input type.
Source§

impl<P: FpParams<1>> From<Fp<P, 1>> for u8

Source§

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

Converts to this type from the input type.
Source§

impl<P: FpParams<N>, const N: usize> From<Fp<P, N>> for Uint<N>

Source§

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

Converts to this type from the input type.
Source§

impl<P: FpParams<N>, const N: usize> From<Uint<N>> for Fp<P, N>

Source§

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

Converts to this type from the input type.
Source§

impl<P: FpParams<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: FpParams<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: FpParams<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: FpParams<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: FpParams<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: FpParams<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: FpParams<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: FpParams<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: FpParams<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: FpParams<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: FpParams<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: FpParams<N>, const N: usize> Hash for Fp<P, N>
where Uint<N>: Hash, PhantomData<P>: Hash,

Source§

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

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

Source§

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<P: FpParams<N>, const N: usize> Mul<&mut Fp<P, N>> for Fp<P, N>

Source§

type Output = Fp<P, N>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

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

Source§

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<P: FpParams<N>, const N: usize> MulAssign<&Fp<P, N>> for Fp<P, N>

Source§

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

Performs the *= operation. Read more
Source§

impl<P: FpParams<N>, const N: usize> MulAssign<&mut Fp<P, N>> for Fp<P, N>

Source§

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

Performs the *= operation. Read more
Source§

impl<P: FpParams<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: FpParams<N>, const N: usize> Neg for Fp<P, N>

Source§

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

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,

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

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

Source§

fn eq(&self, other: &Self) -> 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: FpParams<N>, const N: usize> PartialOrd for Fp<P, N>

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

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 PoseidonParams<Fp<BLS12Param, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>> for BLS2Params

Source§

const T: usize = 2usize

State size.
Source§

const D: u8 = 5u8

Sbox degree.
Source§

const CAPACITY: usize = 1usize

Capacity of the sponge construction. Determines the number of elements not affected directly by input or not reflected in the output of the sponge hash function.
Source§

const ROUNDS_F: usize = 8usize

Number of full rounds.
Source§

const ROUNDS_P: usize = 56usize

Number of partial rounds.
Source§

const MAT_INTERNAL_DIAG_M_1: &'static [FpBLS12]

MDS (Maximum Distance Separable) matrix used in the Poseidon permutation.
Source§

const ROUND_CONSTANTS: &'static [&'static [FpBLS12]]

The round constants used in the full and partial rounds of the Poseidon permutation.
Source§

impl PoseidonParams<Fp<BLS12Param, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>> for BLS3Params

Source§

const T: usize = 3usize

State size.
Source§

const D: u8 = 5u8

Sbox degree.
Source§

const CAPACITY: usize = 1usize

Capacity of the sponge construction. Determines the number of elements not affected directly by input or not reflected in the output of the sponge hash function.
Source§

const ROUNDS_F: usize = 8usize

Number of full rounds.
Source§

const ROUNDS_P: usize = 56usize

Number of partial rounds.
Source§

const MAT_INTERNAL_DIAG_M_1: &'static [FpBLS12]

MDS (Maximum Distance Separable) matrix used in the Poseidon permutation.
Source§

const ROUND_CONSTANTS: &'static [&'static [FpBLS12]]

The round constants used in the full and partial rounds of the Poseidon permutation.
Source§

impl PoseidonParams<Fp<BLS12Param, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>> for BLS4Params

Source§

const T: usize = 4usize

State size.
Source§

const D: u8 = 5u8

Sbox degree.
Source§

const CAPACITY: usize = 1usize

Capacity of the sponge construction. Determines the number of elements not affected directly by input or not reflected in the output of the sponge hash function.
Source§

const ROUNDS_F: usize = 8usize

Number of full rounds.
Source§

const ROUNDS_P: usize = 56usize

Number of partial rounds.
Source§

const MAT_INTERNAL_DIAG_M_1: &'static [FpBLS12]

MDS (Maximum Distance Separable) matrix used in the Poseidon permutation.
Source§

const ROUND_CONSTANTS: &'static [&'static [FpBLS12]]

The round constants used in the full and partial rounds of the Poseidon permutation.
Source§

impl PoseidonParams<Fp<BN256Param, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>> for BN256Params

Source§

const T: usize = 3usize

State size.
Source§

const D: u8 = 5u8

Sbox degree.
Source§

const CAPACITY: usize = 1usize

Capacity of the sponge construction. Determines the number of elements not affected directly by input or not reflected in the output of the sponge hash function.
Source§

const ROUNDS_F: usize = 8usize

Number of full rounds.
Source§

const ROUNDS_P: usize = 56usize

Number of partial rounds.
Source§

const MAT_INTERNAL_DIAG_M_1: &'static [FpBN256]

MDS (Maximum Distance Separable) matrix used in the Poseidon permutation.
Source§

const ROUND_CONSTANTS: &'static [&'static [FpBN256]]

The round constants used in the full and partial rounds of the Poseidon permutation.
Source§

impl PoseidonParams<Fp<BabyBearParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>> for BabyBear24Params

Source§

const T: usize = 24usize

State size.
Source§

const D: u8 = 7u8

Sbox degree.
Source§

const CAPACITY: usize = 4usize

Capacity of the sponge construction. Determines the number of elements not affected directly by input or not reflected in the output of the sponge hash function.
Source§

const ROUNDS_F: usize = 8usize

Number of full rounds.
Source§

const ROUNDS_P: usize = 21usize

Number of partial rounds.
Source§

const MAT_INTERNAL_DIAG_M_1: &'static [FpBabyBear]

MDS (Maximum Distance Separable) matrix used in the Poseidon permutation.
Source§

const ROUND_CONSTANTS: &'static [&'static [FpBabyBear]]

The round constants used in the full and partial rounds of the Poseidon permutation.
Source§

impl PoseidonParams<Fp<GoldiLocksParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>> for Goldilocks12Params

Source§

const T: usize = 12usize

State size.
Source§

const D: u8 = 7u8

Sbox degree.
Source§

const CAPACITY: usize = 4usize

Capacity of the sponge construction. Determines the number of elements not affected directly by input or not reflected in the output of the sponge hash function.
Source§

const ROUNDS_F: usize = 8usize

Number of full rounds.
Source§

const ROUNDS_P: usize = 22usize

Number of partial rounds.
Source§

const MAT_INTERNAL_DIAG_M_1: &'static [FpGoldiLocks]

MDS (Maximum Distance Separable) matrix used in the Poseidon permutation.
Source§

const ROUND_CONSTANTS: &'static [&'static [FpGoldiLocks]]

The round constants used in the full and partial rounds of the Poseidon permutation.
Source§

impl PoseidonParams<Fp<PallasParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>> for PallasParams

Source§

const T: usize = 3usize

State size.
Source§

const D: u8 = 5u8

Sbox degree.
Source§

const CAPACITY: usize = 1usize

Capacity of the sponge construction. Determines the number of elements not affected directly by input or not reflected in the output of the sponge hash function.
Source§

const ROUNDS_F: usize = 8usize

Number of full rounds.
Source§

const ROUNDS_P: usize = 56usize

Number of partial rounds.
Source§

const MAT_INTERNAL_DIAG_M_1: &'static [FpPallas]

MDS (Maximum Distance Separable) matrix used in the Poseidon permutation.
Source§

const ROUND_CONSTANTS: &'static [&'static [FpPallas]]

The round constants used in the full and partial rounds of the Poseidon permutation.
Source§

impl PoseidonParams<Fp<VestaParam, { usize::div_ceil( $bits, $crate::arithmetic::limb::Limb::BITS as usize, ) }>> for VestaParams

Source§

const T: usize = 3usize

State size.
Source§

const D: u8 = 5u8

Sbox degree.
Source§

const CAPACITY: usize = 1usize

Capacity of the sponge construction. Determines the number of elements not affected directly by input or not reflected in the output of the sponge hash function.
Source§

const ROUNDS_F: usize = 8usize

Number of full rounds.
Source§

const ROUNDS_P: usize = 56usize

Number of partial rounds.
Source§

const MAT_INTERNAL_DIAG_M_1: &'static [FpVesta]

MDS (Maximum Distance Separable) matrix used in the Poseidon permutation.
Source§

const ROUND_CONSTANTS: &'static [&'static [FpVesta]]

The round constants used in the full and partial rounds of the Poseidon permutation.
Source§

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

Source§

const HAS_MODULUS_SPARE_BIT: bool = P::HAS_MODULUS_SPARE_BIT

Self::MODULUS has a spare bit in the most significant limb.
Source§

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

The modulus p.
Source§

const MODULUS_BIT_SIZE: usize = <Uint<N> as BigInteger>::BITS

The size of the modulus in bits.
Source§

type BigInt = Uint<N>

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

fn from_bigint(repr: Self::BigInt) -> Self

Construct a prime field element from a big integer.
Source§

fn into_bigint(self) -> Uint<N>

Converts an element of the prime field into an integer less than Self::MODULUS.
Source§

fn characteristic() -> Self::BigInt

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

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

Source§

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

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

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

Source§

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

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

impl<P: FpParams<N>, const N: usize> Sub<&Fp<P, N>> for &Fp<P, 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<P: FpParams<N>, const N: usize> Sub<&Fp<P, N>> for Fp<P, N>

Source§

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<P: FpParams<N>, const N: usize> Sub<&mut Fp<P, N>> for Fp<P, N>

Source§

type Output = Fp<P, N>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

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

Source§

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<P: FpParams<N>, const N: usize> SubAssign<&Fp<P, N>> for Fp<P, N>

Source§

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

Performs the -= operation. Read more
Source§

impl<P: FpParams<N>, const N: usize> SubAssign<&mut Fp<P, N>> for Fp<P, N>

Source§

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

Performs the -= operation. Read more
Source§

impl<P: FpParams<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: FpParams<N>, const N: usize> Sum<&'a Fp<P, N>> for Fp<P, N>

Source§

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

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

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

Source§

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

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

impl<P: FpParams<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: FpParams<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: FpParams<N>, const N: usize> Copy for Fp<P, N>
where Uint<N>: Copy, PhantomData<P>: Copy,

Source§

impl<P: FpParams<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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
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§

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.