Struct lambdaworks_math::field::test_fields::u64_test_field::U64Field
source · pub struct U64Field<const MODULUS: u64>;
Trait Implementations§
source§impl HasQuadraticNonResidue<U64Field<18446744069414584321>> for TestNonResidue
impl HasQuadraticNonResidue<U64Field<18446744069414584321>> for TestNonResidue
fn residue() -> FieldElement<U64TestField>
source§impl<const MODULUS: u64> IsField for U64Field<MODULUS>
impl<const MODULUS: u64> IsField for U64Field<MODULUS>
type BaseType = u64
source§fn eq(a: &u64, b: &u64) -> bool
fn eq(a: &u64, b: &u64) -> bool
Returns a boolean indicating whether
a
and b
are equal or not.source§fn from_u64(x: u64) -> u64
fn from_u64(x: u64) -> u64
Returns the element
x * 1
where 1 is the multiplicative neutral element.source§fn from_base_type(x: u64) -> u64
fn from_base_type(x: u64) -> u64
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: u64> IsPrimeField for U64Field<MODULUS>
impl<const MODULUS: u64> IsPrimeField for U64Field<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
type RepresentativeType = u64
source§fn representative(x: &u64) -> u64
fn representative(x: &u64) -> u64
Returns the integer representative in
the range [0, p-1], where p the modulus
source§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::InvalidHexString
if the value is not a hexstringfn modulus_minus_one() -> Self::RepresentativeType
fn legendre_symbol(a: &Self::BaseType) -> LegendreSymbol
impl<const MODULUS: u64> Eq for U64Field<MODULUS>
impl<const MODULUS: u64> StructuralPartialEq for U64Field<MODULUS>
Auto Trait Implementations§
impl<const MODULUS: u64> Freeze for U64Field<MODULUS>
impl<const MODULUS: u64> RefUnwindSafe for U64Field<MODULUS>
impl<const MODULUS: u64> Send for U64Field<MODULUS>
impl<const MODULUS: u64> Sync for U64Field<MODULUS>
impl<const MODULUS: u64> Unpin for U64Field<MODULUS>
impl<const MODULUS: u64> UnwindSafe for U64Field<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