openvm_pairing_guest::pairing

Trait MultiMillerLoop

Source
pub trait MultiMillerLoop: MillerStep
where <Self as MillerStep>::Fp2: Field + FieldExtension<Self::Fp>, UnevaluatedLine<Self::Fp2>: Evaluatable<Self::Fp, Self::Fp2>, for<'a> &'a Self::Fp: DivUnsafe<&'a Self::Fp, Output = Self::Fp>, for<'a> &'a Self::Fp2: Neg<Output = Self::Fp2>, for<'a, 'a> &'a Self::Fp12: Mul<&'a Self::Fp12, Output = Self::Fp12> + DivUnsafe<&'a Self::Fp12, Output = Self::Fp12>,
{ type Fp: Field; type Fp12: Field + FieldExtension<Self::Fp2>; const SEED_ABS: u64; const PSEUDO_BINARY_ENCODING: &[i8]; // Required methods fn evaluate_lines_vec( f: Self::Fp12, lines: Vec<EvaluatedLine<Self::Fp2>>, ) -> Self::Fp12; fn pre_loop( Q_acc: Vec<AffinePoint<Self::Fp2>>, Q: &[AffinePoint<Self::Fp2>], c: Option<Self::Fp12>, xy_fracs: &[(Self::Fp, Self::Fp)], ) -> (Self::Fp12, Vec<AffinePoint<Self::Fp2>>); fn post_loop( f: &Self::Fp12, Q_acc: Vec<AffinePoint<Self::Fp2>>, Q: &[AffinePoint<Self::Fp2>], c: Option<Self::Fp12>, xy_fracs: &[(Self::Fp, Self::Fp)], ) -> (Self::Fp12, Vec<AffinePoint<Self::Fp2>>); // Provided methods fn multi_miller_loop( P: &[AffinePoint<Self::Fp>], Q: &[AffinePoint<Self::Fp2>], ) -> Self::Fp12 { ... } fn multi_miller_loop_embedded_exp( P: &[AffinePoint<Self::Fp>], Q: &[AffinePoint<Self::Fp2>], c: Option<Self::Fp12>, ) -> Self::Fp12 { ... } }

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn evaluate_lines_vec( f: Self::Fp12, lines: Vec<EvaluatedLine<Self::Fp2>>, ) -> Self::Fp12

Function to evaluate the line functions of the Miller loop

Source

fn pre_loop( Q_acc: Vec<AffinePoint<Self::Fp2>>, Q: &[AffinePoint<Self::Fp2>], c: Option<Self::Fp12>, xy_fracs: &[(Self::Fp, Self::Fp)], ) -> (Self::Fp12, Vec<AffinePoint<Self::Fp2>>)

Runs before the main loop in the Miller loop function

xy_fracs consists of (x/y, 1/y) pairs for each point P

Source

fn post_loop( f: &Self::Fp12, Q_acc: Vec<AffinePoint<Self::Fp2>>, Q: &[AffinePoint<Self::Fp2>], c: Option<Self::Fp12>, xy_fracs: &[(Self::Fp, Self::Fp)], ) -> (Self::Fp12, Vec<AffinePoint<Self::Fp2>>)

Runs after the main loop in the Miller loop function

Provided Methods§

Source

fn multi_miller_loop( P: &[AffinePoint<Self::Fp>], Q: &[AffinePoint<Self::Fp2>], ) -> Self::Fp12

Runs the multi-Miller loop with no embedded exponent

Source

fn multi_miller_loop_embedded_exp( P: &[AffinePoint<Self::Fp>], Q: &[AffinePoint<Self::Fp2>], c: Option<Self::Fp12>, ) -> Self::Fp12

Runs the multi-Miller loop with an embedded exponent, removing the need to calculate the residue witness in the final exponentiation step

c is assumed nonzero.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl MultiMillerLoop for openvm_pairing_guest::bls12_381::Bls12_381

Source§

impl MultiMillerLoop for openvm_pairing_guest::bn254::Bn254

Source§

const SEED_ABS: u64 = 4_965_661_367_192_848_881u64

Source§

const PSEUDO_BINARY_ENCODING: &[i8] = _

Source§

type Fp = Bn254Fp

Source§

type Fp12 = SexticExtField<Bn254Fp2>

Source§

impl MultiMillerLoop for openvm_pairing_guest::halo2curves_shims::bls12_381::Bls12_381

Source§

const SEED_ABS: u64 = 15_132_376_222_941_642_752u64

Source§

const PSEUDO_BINARY_ENCODING: &[i8] = _

Source§

type Fp = Fp

Source§

type Fp12 = Fp12

Source§

impl MultiMillerLoop for openvm_pairing_guest::halo2curves_shims::bn254::Bn254

Source§

const SEED_ABS: u64 = 4_965_661_367_192_848_881u64

Source§

const PSEUDO_BINARY_ENCODING: &[i8] = _

Source§

type Fp = Fq

Source§

type Fp12 = Fq12