Trait snarkvm_curves::traits::pairing_engine::PairingEngine[][src]

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: Iterator<Item = (&'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: Iterator<Item = (&'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>[src]

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>[src]

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>[src]

The affine representation of an element in G1.

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

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>[src]

The affine representation of an element in G2.

type Fq: PrimeField + SquareRootField[src]

The base field that hosts G1.

type Fqe: SquareRootField[src]

The extension field that hosts G2.

type Fqk: Field[src]

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

Required methods

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

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

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

Perform final exponentiation of the result of a miller loop.

Provided methods

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

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>, 
[src]

Performs multiple pairing operations

Implementors

impl<P: Bls12Parameters> PairingEngine for Bls12<P> where
    G1Affine<P>: PairingCurve<BaseField = <P::G1Parameters as ModelParameters>::BaseField, ScalarField = <P::G1Parameters as ModelParameters>::ScalarField, Projective = G1Projective<P>, PairWith = G2Affine<P>, Prepared = G1Prepared<P>, PairingResult = Fp12<P::Fp12Params>>,
    G2Affine<P>: PairingCurve<BaseField = <P::G2Parameters as ModelParameters>::BaseField, ScalarField = <P::G1Parameters as ModelParameters>::ScalarField, Projective = G2Projective<P>, PairWith = G1Affine<P>, Prepared = G2Prepared<P>, PairingResult = Fp12<P::Fp12Params>>, 
[src]

type Fq = P::Fp

type Fqe = Fp2<P::Fp2Params>

type Fqk = Fp12<P::Fp12Params>

type Fr = <P::G1Parameters as ModelParameters>::ScalarField

type G1Affine = G1Affine<P>

type G1Projective = G1Projective<P>

type G2Affine = G2Affine<P>

type G2Projective = G2Projective<P>

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

fn final_exponentiation(f: &Self::Fqk) -> Option<Self::Fqk>[src]

impl<P: BW6Parameters> PairingEngine for BW6<P> where
    G1Affine<P>: PairingCurve<BaseField = <P::G1Parameters as ModelParameters>::BaseField, ScalarField = <P::G1Parameters as ModelParameters>::ScalarField, Projective = G1Projective<P>, PairWith = G2Affine<P>, Prepared = G1Prepared<P>, PairingResult = Fp6<P::Fp6Params>>,
    G2Affine<P>: PairingCurve<BaseField = <P::G2Parameters as ModelParameters>::BaseField, ScalarField = <P::G1Parameters as ModelParameters>::ScalarField, Projective = G2Projective<P>, PairWith = G1Affine<P>, Prepared = G2Prepared<P>, PairingResult = Fp6<P::Fp6Params>>, 
[src]

type Fq = P::Fp

type Fqe = P::Fp

type Fqk = Fp6<P::Fp6Params>

type Fr = <P::G1Parameters as ModelParameters>::ScalarField

type G1Affine = G1Affine<P>

type G1Projective = G1Projective<P>

type G2Affine = G2Affine<P>

type G2Projective = G2Projective<P>

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

fn final_exponentiation(f: &Self::Fqk) -> Option<Self::Fqk>[src]