pub fn encapsulate<Ciphertext: NewByteArray<{ CRYPTO_KEM_MLKEM768_CIPHERTEXTBYTES }>, SharedSecret: NewByteArray<{ CRYPTO_KEM_MLKEM768_SHAREDSECRETBYTES }>, PublicKey: ByteArray<{ CRYPTO_KEM_MLKEM768_PUBLICKEYBYTES }>>(
public_key: &PublicKey,
) -> Result<(Ciphertext, SharedSecret), Error>Expand description
Creates a random shared secret for public_key, returning the ML-KEM-768
ciphertext to send to its owner and the shared secret.
ยงErrors
Returns Error::InvalidKey if public_key is not a valid public
key.