Key encapsulation
Example
unsigned char pk[crypto_kem_PUBLICKEYBYTES];
unsigned char sk[crypto_kem_SECRETKEYBYTES];
unsigned char ciphertext[crypto_kem_CIPHERTEXTBYTES];
unsigned char client_key[crypto_kem_SHAREDSECRETBYTES];
unsigned char server_key[crypto_kem_SHAREDSECRETBYTES];
crypto_kem_keypair(pk, sk);
if (crypto_kem_enc(ciphertext, client_key, pk) != 0) {
/* error */
}
if (crypto_kem_dec(server_key, ciphertext, sk) != 0) {
/* error */
}Purpose
Usage
Using the shared secret
Algorithm details
Constants
Notes
Last updated