aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssl/test/ml_kem_evp_extra_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/test/ml_kem_evp_extra_test.c')
-rw-r--r--crypto/openssl/test/ml_kem_evp_extra_test.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/openssl/test/ml_kem_evp_extra_test.c b/crypto/openssl/test/ml_kem_evp_extra_test.c
index bfa52c9af2e6..b867b14ad1d4 100644
--- a/crypto/openssl/test/ml_kem_evp_extra_test.c
+++ b/crypto/openssl/test/ml_kem_evp_extra_test.c
@@ -140,9 +140,19 @@ static int test_ml_kem(void)
if (!TEST_int_gt(EVP_PKEY_copy_parameters(bkey, akey), 0))
goto err;
+ /* Bob's empty key is not equal to Alice's */
+ if (!TEST_false(EVP_PKEY_eq(akey, bkey))
+ || !TEST_false(EVP_PKEY_eq(bkey, akey)))
+ goto err;
+
if (!TEST_true(EVP_PKEY_set1_encoded_public_key(bkey, rawpub, publen)))
goto err;
+ /* Bob's copy of Alice's public key makes the two equal */
+ if (!TEST_true(EVP_PKEY_eq(akey, bkey))
+ || !TEST_true(EVP_PKEY_eq(bkey, akey)))
+ goto err;
+
/* Encapsulate Bob's key */
ctx = EVP_PKEY_CTX_new_from_pkey(testctx, bkey, NULL);
if (!TEST_ptr(ctx))