Function clampedMul [src]
Multiply an Edwards25519 point by a scalar after "clamping" it.
Clamping forces the scalar to be a multiple of the cofactor in
order to prevent small subgroups attacks.
This is strongly recommended for DH operations.
Return error.WeakPublicKey if the resulting point is
the identity element.
Prototype
pub fn clampedMul(p: Edwards25519, s: [32]u8) (IdentityElementError || WeakPublicKeyError)!Edwards25519
Parameters
p: Edwards25519
s: [32]u8
Source
pub fn clampedMul(p: Edwards25519, s: [32]u8) (IdentityElementError || WeakPublicKeyError)!Edwards25519 {
var t: [32]u8 = s;
scalar.clamp(&t);
return mul(p, t);
}