pub trait MultiscalarMul<E: Curve> {
// Required method
fn multiscalar_mul<S, P>(
scalar_points: impl ExactSizeIterator<Item = (S, P)>,
) -> Point<E>
where S: AsRef<Scalar<E>>,
P: AsRef<Point<E>>;
}Expand description
Multiscalar multiplication algorithm
See module-level docs for motivation and list of provided algorithms.
Required Methods§
Sourcefn multiscalar_mul<S, P>(
scalar_points: impl ExactSizeIterator<Item = (S, P)>,
) -> Point<E>
fn multiscalar_mul<S, P>( scalar_points: impl ExactSizeIterator<Item = (S, P)>, ) -> Point<E>
Performs multiscalar multiplication
Takes iterator of pairs (scalar, point). Returns sum of scalar * point. Iterator must have
exact size (i.e. it’s ExactSizeIterator). Iterator size is used to determine the best
algorithm for multiscalar multiplication, preallocate memory, etc. If iterator size is not
correct, it may worsen performance or lead to runtime panic.
Note that the multiscalar algorithm is not necessarily constant-time, thus is should not be
used with SecretScalar<E>.
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§
impl MultiscalarMul<Ed25519> for Dalek
Available on crate features
curve-ed25519 and alloc only.impl<E: Curve> MultiscalarMul<E> for Default
Available on crate feature
alloc only.impl<E: Curve> MultiscalarMul<E> for Naive
impl<E: Curve> MultiscalarMul<E> for Straus
Available on crate feature
alloc only.