Import std.crypto.signatures
X25519
struct
Public Struct X25519
X25519 key exchange (RFC 7748): private and public keys are 32 bytes each, and so is the secret two sides share, which a KDF, like Hkdf, makes keys from.
Examples
Local alice = X25519.NewPrivateKey()
Local bob = X25519.NewPrivateKey()
Local aliceSecret = X25519.SharedSecret(alice, X25519.PublicKeyOf(bob))
Local bobSecret = X25519.SharedSecret(bob, X25519.PublicKeyOf(alice))
Expect(aliceSecret != Null && aliceSecret == bobSecret)std/crypto/signatures.fb, line 222
-
A new random private key.
-
privateKey's public key, to give the other side. Panics unlessprivateKeyis 32 bytes.
Report an issue with this page or with FutureBlitz on GitHub.