pub trait PairingVar<E: Pairing, ConstraintF: Field = <<E as Pairing>::G1 as CurveGroup>::BaseField> {
    type G1Var: CurveVar<E::G1, ConstraintF> + AllocVar<E::G1, ConstraintF> + AllocVar<E::G1Affine, ConstraintF>;
    type G2Var: CurveVar<E::G2, ConstraintF> + AllocVar<E::G2, ConstraintF> + AllocVar<E::G2Affine, ConstraintF>;
    type GTVar: FieldVar<E::TargetField, ConstraintF>;
    type G1PreparedVar: ToBytesGadget<ConstraintF> + AllocVar<E::G1Prepared, ConstraintF> + Clone + Debug;
    type G2PreparedVar: ToBytesGadget<ConstraintF> + AllocVar<E::G2Prepared, ConstraintF> + Clone + Debug;

    fn miller_loop(
        p: &[Self::G1PreparedVar],
        q: &[Self::G2PreparedVar]
    ) -> Result<Self::GTVar, SynthesisError>; fn final_exponentiation(
        p: &Self::GTVar
    ) -> Result<Self::GTVar, SynthesisError>; fn prepare_g1(
        q: &Self::G1Var
    ) -> Result<Self::G1PreparedVar, SynthesisError>; fn prepare_g2(
        q: &Self::G2Var
    ) -> Result<Self::G2PreparedVar, SynthesisError>; fn pairing(
        p: Self::G1PreparedVar,
        q: Self::G2PreparedVar
    ) -> Result<Self::GTVar, SynthesisError> { ... } fn product_of_pairings(
        p: &[Self::G1PreparedVar],
        q: &[Self::G2PreparedVar]
    ) -> Result<Self::GTVar, SynthesisError> { ... } }
Expand description

Specifies the constraints for computing a pairing in the yybilinear group E.

Required Associated Types§

An variable representing an element of G1. This is the R1CS equivalent of E::G1Projective.

An variable representing an element of G2. This is the R1CS equivalent of E::G2Projective.

An variable representing an element of GT. This is the R1CS equivalent of E::GT.

An variable representing cached precomputation that can speed up pairings computations. This is the R1CS equivalent of E::G1Prepared.

An variable representing cached precomputation that can speed up pairings computations. This is the R1CS equivalent of E::G2Prepared.

Required Methods§

Computes a multi-miller loop between elements of p and q.

Computes a final exponentiation over p.

Performs the precomputation to generate Self::G1PreparedVar.

Performs the precomputation to generate Self::G2PreparedVar.

Provided Methods§

Computes a pairing over p and q.

Computes a product of pairings over the elements in p and q.

Implementors§