Struct lambdaworks_math::field::test_fields::u64_test_field::U64Field
source · pub struct U64Field<const MODULUS: u64>;Trait Implementations§
source§impl<const MODULUS: u64> IsField for U64Field<MODULUS>
impl<const MODULUS: u64> IsField for U64Field<MODULUS>
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::InvalidHexStringif the value is not a hexstringfn modulus_minus_one() -> Self::RepresentativeType
fn legendre_symbol(a: &Self::BaseType) -> LegendreSymbol
source§impl<const MODULUS: u64> PartialEq<U64Field<MODULUS>> for U64Field<MODULUS>
impl<const MODULUS: u64> PartialEq<U64Field<MODULUS>> for U64Field<MODULUS>
impl<const MODULUS: u64> Eq for U64Field<MODULUS>
impl<const MODULUS: u64> StructuralEq for U64Field<MODULUS>
impl<const MODULUS: u64> StructuralPartialEq for U64Field<MODULUS>
Auto Trait Implementations§
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