Struct lambdaworks_math::field::extensions::cubic::CubicExtensionField
source · pub struct CubicExtensionField<F, T> { /* private fields */ }
Expand description
A general cubic extension field over F
with cubic non residue Q::residue()
Trait Implementations§
source§impl<F: Clone, T: Clone> Clone for CubicExtensionField<F, T>
impl<F: Clone, T: Clone> Clone for CubicExtensionField<F, T>
source§fn clone(&self) -> CubicExtensionField<F, T>
fn clone(&self) -> CubicExtensionField<F, T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl HasQuadraticNonResidue<CubicExtensionField<Degree2ExtensionField, LevelTwoResidue>> for LevelThreeResidue
impl HasQuadraticNonResidue<CubicExtensionField<Degree2ExtensionField, LevelTwoResidue>> for LevelThreeResidue
source§impl HasQuadraticNonResidue<CubicExtensionField<QuadraticExtensionField<MontgomeryBackendPrimeField<BN254FieldModulus, 4>, BN254Residue>, LevelTwoResidue>> for LevelThreeResidue
impl HasQuadraticNonResidue<CubicExtensionField<QuadraticExtensionField<MontgomeryBackendPrimeField<BN254FieldModulus, 4>, BN254Residue>, LevelTwoResidue>> for LevelThreeResidue
source§impl<F, Q> IsField for CubicExtensionField<F, Q>
impl<F, Q> IsField for CubicExtensionField<F, Q>
source§fn add(
a: &[FieldElement<F>; 3],
b: &[FieldElement<F>; 3],
) -> [FieldElement<F>; 3]
fn add( a: &[FieldElement<F>; 3], b: &[FieldElement<F>; 3], ) -> [FieldElement<F>; 3]
Returns the component wise addition of a
and b
source§fn mul(
a: &[FieldElement<F>; 3],
b: &[FieldElement<F>; 3],
) -> [FieldElement<F>; 3]
fn mul( a: &[FieldElement<F>; 3], b: &[FieldElement<F>; 3], ) -> [FieldElement<F>; 3]
Returns the multiplication of a
and b
using the following
equation:
(a0 + a1 * t) * (b0 + b1 * t) = a0 * b0 + a1 * b1 * Q::residue() + (a0 * b1 + a1 * b0) * t
where t.pow(2)
equals Q::residue()
.
source§fn sub(
a: &[FieldElement<F>; 3],
b: &[FieldElement<F>; 3],
) -> [FieldElement<F>; 3]
fn sub( a: &[FieldElement<F>; 3], b: &[FieldElement<F>; 3], ) -> [FieldElement<F>; 3]
Returns the component wise subtraction of a
and b
source§fn neg(a: &[FieldElement<F>; 3]) -> [FieldElement<F>; 3]
fn neg(a: &[FieldElement<F>; 3]) -> [FieldElement<F>; 3]
Returns the component wise negation of a
source§fn inv(a: &[FieldElement<F>; 3]) -> Result<[FieldElement<F>; 3], FieldError>
fn inv(a: &[FieldElement<F>; 3]) -> Result<[FieldElement<F>; 3], FieldError>
Returns the multiplicative inverse of a
source§fn div(
a: &[FieldElement<F>; 3],
b: &[FieldElement<F>; 3],
) -> [FieldElement<F>; 3]
fn div( a: &[FieldElement<F>; 3], b: &[FieldElement<F>; 3], ) -> [FieldElement<F>; 3]
Returns the division of a
and b
source§fn eq(a: &[FieldElement<F>; 3], b: &[FieldElement<F>; 3]) -> bool
fn eq(a: &[FieldElement<F>; 3], b: &[FieldElement<F>; 3]) -> bool
Returns a boolean indicating whether a
and b
are equal component wise.
source§fn zero() -> [FieldElement<F>; 3]
fn zero() -> [FieldElement<F>; 3]
Returns the additive neutral element of the field extension.
source§fn one() -> [FieldElement<F>; 3]
fn one() -> [FieldElement<F>; 3]
Returns the multiplicative neutral element of the field extension.
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: [FieldElement<F>; 3]) -> [FieldElement<F>; 3]
fn from_base_type(x: [FieldElement<F>; 3]) -> [FieldElement<F>; 3]
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<F>; 3]
fn pow<T>(a: &Self::BaseType, exponent: T) -> Self::BaseTypewhere
T: IsUnsignedInteger,
impl<F: Eq, T: Eq> Eq for CubicExtensionField<F, T>
impl<F, T> StructuralPartialEq for CubicExtensionField<F, T>
Auto Trait Implementations§
impl<F, T> Freeze for CubicExtensionField<F, T>
impl<F, T> RefUnwindSafe for CubicExtensionField<F, T>where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<F, T> Send for CubicExtensionField<F, T>
impl<F, T> Sync for CubicExtensionField<F, T>
impl<F, T> Unpin for CubicExtensionField<F, T>
impl<F, T> UnwindSafe for CubicExtensionField<F, T>where
F: UnwindSafe,
T: 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
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)
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>
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>
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