ark_test_curves

Trait VariableBaseMSM

Source
pub trait VariableBaseMSM: ScalarMul {
    // Provided methods
    fn msm_unchecked(
        bases: &[Self::MulBase],
        scalars: &[Self::ScalarField],
    ) -> Self { ... }
    fn msm(
        bases: &[Self::MulBase],
        scalars: &[Self::ScalarField],
    ) -> Result<Self, usize> { ... }
    fn msm_bigint(
        bases: &[Self::MulBase],
        bigints: &[<Self::ScalarField as PrimeField>::BigInt],
    ) -> Self { ... }
    fn msm_chunks<I, J>(bases_stream: &J, scalars_stream: &I) -> Self
       where I: Iterable + ?Sized,
             <I as Iterable>::Item: Borrow<Self::ScalarField>,
             J: Iterable,
             <J as Iterable>::Item: Borrow<Self::MulBase> { ... }
}

Provided Methods§

Source

fn msm_unchecked(bases: &[Self::MulBase], scalars: &[Self::ScalarField]) -> Self

Computes an inner product between the PrimeField elements in scalars and the corresponding group elements in bases.

If the elements have different length, it will chop the slices to the shortest length between scalars.len() and bases.len().

Reference: VariableBaseMSM::msm

Source

fn msm( bases: &[Self::MulBase], scalars: &[Self::ScalarField], ) -> Result<Self, usize>

Performs multi-scalar multiplication.

§Warning

This method checks that bases and scalars have the same length. If they are unequal, it returns an error containing the shortest length over which the MSM can be performed.

Source

fn msm_bigint( bases: &[Self::MulBase], bigints: &[<Self::ScalarField as PrimeField>::BigInt], ) -> Self

Optimized implementation of multi-scalar multiplication.

Source

fn msm_chunks<I, J>(bases_stream: &J, scalars_stream: &I) -> Self
where I: Iterable + ?Sized, <I as Iterable>::Item: Borrow<Self::ScalarField>, J: Iterable, <J as Iterable>::Item: Borrow<Self::MulBase>,

Streaming multi-scalar multiplication algorithm with hard-coded chunk size.

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<P> VariableBaseMSM for ark_test_curves::models::short_weierstrass::Projective<P>
where P: SWCurveConfig,

Source§

impl<P> VariableBaseMSM for ark_test_curves::models::twisted_edwards::Projective<P>
where P: TECurveConfig,

Source§

impl<P> VariableBaseMSM for PairingOutput<P>
where P: Pairing,