Trait ark_ec::scalar_mul::variable_base::VariableBaseMSM
source · [−]pub trait VariableBaseMSM: ScalarMul {
fn msm(bases: &[Self::MulBase], scalars: &[Self::ScalarField]) -> Self { ... }
fn msm_unchecked(
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: ?Sized, J>(bases_stream: &J, scalars_stream: &I) -> Self
where
I: Iterable,
I::Item: Borrow<Self::ScalarField>,
J: Iterable,
J::Item: Borrow<Self::MulBase>,
{ ... }
}
Provided Methods
sourcefn msm(bases: &[Self::MulBase], scalars: &[Self::ScalarField]) -> Self
fn msm(bases: &[Self::MulBase], scalars: &[Self::ScalarField]) -> Self
Computes an inner product between the PrimeField
elements in scalars
and the corresponding group elements in bases
.
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.
Reference: VariableBaseMSM::msm
sourcefn msm_unchecked(
bases: &[Self::MulBase],
scalars: &[Self::ScalarField]
) -> Result<Self, usize>
fn msm_unchecked(
bases: &[Self::MulBase],
scalars: &[Self::ScalarField]
) -> Result<Self, usize>
Performs multi-scalar multiplication, without checking that bases.len() == scalars.len()
.
Warning
If the elements have different length, it will chop the slices to the
shortest length between scalars.len()
and bases.len()
.
sourcefn msm_bigint(
bases: &[Self::MulBase],
bigints: &[<Self::ScalarField as PrimeField>::BigInt]
) -> Self
fn msm_bigint(
bases: &[Self::MulBase],
bigints: &[<Self::ScalarField as PrimeField>::BigInt]
) -> Self
Optimized implementation of multi-scalar multiplication.