Function mulPublic [src]

Multiply an elliptic curve point by a PUBLIC scalar IN VARIABLE TIME This can be used for signature verification.

Prototype

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

Parameters

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

Possible Errors

IdentityElement IdentityElementError

Source

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