Skip to main content

crypto_kem_mlkem768_enc

Function crypto_kem_mlkem768_enc 

Source
pub fn crypto_kem_mlkem768_enc(
    ciphertext: &mut Ciphertext,
    shared_secret: &mut SharedSecret,
    public_key: &PublicKey,
) -> Result<(), Error>
Expand description

Creates a random shared secret for public_key, writing it to shared_secret and its encapsulation to ciphertext.

Compatible with libsodium’s crypto_kem_mlkem768_enc.

§Errors

Returns Error::InvalidKey if public_key is not a valid ML-KEM-768 encapsulation key (a coefficient is not reduced modulo q).