Trait ark_ff::fields::models::cubic_extension::CubicExtConfig
source · pub trait CubicExtConfig: 'static + Send + Sync + Sized {
type BasePrimeField: PrimeField;
type BaseField: Field<BasePrimeField = Self::BasePrimeField>;
type FrobCoeff: Field;
const SQRT_PRECOMP: Option<SqrtPrecomputation<CubicExtField<Self>>>;
const DEGREE_OVER_BASE_PRIME_FIELD: usize;
const NONRESIDUE: Self::BaseField;
const FROBENIUS_COEFF_C1: &'static [Self::FrobCoeff];
const FROBENIUS_COEFF_C2: &'static [Self::FrobCoeff];
// Required method
fn mul_base_field_by_frob_coeff(
c1: &mut Self::BaseField,
c2: &mut Self::BaseField,
power: usize
);
// Provided methods
fn mul_base_field_by_nonresidue_in_place(
fe: &mut Self::BaseField
) -> &mut Self::BaseField { ... }
fn mul_base_field_by_nonresidue(fe: Self::BaseField) -> Self::BaseField { ... }
}
Expand description
Defines a Cubic extension field from a cubic non-residue.
Required Associated Types§
sourcetype BasePrimeField: PrimeField
type BasePrimeField: PrimeField
The prime field that this cubic extension is eventually an extension of.
sourcetype BaseField: Field<BasePrimeField = Self::BasePrimeField>
type BaseField: Field<BasePrimeField = Self::BasePrimeField>
The base field that this field is a cubic extension of.
Note: while for simple instances of cubic extensions such as Fp3
we might see BaseField == BasePrimeField
, it won’t always hold true.
E.g. for an extension tower: BasePrimeField == Fp
, but BaseField == Fp2
.
Required Associated Constants§
sourceconst SQRT_PRECOMP: Option<SqrtPrecomputation<CubicExtField<Self>>>
const SQRT_PRECOMP: Option<SqrtPrecomputation<CubicExtField<Self>>>
Determines the algorithm for computing square roots.
sourceconst DEGREE_OVER_BASE_PRIME_FIELD: usize
const DEGREE_OVER_BASE_PRIME_FIELD: usize
The degree of the extension over the base prime field.
sourceconst NONRESIDUE: Self::BaseField
const NONRESIDUE: Self::BaseField
The cubic non-residue used to construct the extension.
sourceconst FROBENIUS_COEFF_C1: &'static [Self::FrobCoeff]
const FROBENIUS_COEFF_C1: &'static [Self::FrobCoeff]
Coefficients for the Frobenius automorphism.
const FROBENIUS_COEFF_C2: &'static [Self::FrobCoeff]
Required Methods§
sourcefn mul_base_field_by_frob_coeff(
c1: &mut Self::BaseField,
c2: &mut Self::BaseField,
power: usize
)
fn mul_base_field_by_frob_coeff( c1: &mut Self::BaseField, c2: &mut Self::BaseField, power: usize )
A specializable method for multiplying an element of the base field by the appropriate Frobenius coefficient.
Provided Methods§
sourcefn mul_base_field_by_nonresidue_in_place(
fe: &mut Self::BaseField
) -> &mut Self::BaseField
fn mul_base_field_by_nonresidue_in_place( fe: &mut Self::BaseField ) -> &mut Self::BaseField
A specializable method for multiplying an element of the base field by the quadratic non-residue. This is used in multiplication and squaring.
sourcefn mul_base_field_by_nonresidue(fe: Self::BaseField) -> Self::BaseField
fn mul_base_field_by_nonresidue(fe: Self::BaseField) -> Self::BaseField
A defaulted method for multiplying an element of the base field by the quadratic non-residue. This is used in multiplication and squaring.