Skip to main content

LinearCombination

Trait LinearCombination 

pub trait LinearCombination: Group {
    // Provided method
    fn lincomb(x: &Self, k: &Self::Scalar, y: &Self, l: &Self::Scalar) -> Self { ... }
}
Expand description

Linear combination.

This trait enables crates to provide an optimized implementation of linear combinations (e.g. Shamir’s Trick), or otherwise provides a default non-optimized implementation.

Provided Methods§

fn lincomb(x: &Self, k: &Self::Scalar, y: &Self, l: &Self::Scalar) -> Self

Calculates x * k + y * l.

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.

Implementations on Foreign Types§

§

impl<C> LinearCombination for ProjectivePoint<C>
where ProjectivePoint<C>: Double, C: PrimeCurveParams,

Implementors§

§

impl<P> LinearCombination for P
where P: LinearCombinationExt<[(P, <P as Group>::Scalar); 2]>,

Blanket impl of the legacy LinearCombination trait for types which impl the new LinearCombinationExt trait for 2-element arrays.