ark_test_curves::cubic_extension

Trait CubicExtConfig

Source
pub trait CubicExtConfig:
    Sized
    + 'static
    + Send
    + Sync {
    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 Constants§

Source

const SQRT_PRECOMP: Option<SqrtPrecomputation<CubicExtField<Self>>>

Determines the algorithm for computing square roots.

Source

const DEGREE_OVER_BASE_PRIME_FIELD: usize

The degree of the extension over the base prime field.

Source

const NONRESIDUE: Self::BaseField

The cubic non-residue used to construct the extension.

Source

const FROBENIUS_COEFF_C1: &'static [Self::FrobCoeff]

Coefficients for the Frobenius automorphism.

Source

const FROBENIUS_COEFF_C2: &'static [Self::FrobCoeff]

Required Associated Types§

Source

type BasePrimeField: PrimeField

The prime field that this cubic extension is eventually an extension of.

Source

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.

Source

type FrobCoeff: Field

The type of the coefficients for an efficient implementation of the Frobenius endomorphism.

Required Methods§

Source

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§

Source

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.

Source

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<P> CubicExtConfig for Fp3ConfigWrapper<P>
where P: Fp3Config,

Source§

impl<P> CubicExtConfig for Fp6ConfigWrapper<P>
where P: Fp6Config,