pub trait LinearCombination<PointsAndScalars>: CurveGroup{
// Provided methods
fn lincomb(points_and_scalars: &PointsAndScalars) -> Self { ... }
fn lincomb_vartime(points_and_scalars: &PointsAndScalars) -> Self { ... }
}Expand description
Linear combination.
This trait enables optimized implementations of linear combinations (e.g. Shamir’s Trick).
It’s generic around PointsAndScalars to allow overlapping impls. For example, const generic
impls can use the input size to determine the size needed to store temporary variables.
Provided Methods§
Sourcefn lincomb(points_and_scalars: &PointsAndScalars) -> Self
fn lincomb(points_and_scalars: &PointsAndScalars) -> Self
Calculates x1 * k1 + ... + xn * kn.
Sourcefn lincomb_vartime(points_and_scalars: &PointsAndScalars) -> Self
fn lincomb_vartime(points_and_scalars: &PointsAndScalars) -> Self
Calculates x1 * k1 + ... + xn * kn.
This is equivalent to LinearCombination::lincomb except
that it may leak the value of the points and/or scalars due to
variable-time behavior.
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.