Function scalarmult [src]

Compute the scalar product of a public key and a secret scalar. Note that the output should not be used as a shared secret without hashing it first.

Prototype

pub fn scalarmult(secret_key: [secret_length]u8, public_key: [public_length]u8) IdentityElementError![shared_length]u8

Parameters

secret_key: [secret_length]u8public_key: [public_length]u8

Possible Errors

IdentityElement IdentityElementError

Source

pub fn scalarmult(secret_key: [secret_length]u8, public_key: [public_length]u8) IdentityElementError![shared_length]u8 { const q = try Curve.fromBytes(public_key).clampedMul(secret_key); return q.toBytes(); }