Function mul [src]

Multiply an elliptic curve point by a scalar. Return error.IdentityElement if the result is the identity element.

Prototype

pub fn mul(p: Secp256k1, s_: [32]u8, endian: std.builtin.Endian) IdentityElementError!Secp256k1

Parameters

p: Secp256k1s_: [32]u8endian: std.builtin.Endian

Possible Errors

IdentityElement IdentityElementError

Source

pub fn mul(p: Secp256k1, s_: [32]u8, endian: std.builtin.Endian) IdentityElementError!Secp256k1 { const s = if (endian == .little) s_ else Fe.orderSwap(s_); if (p.is_base) { return pcMul16(&basePointPc, s, false); } try p.rejectIdentity(); const pc = precompute(p, 15); return pcMul16(&pc, s, false); }