Add ML-KEM implementation for gcrypt

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2025-11-28 22:46:22 +01:00
parent 9a3351934b
commit 76c6ee9ccf
8 changed files with 254 additions and 8 deletions

View File

@@ -231,7 +231,15 @@ void crypto_free(struct ssh_crypto_struct *crypto)
}
#ifdef HAVE_MLKEM
#ifdef HAVE_LIBGCRYPT
if (crypto->mlkem_privkey != NULL) {
ssh_burn(crypto->mlkem_privkey, crypto->mlkem_privkey_len);
SAFE_FREE(crypto->mlkem_privkey);
crypto->mlkem_privkey_len = 0;
}
#else
EVP_PKEY_free(crypto->mlkem_privkey);
#endif
ssh_string_burn(crypto->hybrid_shared_secret);
ssh_string_free(crypto->mlkem_client_pubkey);
ssh_string_free(crypto->mlkem_ciphertext);