Skip to main content

crypto_scalarmult

Function crypto_scalarmult 

Source
pub fn crypto_scalarmult(
    q: &mut [u8; 32],
    n: &[u8; 32],
    p: &[u8; 32],
) -> Result<(), Error>
Expand description

Computes a shared secret q, given n, our secret key, and p, their public key, using a Diffie-Hellman key exchange.

Compatible with libsodium’s crypto_scalarmult.

§Errors

Returns an error if p is an unacceptable low-order public key that produces an all-zero shared secret.