pub struct QuadraticExtensionField<F, T>where
F: IsField,
T: HasQuadraticNonResidue<F>,{ /* private fields */ }Expand description
A general quadratic extension field over F
with quadratic non residue Q::residue()
Trait Implementations§
source§impl<F, T> Clone for QuadraticExtensionField<F, T>
impl<F, T> Clone for QuadraticExtensionField<F, T>
source§fn clone(&self) -> QuadraticExtensionField<F, T>
fn clone(&self) -> QuadraticExtensionField<F, T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<F, T> Debug for QuadraticExtensionField<F, T>
impl<F, T> Debug for QuadraticExtensionField<F, T>
source§impl<F, Q> IsField for QuadraticExtensionField<F, Q>
impl<F, Q> IsField for QuadraticExtensionField<F, Q>
source§fn add(
a: &[FieldElement<F>; 2],
b: &[FieldElement<F>; 2]
) -> [FieldElement<F>; 2]
fn add( a: &[FieldElement<F>; 2], b: &[FieldElement<F>; 2] ) -> [FieldElement<F>; 2]
Returns the component wise addition of a and b
source§fn mul(
a: &[FieldElement<F>; 2],
b: &[FieldElement<F>; 2]
) -> [FieldElement<F>; 2]
fn mul( a: &[FieldElement<F>; 2], b: &[FieldElement<F>; 2] ) -> [FieldElement<F>; 2]
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>; 2],
b: &[FieldElement<F>; 2]
) -> [FieldElement<F>; 2]
fn sub( a: &[FieldElement<F>; 2], b: &[FieldElement<F>; 2] ) -> [FieldElement<F>; 2]
Returns the component wise subtraction of a and b
source§fn neg(a: &[FieldElement<F>; 2]) -> [FieldElement<F>; 2]
fn neg(a: &[FieldElement<F>; 2]) -> [FieldElement<F>; 2]
Returns the component wise negation of a
source§fn inv(a: &[FieldElement<F>; 2]) -> Result<[FieldElement<F>; 2], FieldError>
fn inv(a: &[FieldElement<F>; 2]) -> Result<[FieldElement<F>; 2], FieldError>
Returns the multiplicative inverse of a
This uses the equality (a0 + a1 * t) * (a0 - a1 * t) = a0.pow(2) - a1.pow(2) * Q::residue()
source§fn div(
a: &[FieldElement<F>; 2],
b: &[FieldElement<F>; 2]
) -> [FieldElement<F>; 2]
fn div( a: &[FieldElement<F>; 2], b: &[FieldElement<F>; 2] ) -> [FieldElement<F>; 2]
Returns the division of a and b
source§fn eq(a: &[FieldElement<F>; 2], b: &[FieldElement<F>; 2]) -> bool
fn eq(a: &[FieldElement<F>; 2], b: &[FieldElement<F>; 2]) -> bool
Returns a boolean indicating whether a and b are equal component wise.
source§fn zero() -> [FieldElement<F>; 2]
fn zero() -> [FieldElement<F>; 2]
Returns the additive neutral element of the field extension.
source§fn one() -> [FieldElement<F>; 2]
fn one() -> [FieldElement<F>; 2]
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>; 2]) -> [FieldElement<F>; 2]
fn from_base_type(x: [FieldElement<F>; 2]) -> [FieldElement<F>; 2]
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>; 2]
source§fn square(a: &[FieldElement<F>; 2]) -> [FieldElement<F>; 2]
fn square(a: &[FieldElement<F>; 2]) -> [FieldElement<F>; 2]
a and a.fn pow<T>(a: &Self::BaseType, exponent: T) -> Self::BaseTypewhere
T: IsUnsignedInteger,
source§impl<F, T> PartialEq for QuadraticExtensionField<F, T>
impl<F, T> PartialEq for QuadraticExtensionField<F, T>
source§fn eq(&self, other: &QuadraticExtensionField<F, T>) -> bool
fn eq(&self, other: &QuadraticExtensionField<F, T>) -> bool
self and other values to be equal, and is used
by ==.