publicKey = crypto.x25519.public(secretKey)
| Parameter | Description |
|---|---|
| secretKey | a uint8 vector of 32 bytes or 64 hexadecimal characters: private key. |
| Parameter | Description |
|---|---|
| publicKey | a character vector: 64 lowercase hexadecimal characters (32 bytes). |
crypto.x25519.public derives the Curve25519 public key (RFC 7748) matching a 32-byte secret key.
Generate the secret key with crypto.random(32) or use crypto.x25519.keypair to get both at once.
sec = crypto.random(32, '-hex');
pub = crypto.x25519.public(sec)
| Version | Description |
|---|---|
| 2.0.0 | initial version |