Skip to main content

Fp2Config

Trait Fp2Config 

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

    const NONRESIDUE: Self::Fp;
    const FROBENIUS_COEFF_FP2_C1: &[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 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: &[Self::Fp]

Coefficients for the Frobenius automorphism.

Required Associated Types§

Source

type Fp: PrimeField

Base prime field underlying this extension.

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§