openvm_pairing_guest::pairing

Trait MillerStep

Source
pub trait MillerStep {
    type Fp2;

    // Required methods
    fn miller_double_step(
        s: &AffinePoint<Self::Fp2>,
    ) -> (AffinePoint<Self::Fp2>, UnevaluatedLine<Self::Fp2>);
    fn miller_add_step(
        s: &AffinePoint<Self::Fp2>,
        q: &AffinePoint<Self::Fp2>,
    ) -> (AffinePoint<Self::Fp2>, UnevaluatedLine<Self::Fp2>);
    fn miller_double_and_add_step(
        s: &AffinePoint<Self::Fp2>,
        q: &AffinePoint<Self::Fp2>,
    ) -> (AffinePoint<Self::Fp2>, UnevaluatedLine<Self::Fp2>, UnevaluatedLine<Self::Fp2>);
}
Expand description

Trait definition for Miller step opcodes

Required Associated Types§

Required Methods§

Source

fn miller_double_step( s: &AffinePoint<Self::Fp2>, ) -> (AffinePoint<Self::Fp2>, UnevaluatedLine<Self::Fp2>)

Miller double step

Source

fn miller_add_step( s: &AffinePoint<Self::Fp2>, q: &AffinePoint<Self::Fp2>, ) -> (AffinePoint<Self::Fp2>, UnevaluatedLine<Self::Fp2>)

Miller add step

Source

fn miller_double_and_add_step( s: &AffinePoint<Self::Fp2>, q: &AffinePoint<Self::Fp2>, ) -> (AffinePoint<Self::Fp2>, UnevaluatedLine<Self::Fp2>, UnevaluatedLine<Self::Fp2>)

Miller double and add step (2S + Q implemented as S + Q + S for efficiency)

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 MillerStep for Bls12_381

Source§

impl MillerStep for Bn254

Source§

impl<P> MillerStep for P
where P: PairingIntrinsics, for<'a, 'a, 'a, 'a> &'a P::Fp2: Add<&'a P::Fp2, Output = P::Fp2> + Sub<&'a P::Fp2, Output = P::Fp2> + Mul<&'a P::Fp2, Output = P::Fp2> + Neg<Output = P::Fp2>,