Struct lambdaworks_math::field::fields::mersenne31::extension::Mersenne31Complex
source · pub struct Mersenne31Complex;
Trait Implementations§
source§impl Clone for Mersenne31Complex
impl Clone for Mersenne31Complex
source§fn clone(&self) -> Mersenne31Complex
fn clone(&self) -> Mersenne31Complex
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 Debug for Mersenne31Complex
impl Debug for Mersenne31Complex
source§impl HasCubicNonResidue<Mersenne31Complex> for Mersenne31Complex
impl HasCubicNonResidue<Mersenne31Complex> for Mersenne31Complex
source§fn residue() -> FieldElement<Mersenne31Complex>
fn residue() -> FieldElement<Mersenne31Complex>
This function must return an element that is not a cube in Fp,
that is, a cubic non-residue.
source§impl HasQuadraticNonResidue<Mersenne31Complex> for Mersenne31Complex
impl HasQuadraticNonResidue<Mersenne31Complex> for Mersenne31Complex
fn residue() -> FieldElement<Mersenne31Complex>
source§impl IsField for Mersenne31Complex
impl IsField for Mersenne31Complex
source§fn add(a: &Self::BaseType, b: &Self::BaseType) -> Self::BaseType
fn add(a: &Self::BaseType, b: &Self::BaseType) -> Self::BaseType
Returns the component wise addition of a
and b
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
using the following
equation:
(a0 + a1 * t) * (b0 + b1 * t) = a0 * b0 + a1 * b1 * Self::residue() + (a0 * b1 + a1 * b0) * t
where t.pow(2)
equals Q::residue()
.
source§fn sub(a: &Self::BaseType, b: &Self::BaseType) -> Self::BaseType
fn sub(a: &Self::BaseType, b: &Self::BaseType) -> Self::BaseType
Returns the component wise 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 component wise.
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. Note: for this case this is simply the identity, because the components already have correct representations.
type BaseType = [FieldElement<Mersenne31Field>; 2]
fn pow<T>(a: &Self::BaseType, exponent: T) -> Self::BaseTypewhere
T: IsUnsignedInteger,
Auto Trait Implementations§
impl Freeze for Mersenne31Complex
impl RefUnwindSafe for Mersenne31Complex
impl Send for Mersenne31Complex
impl Sync for Mersenne31Complex
impl Unpin for Mersenne31Complex
impl UnwindSafe for Mersenne31Complex
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