pub trait MultiMillerLoop: MillerStepwhere
<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§
Sourcefn evaluate_lines_vec(
f: Self::Fp12,
lines: Vec<EvaluatedLine<Self::Fp2>>,
) -> Self::Fp12
fn evaluate_lines_vec( f: Self::Fp12, lines: Vec<EvaluatedLine<Self::Fp2>>, ) -> Self::Fp12
Function to evaluate the line functions of the Miller loop
Sourcefn 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 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
Provided Methods§
Sourcefn multi_miller_loop(
P: &[AffinePoint<Self::Fp>],
Q: &[AffinePoint<Self::Fp2>],
) -> Self::Fp12
fn multi_miller_loop( P: &[AffinePoint<Self::Fp>], Q: &[AffinePoint<Self::Fp2>], ) -> Self::Fp12
Runs the multi-Miller loop with no embedded exponent
Sourcefn multi_miller_loop_embedded_exp(
P: &[AffinePoint<Self::Fp>],
Q: &[AffinePoint<Self::Fp2>],
c: Option<Self::Fp12>,
) -> Self::Fp12
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.
Note: All points in P must have non-zero y coordinate. Points with y=0
are not on BN254/BLS12-381, but AffinePoint does not enforce on-curve membership.
Passing such points would cause div_unsafe on zero, producing unconstrained values.
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.