Struct ark_test_curves::Fp2ConfigWrapper
source · pub struct Fp2ConfigWrapper<P>(_)
where
P: Fp2Config;
Expand description
Wrapper for Fp2Config
, allowing combination of the Fp2Config
and QuadExtConfig
traits.
Trait Implementations§
source§impl<P> QuadExtConfig for Fp2ConfigWrapper<P>where
P: Fp2Config,
impl<P> QuadExtConfig for Fp2ConfigWrapper<P>where P: Fp2Config,
§type BasePrimeField = <P as Fp2Config>::Fp
type BasePrimeField = <P as Fp2Config>::Fp
The prime field that this quadratic extension is eventually an extension of.
§type BaseField = <P as Fp2Config>::Fp
type BaseField = <P as Fp2Config>::Fp
The base field that this field is a quadratic extension of. Read more
§type FrobCoeff = <P as Fp2Config>::Fp
type FrobCoeff = <P as Fp2Config>::Fp
The type of the coefficients for an efficient implemntation of the
Frobenius endomorphism.
source§const DEGREE_OVER_BASE_PRIME_FIELD: usize = 2usize
const DEGREE_OVER_BASE_PRIME_FIELD: usize = 2usize
The degree of the extension over the base prime field.
source§const NONRESIDUE: <Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField = P::NONRESIDUE
const NONRESIDUE: <Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField = P::NONRESIDUE
The quadratic non-residue used to construct the extension.
source§const FROBENIUS_COEFF_C1: &'static [<Fp2ConfigWrapper<P> as QuadExtConfig>::FrobCoeff] = P::FROBENIUS_COEFF_FP2_C1
const FROBENIUS_COEFF_C1: &'static [<Fp2ConfigWrapper<P> as QuadExtConfig>::FrobCoeff] = P::FROBENIUS_COEFF_FP2_C1
Coefficients for the Frobenius automorphism.
source§fn mul_base_field_by_nonresidue_in_place(
fe: &mut <Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField
) -> &mut <Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField
fn mul_base_field_by_nonresidue_in_place( fe: &mut <Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField ) -> &mut <Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField
A specializable method for multiplying an element of the base field by
the quadratic non-residue. This is used in Karatsuba multiplication
and in complex squaring.
source§fn mul_base_field_by_nonresidue_and_add(
y: &mut <Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField,
x: &<Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField
)
fn mul_base_field_by_nonresidue_and_add( y: &mut <Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField, x: &<Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField )
A specializable method for setting
y = x + NONRESIDUE * y
.
This allows for optimizations when the non-residue is
canonically negative in the field.source§fn mul_base_field_by_nonresidue_plus_one_and_add(
y: &mut <Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField,
x: &<Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField
)
fn mul_base_field_by_nonresidue_plus_one_and_add( y: &mut <Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField, x: &<Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField )
A specializable method for computing x + mul_base_field_by_nonresidue(y) + y
This allows for optimizations when the non-residue is not -1.
source§fn sub_and_mul_base_field_by_nonresidue(
y: &mut <Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField,
x: &<Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField
)
fn sub_and_mul_base_field_by_nonresidue( y: &mut <Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField, x: &<Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField )
A specializable method for computing x - mul_base_field_by_nonresidue(y)
This allows for optimizations when the non-residue is
canonically negative in the field.
source§fn mul_base_field_by_frob_coeff(
fe: &mut <Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField,
power: usize
)
fn mul_base_field_by_frob_coeff( fe: &mut <Fp2ConfigWrapper<P> as QuadExtConfig>::BaseField, power: usize )
A specializable method for multiplying an element of the base field by
the appropriate Frobenius coefficient.