[PATCH] tests:kem: Don't emit a message each time, but once.
NIIBE Yutaka via Gcrypt-devel <[email protected]> Tue, 7 Apr 2026 10:15:13 +0900
| Newsgroups | gmane.comp.encryption.gpg.libgcrypt.devel |
|---|---|
| Message-ID | <460695d0538b2d9df6511e7ae686469bcecc686a.1775524495.git.gniibe@fsij.org> |
This is a multi-part message in MIME format. --------------2.47.3 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit * tests/t-kem.c (test_kem_sntrup761, test_kem_mceliece6688128f) (test_kem_mlkem512, test_kem_mlkem768, test_kem_mlkem1024): Don't emit message here. (check_kem): But here, before the loop. Signed-off-by: NIIBE Yutaka <[email protected]> --- tests/t-kem.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) --------------2.47.3 Content-Type: text/x-patch; name="0001-tests-kem-Don-t-emit-a-message-each-time-but-once.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0001-tests-kem-Don-t-emit-a-message-each-time-but-once.patch" diff --git a/tests/t-kem.c b/tests/t-kem.c index 4e215b0f..557e3473 100644 --- a/tests/t-kem.c +++ b/tests/t-kem.c @@ -43,8 +43,6 @@ test_kem_sntrup761 (int testno) uint8_t key1[GCRY_KEM_SNTRUP761_SHARED_LEN]; uint8_t key2[GCRY_KEM_SNTRUP761_SHARED_LEN]; - info (" Checking SNTRUP761.\n"); - err = gcry_kem_genkey (GCRY_KEM_SNTRUP761, pubkey, GCRY_KEM_SNTRUP761_PUBKEY_LEN, seckey, GCRY_KEM_SNTRUP761_SECKEY_LEN, @@ -104,8 +102,6 @@ test_kem_mceliece6688128f (int testno) uint8_t key1[GCRY_KEM_CM6688128F_SHARED_LEN]; uint8_t key2[GCRY_KEM_CM6688128F_SHARED_LEN]; - info (" Checking CM6688128F.\n"); - err = gcry_kem_genkey (GCRY_KEM_CM6688128F, pubkey, GCRY_KEM_CM6688128F_PUBKEY_LEN, seckey, GCRY_KEM_CM6688128F_SECKEY_LEN, @@ -166,8 +162,6 @@ test_kem_mlkem512 (int testno) uint8_t key1[GCRY_KEM_MLKEM512_SHARED_LEN]; uint8_t key2[GCRY_KEM_MLKEM512_SHARED_LEN]; - info (" Checking MLKEM512.\n"); - err = gcry_kem_genkey (GCRY_KEM_MLKEM512, pubkey, GCRY_KEM_MLKEM512_PUBKEY_LEN, seckey, GCRY_KEM_MLKEM512_SECKEY_LEN, @@ -226,8 +220,6 @@ test_kem_mlkem768 (int testno) uint8_t key1[GCRY_KEM_MLKEM768_SHARED_LEN]; uint8_t key2[GCRY_KEM_MLKEM768_SHARED_LEN]; - info (" Checking MLKEM768.\n"); - err = gcry_kem_genkey (GCRY_KEM_MLKEM768, pubkey, GCRY_KEM_MLKEM768_PUBKEY_LEN, seckey, GCRY_KEM_MLKEM768_SECKEY_LEN, @@ -286,8 +278,6 @@ test_kem_mlkem1024 (int testno) uint8_t key1[GCRY_KEM_MLKEM1024_SHARED_LEN]; uint8_t key2[GCRY_KEM_MLKEM1024_SHARED_LEN]; - info (" Checking MLKEM1024.\n"); - err = gcry_kem_genkey (GCRY_KEM_MLKEM1024, pubkey, GCRY_KEM_MLKEM1024_PUBKEY_LEN, seckey, GCRY_KEM_MLKEM1024_SECKEY_LEN, @@ -500,6 +490,7 @@ check_kem (int n_loops) if ((selected_algo & SELECTED_ALGO_SNTRUP761)) { + info (" Checking SNTRUP761.\n"); for (testno = 0; testno < n_loops; testno++) test_kem_sntrup761 (testno); ntests += n_loops; @@ -507,6 +498,7 @@ check_kem (int n_loops) if ((selected_algo & SELECTED_ALGO_CM6688128F)) { + info (" Checking CM6688128F.\n"); for (testno = 0; testno < n_loops; testno++) test_kem_mceliece6688128f (testno); ntests += n_loops; @@ -515,6 +507,7 @@ check_kem (int n_loops) #ifdef USE_KYBER if ((selected_algo & SELECTED_ALGO_MLKEM512)) { + info (" Checking MLKEM512.\n"); for (testno = 0; testno < ntests + n_loops; testno++) test_kem_mlkem512 (testno); ntests += n_loops; @@ -522,6 +515,7 @@ check_kem (int n_loops) if ((selected_algo & SELECTED_ALGO_MLKEM768)) { + info (" Checking MLKEM768.\n"); for (testno = 0; testno < ntests + n_loops; testno++) test_kem_mlkem768 (testno); ntests += n_loops; @@ -529,6 +523,7 @@ check_kem (int n_loops) if ((selected_algo & SELECTED_ALGO_MLKEM1024)) { + info (" Checking MLKEM1024.\n"); for (testno = 0; testno < ntests + n_loops; testno++) test_kem_mlkem1024 (testno); ntests += n_loops; --------------2.47.3 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Gcrypt-devel mailing list [email protected] https://lists.gnupg.org/mailman/listinfo/gcrypt-devel --------------2.47.3--