Skip to main content

x25519_derive_public

Function x25519_derive_public 

Source
pub fn x25519_derive_public(sk: &[u8; 32]) -> [u8; 32]
Expand description

Derive the X25519 public key from a 32-byte secret key.

The secret key is any 32 random bytes; the caller is responsible for drawing them from a suitable CSPRNG. The returned public key is the 32-byte u-coordinate of sk * base on Curve25519.

This is X25519(sk, 9) per RFC 7748 ยง5.