Trait ark_ec::pairing::Pairing

source ·
pub trait Pairing: Sized + 'static + Copy + Debug + Sync + Send + Eq {
    type BaseField: PrimeField;
    type ScalarField: PrimeField;
    type G1: CurveGroup<ScalarField = Self::ScalarField, Affine = Self::G1Affine> + From<Self::G1Affine> + Into<Self::G1Affine> + MulAssign<Self::ScalarField>;
    type G1Affine: AffineRepr<Group = Self::G1, ScalarField = Self::ScalarField> + From<Self::G1> + Into<Self::G1> + Into<Self::G1Prepared>;
    type G1Prepared: Default + Clone + Send + Sync + Debug + CanonicalSerialize + CanonicalDeserialize + for<'a> From<&'a Self::G1> + for<'a> From<&'a Self::G1Affine> + From<Self::G1> + From<Self::G1Affine>;
    type G2: CurveGroup<ScalarField = Self::ScalarField, Affine = Self::G2Affine> + From<Self::G2Affine> + Into<Self::G2Affine> + MulAssign<Self::ScalarField>;
    type G2Affine: AffineRepr<Group = Self::G2, ScalarField = Self::ScalarField> + From<Self::G2> + Into<Self::G2> + Into<Self::G2Prepared>;
    type G2Prepared: Default + Clone + Send + Sync + Debug + CanonicalSerialize + CanonicalDeserialize + for<'a> From<&'a Self::G2> + for<'a> From<&'a Self::G2Affine> + From<Self::G2> + From<Self::G2Affine>;
    type TargetField: CyclotomicMultSubgroup;

    fn multi_miller_loop(
        a: impl IntoIterator<Item = impl Into<Self::G1Prepared>>,
        b: impl IntoIterator<Item = impl Into<Self::G2Prepared>>
    ) -> MillerLoopOutput<Self>; fn final_exponentiation(
        mlo: MillerLoopOutput<Self>
    ) -> Option<PairingOutput<Self>>; fn miller_loop(
        a: impl Into<Self::G1Prepared>,
        b: impl Into<Self::G2Prepared>
    ) -> MillerLoopOutput<Self> { ... } fn multi_pairing(
        a: impl IntoIterator<Item = impl Into<Self::G1Prepared>>,
        b: impl IntoIterator<Item = impl Into<Self::G2Prepared>>
    ) -> PairingOutput<Self> { ... } fn pairing(
        p: impl Into<Self::G1Prepared>,
        q: impl Into<Self::G2Prepared>
    ) -> PairingOutput<Self> { ... } }
Expand description

Collection of types (mainly fields and curves) that together describe how to compute a pairing over a pairing-friendly curve.

Required Associated Types§

This is the base field of the G1 group and base prime field of G2.

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

An element in G1.

A G1 element that has been preprocessed for use in a pairing.

An element of G2.

The affine representation of an element in G2.

A G2 element that has been preprocessed for use in a pairing.

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

Required Methods§

Computes the product of Miller loops for some number of (G1, G2) pairs.

Performs final exponentiation of the result of a Self::multi_miller_loop.

Provided Methods§

Computes the Miller loop over a and b.

Computes a “product” of pairings.

Performs multiple pairing operations

Implementors§