pub struct MontgomeryBackendPrimeField<M, const NUM_LIMBS: usize> { /* private fields */ }Implementations§
Source§impl<M, const NUM_LIMBS: usize> MontgomeryBackendPrimeField<M, NUM_LIMBS>where
M: IsModulus<UnsignedInteger<NUM_LIMBS>>,
impl<M, const NUM_LIMBS: usize> MontgomeryBackendPrimeField<M, NUM_LIMBS>where
M: IsModulus<UnsignedInteger<NUM_LIMBS>>,
pub const R2: UnsignedInteger<NUM_LIMBS>
pub const MU: u64
pub const ZERO: UnsignedInteger<NUM_LIMBS>
pub const ONE: UnsignedInteger<NUM_LIMBS>
Trait Implementations§
Source§impl<M: Clone, const NUM_LIMBS: usize> Clone for MontgomeryBackendPrimeField<M, NUM_LIMBS>
impl<M: Clone, const NUM_LIMBS: usize> Clone for MontgomeryBackendPrimeField<M, NUM_LIMBS>
Source§fn clone(&self) -> MontgomeryBackendPrimeField<M, NUM_LIMBS>
fn clone(&self) -> MontgomeryBackendPrimeField<M, NUM_LIMBS>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl HasQuadraticNonResidue<MontgomeryBackendPrimeField<BLS12377FieldModulus, 6>> for BLS12377Residue
impl HasQuadraticNonResidue<MontgomeryBackendPrimeField<BLS12377FieldModulus, 6>> for BLS12377Residue
fn residue() -> FieldElement<BLS12377PrimeField>
Source§impl HasQuadraticNonResidue<MontgomeryBackendPrimeField<BN254FieldModulus, 4>> for BN254Residue
impl HasQuadraticNonResidue<MontgomeryBackendPrimeField<BN254FieldModulus, 4>> for BN254Residue
fn residue() -> FieldElement<BN254PrimeField>
Source§impl HasQuadraticNonResidue<MontgomeryBackendPrimeField<MontgomeryConfigBabybear31PrimeField, 1>> for Babybear31PrimeField
impl HasQuadraticNonResidue<MontgomeryBackendPrimeField<MontgomeryConfigBabybear31PrimeField, 1>> for Babybear31PrimeField
Source§impl HasQuadraticNonResidue<MontgomeryBackendPrimeField<TestCurve2Modulus, 6>> for TestCurve2QuadraticNonResidue
impl HasQuadraticNonResidue<MontgomeryBackendPrimeField<TestCurve2Modulus, 6>> for TestCurve2QuadraticNonResidue
Source§impl<M, const NUM_LIMBS: usize> IsField for MontgomeryBackendPrimeField<M, NUM_LIMBS>
impl<M, const NUM_LIMBS: usize> IsField for MontgomeryBackendPrimeField<M, NUM_LIMBS>
type BaseType = UnsignedInteger<NUM_LIMBS>
Source§fn mul(a: &Self::BaseType, b: &Self::BaseType) -> Self::BaseType
fn mul(a: &Self::BaseType, b: &Self::BaseType) -> Self::BaseType
Returns the multiplication of
a and b.Source§fn square(a: &UnsignedInteger<NUM_LIMBS>) -> UnsignedInteger<NUM_LIMBS>
fn square(a: &UnsignedInteger<NUM_LIMBS>) -> UnsignedInteger<NUM_LIMBS>
Returns the multiplication of
a and a.Source§fn sub(a: &Self::BaseType, b: &Self::BaseType) -> Self::BaseType
fn sub(a: &Self::BaseType, b: &Self::BaseType) -> Self::BaseType
Returns the subtraction of
a and b.Source§fn inv(a: &Self::BaseType) -> Result<Self::BaseType, FieldError>
fn inv(a: &Self::BaseType) -> Result<Self::BaseType, FieldError>
Returns the multiplicative inverse of
a.Source§fn div(a: &Self::BaseType, b: &Self::BaseType) -> Self::BaseType
fn div(a: &Self::BaseType, b: &Self::BaseType) -> Self::BaseType
Returns the division of
a and b.Source§fn eq(a: &Self::BaseType, b: &Self::BaseType) -> bool
fn eq(a: &Self::BaseType, b: &Self::BaseType) -> bool
Returns a boolean indicating whether
a and b are equal or not.Source§fn from_u64(x: u64) -> Self::BaseType
fn from_u64(x: u64) -> Self::BaseType
Returns the element
x * 1 where 1 is the multiplicative neutral element.Source§fn from_base_type(x: Self::BaseType) -> Self::BaseType
fn from_base_type(x: Self::BaseType) -> Self::BaseType
Takes as input an element of BaseType and returns the internal representation
of that element in the field.
fn pow<T>(a: &Self::BaseType, exponent: T) -> Self::BaseTypewhere
T: IsUnsignedInteger,
Source§impl<M, const NUM_LIMBS: usize> IsPrimeField for MontgomeryBackendPrimeField<M, NUM_LIMBS>
impl<M, const NUM_LIMBS: usize> IsPrimeField for MontgomeryBackendPrimeField<M, NUM_LIMBS>
type RepresentativeType = <MontgomeryBackendPrimeField<M, NUM_LIMBS> as IsField>::BaseType
Source§fn representative(x: &Self::BaseType) -> Self::RepresentativeType
fn representative(x: &Self::BaseType) -> Self::RepresentativeType
Returns the integer representative in
the range [0, p-1], where p the modulus
Source§fn field_bit_size() -> usize
fn field_bit_size() -> usize
Returns the number of bits of the max element of the field, as per field documentation, not internal representation.
This is
log2(max FE) rounded upSource§fn from_hex(hex_string: &str) -> Result<Self::BaseType, CreationError>
fn from_hex(hex_string: &str) -> Result<Self::BaseType, CreationError>
Creates a BaseType from a Hex String
0x is optional
Returns an
CreationError::InvalidHexStringif the value is not a hexstringfn modulus_minus_one() -> Self::RepresentativeType
fn legendre_symbol(a: &Self::BaseType) -> LegendreSymbol
impl<M: Copy, const NUM_LIMBS: usize> Copy for MontgomeryBackendPrimeField<M, NUM_LIMBS>
Auto Trait Implementations§
impl<M, const NUM_LIMBS: usize> Freeze for MontgomeryBackendPrimeField<M, NUM_LIMBS>
impl<M, const NUM_LIMBS: usize> RefUnwindSafe for MontgomeryBackendPrimeField<M, NUM_LIMBS>where
M: RefUnwindSafe,
impl<M, const NUM_LIMBS: usize> Send for MontgomeryBackendPrimeField<M, NUM_LIMBS>where
M: Send,
impl<M, const NUM_LIMBS: usize> Sync for MontgomeryBackendPrimeField<M, NUM_LIMBS>where
M: Sync,
impl<M, const NUM_LIMBS: usize> Unpin for MontgomeryBackendPrimeField<M, NUM_LIMBS>where
M: Unpin,
impl<M, const NUM_LIMBS: usize> UnwindSafe for MontgomeryBackendPrimeField<M, NUM_LIMBS>where
M: 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<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