Function lambdaworks_math::msm::pippenger::msm

source ·
pub fn msm<const NUM_LIMBS: usize, G>(
    cs: &[UnsignedInteger<NUM_LIMBS>],
    points: &[G],
) -> Result<G, MSMError>
where G: IsGroup,
Expand description

This function computes the multiscalar multiplication (MSM).

Assume a group G of order r is given. Let points = [g_1, ..., g_n] be a tuple of group points in G and let cs = [k_1, ..., k_n] be a tuple of scalars in the Galois field GF(r).

Then, with additive notation, msm(cs, points) computes k_1 * g_1 + …. + k_n * g_n.

If points and cs are empty, then msm returns the zero element of the group.

Panics if cs and points have different lengths.