[][src]Trait snarkos_models::curves::pairing_engine::PairingEngine

pub trait PairingEngine: Sized + 'static + Copy + Debug + Sync + Send {
    type Fr: PrimeField + SquareRootField + Into<<Self::Fr as PrimeField>::BigInteger>;
    type G1Projective: ProjectiveCurve<BaseField = Self::Fq, ScalarField = Self::Fr, Affine = Self::G1Affine> + From<Self::G1Affine>;
    type G1Affine: AffineCurve<BaseField = Self::Fq, ScalarField = Self::Fr, Projective = Self::G1Projective> + PairingCurve<PairWith = Self::G2Affine, PairingResult = Self::Fqk> + From<Self::G1Projective>;
    type G2Projective: ProjectiveCurve<BaseField = Self::Fqe, ScalarField = Self::Fr, Affine = Self::G2Affine> + From<Self::G2Affine>;
    type G2Affine: AffineCurve<BaseField = Self::Fqe, ScalarField = Self::Fr, Projective = Self::G2Projective> + PairingCurve<PairWith = Self::G1Affine, PairingResult = Self::Fqk> + From<Self::G2Projective>;
    type Fq: PrimeField + SquareRootField;
    type Fqe: SquareRootField;
    type Fqk: Field;
#[must_use]    fn miller_loop<'a, I>(i: I) -> Self::Fqk
    where
        I: IntoIterator<Item = &'a (&'a <Self::G1Affine as PairingCurve>::Prepared, &'a <Self::G2Affine as PairingCurve>::Prepared)>
;
#[must_use] fn final_exponentiation(_: &Self::Fqk) -> Option<Self::Fqk>; #[must_use] fn product_of_pairings<'a, I>(i: I) -> Self::Fqk
    where
        I: IntoIterator<Item = &'a (&'a <Self::G1Affine as PairingCurve>::Prepared, &'a <Self::G2Affine as PairingCurve>::Prepared)>
, { ... }
#[must_use] fn pairing<G1, G2>(p: G1, q: G2) -> Self::Fqk
    where
        G1: Into<Self::G1Affine>,
        G2: Into<Self::G2Affine>
, { ... } }

Associated Types

type Fr: PrimeField + SquareRootField + Into<<Self::Fr as PrimeField>::BigInteger>

This is the scalar field of the G1/G2 groups.

type G1Projective: ProjectiveCurve<BaseField = Self::Fq, ScalarField = Self::Fr, Affine = Self::G1Affine> + From<Self::G1Affine>

The projective representation of an element in G1.

type G1Affine: AffineCurve<BaseField = Self::Fq, ScalarField = Self::Fr, Projective = Self::G1Projective> + PairingCurve<PairWith = Self::G2Affine, PairingResult = Self::Fqk> + From<Self::G1Projective>

The affine representation of an element in G1.

type G2Projective: ProjectiveCurve<BaseField = Self::Fqe, ScalarField = Self::Fr, Affine = Self::G2Affine> + From<Self::G2Affine>

The projective representation of an element in G2.

type G2Affine: AffineCurve<BaseField = Self::Fqe, ScalarField = Self::Fr, Projective = Self::G2Projective> + PairingCurve<PairWith = Self::G1Affine, PairingResult = Self::Fqk> + From<Self::G2Projective>

The affine representation of an element in G2.

type Fq: PrimeField + SquareRootField

The base field that hosts G1.

type Fqe: SquareRootField

The extension field that hosts G2.

type Fqk: Field

The extension field that hosts the target group of the pairing.

Loading content...

Required methods

#[must_use]fn miller_loop<'a, I>(i: I) -> Self::Fqk where
    I: IntoIterator<Item = &'a (&'a <Self::G1Affine as PairingCurve>::Prepared, &'a <Self::G2Affine as PairingCurve>::Prepared)>, 

Perform a miller loop with some number of (G1, G2) pairs.

#[must_use]fn final_exponentiation(_: &Self::Fqk) -> Option<Self::Fqk>

Perform final exponentiation of the result of a miller loop.

Loading content...

Provided methods

#[must_use]fn product_of_pairings<'a, I>(i: I) -> Self::Fqk where
    I: IntoIterator<Item = &'a (&'a <Self::G1Affine as PairingCurve>::Prepared, &'a <Self::G2Affine as PairingCurve>::Prepared)>, 

Computes a product of pairings.

#[must_use]fn pairing<G1, G2>(p: G1, q: G2) -> Self::Fqk where
    G1: Into<Self::G1Affine>,
    G2: Into<Self::G2Affine>, 

Performs multiple pairing operations

Loading content...

Implementors

Loading content...