Skip to main content

MulBackend

Trait MulBackend 

Source
pub trait MulBackend<C: PrimeCurveParams> {
    // Provided methods
    fn mul_by_generator(k: &Scalar<C>) -> ProjectivePoint<C> { ... }
    fn mul_by_generator_vartime(k: &Scalar<C>) -> ProjectivePoint<C> { ... }
    fn mul_by_generator_and_mul_add_vartime(
        a: &Scalar<C>,
        b_scalar: &Scalar<C>,
        b_point: &ProjectivePoint<C>,
    ) -> ProjectivePoint<C> { ... }
}
Expand description

Scalar multiplication backend.

Provided Methods§

Source

fn mul_by_generator(k: &Scalar<C>) -> ProjectivePoint<C>

Multiplication by the generator.

This is overridable to make it possible to plug in a basepoint table.

Source

fn mul_by_generator_vartime(k: &Scalar<C>) -> ProjectivePoint<C>

Variable-time multiplication by the generator.

This is overridable to make it possible to plug in a basepoint table.

Source

fn mul_by_generator_and_mul_add_vartime( a: &Scalar<C>, b_scalar: &Scalar<C>, b_point: &ProjectivePoint<C>, ) -> ProjectivePoint<C>

Multiply a by the generator of the prime-order subgroup, adding the result to the point P multiplied by the scalar b, i.e. compute aG + bP.

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§

Source§

impl<C, const WINDOW_SIZE: usize> MulBackend<C> for PrecomputedTables<WINDOW_SIZE>

Source§

impl<C: PrimeCurveParams> MulBackend<C> for VariableOnly