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: P384, s_: [48]u8, endian: std.builtin.Endian) IdentityElementError!P384

Parameters

p: P384s_: [48]u8endian: std.builtin.Endian

Possible Errors

IdentityElement IdentityElementError

Source

pub fn mul(p: P384, s_: [48]u8, endian: std.builtin.Endian) IdentityElementError!P384 { 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); }