pub trait Fp2Config: 'static + Send + Sync + Sized {
    type Fp: PrimeField;

    const NONRESIDUE: Self::Fp;
    const FROBENIUS_COEFF_FP2_C1: &'static [Self::Fp];

    // Provided methods
    fn mul_fp_by_nonresidue_in_place(fe: &mut Self::Fp) -> &mut Self::Fp { ... }
    fn mul_fp_by_nonresidue_and_add(y: &mut Self::Fp, x: &Self::Fp) { ... }
    fn mul_fp_by_nonresidue_plus_one_and_add(y: &mut Self::Fp, x: &Self::Fp) { ... }
    fn sub_and_mul_fp_by_nonresidue(y: &mut Self::Fp, x: &Self::Fp) { ... }
}
Expand description

Trait that specifies constants and methods for defining degree-two extension fields.

Required Associated Types§

source

type Fp: PrimeField

Base prime field underlying this extension.

Required Associated Constants§

source

const NONRESIDUE: Self::Fp

Quadratic non-residue in Self::Fp used to construct the extension field. That is, NONRESIDUE is such that the quadratic polynomial f(X) = X^2 - Self::NONRESIDUE in Fp[X] is irreducible in Self::Fp.

source

const FROBENIUS_COEFF_FP2_C1: &'static [Self::Fp]

Coefficients for the Frobenius automorphism.

Provided Methods§

source

fn mul_fp_by_nonresidue_in_place(fe: &mut Self::Fp) -> &mut Self::Fp

Return fe * Self::NONRESIDUE. Intended for specialization when Self::NONRESIDUE has a special structure that can speed up multiplication

source

fn mul_fp_by_nonresidue_and_add(y: &mut Self::Fp, x: &Self::Fp)

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_fp_by_nonresidue_plus_one_and_add(y: &mut Self::Fp, x: &Self::Fp)

A specializable method for computing x + mul_fp_by_nonresidue(y) + y This allows for optimizations when the non-residue is not -1.

source

fn sub_and_mul_fp_by_nonresidue(y: &mut Self::Fp, x: &Self::Fp)

A specializable method for computing x - mul_fp_by_nonresidue(y) This allows for optimizations when the non-residue is canonically negative in the field.

Implementors§