[PATCH] tests/bench-slope: allow non-FIPS ECC benchmarking in non-FIPS mode

Jussi Kivilinna jussi.kivilinna at iki.fi
Tue Aug 10 20:50:47 CEST 2021


* tests/bench-slope.c (_ecc_bench): Check for 'in_fips_mode'.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
---
 tests/bench-slope.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/bench-slope.c b/tests/bench-slope.c
index 5bdb391e..d1b7f24f 100644
--- a/tests/bench-slope.c
+++ b/tests/bench-slope.c
@@ -2200,7 +2200,7 @@ ecc_algo_fips_allowed (int algo)
       case ECC_ALGO_NIST_P256:
       case ECC_ALGO_NIST_P384:
       case ECC_ALGO_NIST_P521:
-        return 1;
+	return 1;
       case ECC_ALGO_SECP256K1:
       case ECC_ALGO_ED25519:
       case ECC_ALGO_ED448:
@@ -2704,7 +2704,7 @@ _ecc_bench (int algo)
   int i;
 
   /* Skip not allowed mechanisms */
-  if (!ecc_algo_fips_allowed(algo))
+  if (in_fips_mode && !ecc_algo_fips_allowed (algo))
     return;
 
   algo_name = ecc_algo_name (algo);
-- 
2.30.2




More information about the Gcrypt-devel mailing list