Struct lambdaworks_math::field::test_fields::u32_test_field::U32Field
source · pub struct U32Field<const MODULUS: u32>;
Trait Implementations§
source§impl<const MODULUS: u32> IsField for U32Field<MODULUS>
impl<const MODULUS: u32> IsField for U32Field<MODULUS>
type BaseType = u32
source§fn eq(a: &u32, b: &u32) -> bool
fn eq(a: &u32, b: &u32) -> bool
Returns a boolean indicating whether
a
and b
are equal or not.source§fn from_u64(x: u64) -> u32
fn from_u64(x: u64) -> u32
Returns the element
x * 1
where 1 is the multiplicative neutral element.source§fn from_base_type(x: u32) -> u32
fn from_base_type(x: u32) -> u32
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<const MODULUS: u32> IsPrimeField for U32Field<MODULUS>
impl<const MODULUS: u32> IsPrimeField for U32Field<MODULUS>
source§fn field_bit_size() -> usize
fn field_bit_size() -> usize
Returns how many bits do you need to represent the biggest field element It expects the MODULUS to be a Prime
source§fn from_hex(hex_string: &str) -> Result<Self::BaseType, CreationError>
fn from_hex(hex_string: &str) -> Result<Self::BaseType, CreationError>
Unimplemented for test fields
type RepresentativeType = u32
source§fn representative(a: &Self::BaseType) -> u32
fn representative(a: &Self::BaseType) -> u32
Returns the integer representative in
the range [0, p-1], where p the modulus
fn modulus_minus_one() -> Self::RepresentativeType
fn legendre_symbol(a: &Self::BaseType) -> LegendreSymbol
impl<const MODULUS: u32> Eq for U32Field<MODULUS>
impl<const MODULUS: u32> StructuralPartialEq for U32Field<MODULUS>
Auto Trait Implementations§
impl<const MODULUS: u32> Freeze for U32Field<MODULUS>
impl<const MODULUS: u32> RefUnwindSafe for U32Field<MODULUS>
impl<const MODULUS: u32> Send for U32Field<MODULUS>
impl<const MODULUS: u32> Sync for U32Field<MODULUS>
impl<const MODULUS: u32> Unpin for U32Field<MODULUS>
impl<const MODULUS: u32> UnwindSafe for U32Field<MODULUS>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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