Expand description
Implementation of the Kyber IND-CCA2 secure key encapsulation mechanism (KEM)
Example usage:
use rand::rngs::OsRng;
use kyber_kem::{kem_keypair_1024, kem_encrypt_1024, kem_decrypt_1024};
let (secret_key, public_key) = kem_keypair_1024(&mut OsRng);
let (ciphertext, shared_secret) = kem_encrypt_1024(public_key, &mut OsRng);
let dec_shared_secret = kem_decrypt_1024(ciphertext, secret_key);
assert_eq!(shared_secret, dec_shared_secret);
Modules§
- params
- Library constants
Functions§
- kem_
decrypt_ 512 - Takes a Kyber-512 ciphertext and a Kyber-512 secret key and returns a 32-byte shared secret.
- kem_
decrypt_ 768 - Takes a Kyber-768 ciphertext and a Kyber-768 secret key and returns a 32-byte shared secret.
- kem_
decrypt_ 1024 - Takes a Kyber-1024 ciphertext and a Kyber-1024 secret key and returns a 32-byte shared secret.
- kem_
encrypt_ 512 - Takes a Kyber-512 public key as input and returns a ciphertext and a 32-byte shared secret.
- kem_
encrypt_ 768 - Takes a Kyber-768 public key as input and returns a ciphertext and a 32-byte shared secret.
- kem_
encrypt_ 1024 - Takes a Kyber-1024 public key as input and returns a ciphertext and a 32-byte shared secret.
- kem_
keypair_ 512 - Returns a Kyber-512 secret key and a corresponding Kyber-512 public key.
- kem_
keypair_ 768 - Returns a Kyber-768 secret key and a corresponding Kyber-768 public key.
- kem_
keypair_ 1024 - Returns a Kyber-1024 secret key and a corresponding Kyber-1024 public key.