Skip to main content

scalar_mul

Function scalar_mul 

Source
pub fn scalar_mul(
    b: &CircuitBuilder,
    curve: &Secp256k1,
    scalar: &BigUint,
    point: Secp256k1Affine,
) -> Secp256k1Affine
Expand description

Compute scalar multiplication point * scalar using the secp256k1 endomorphism optimization.

Implemented as a single-point msm_strauss_endo (GLV fixed-window Straus) — see there for the algorithm.

§Parameters

  • b: The circuit builder
  • curve: The secp256k1 curve instance
  • scalar: The scalar to multiply by (as a BigUint with N_LIMBS)
  • point: The point to multiply (in affine coordinates)

§Returns

The result of point * scalar in affine coordinates