Function mul [src]
Multiply an Edwards25519 point by a scalar without clamping it.
Return error.WeakPublicKey if the base generates a small-order group,
and error.IdentityElement if the result is the identity element.
Prototype
pub fn mul(p: Edwards25519, s: [32]u8) (IdentityElementError || WeakPublicKeyError)!Edwards25519
Parameters
p: Edwards25519
s: [32]u8
Source
pub fn mul(p: Edwards25519, s: [32]u8) (IdentityElementError || WeakPublicKeyError)!Edwards25519 {
const pc = if (p.is_base) basePointPc else pc: {
const xpc = precompute(p, 15);
xpc[4].rejectIdentity() catch return error.WeakPublicKey;
break :pc xpc;
};
return pcMul16(&pc, s, false);
}