Struct lambdaworks_math::field::fields::montgomery_backed_prime_fields::MontgomeryBackendPrimeField
source · 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<M, const NUM_LIMBS: usize> IsField for MontgomeryBackendPrimeField<M, NUM_LIMBS>where
M: IsModulus<UnsignedInteger<NUM_LIMBS>> + Clone + Debug,
impl<M, const NUM_LIMBS: usize> IsField for MontgomeryBackendPrimeField<M, NUM_LIMBS>where M: IsModulus<UnsignedInteger<NUM_LIMBS>> + Clone + Debug,
§type BaseType = UnsignedInteger<NUM_LIMBS>
type BaseType = UnsignedInteger<NUM_LIMBS>
The underlying base type for representing elements from the field.
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 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>where
M: IsModulus<UnsignedInteger<NUM_LIMBS>> + Clone + Debug,
impl<M, const NUM_LIMBS: usize> IsPrimeField for MontgomeryBackendPrimeField<M, NUM_LIMBS>where M: IsModulus<UnsignedInteger<NUM_LIMBS>> + Clone + Debug,
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> 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