]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Enabled tests for openssl curves secp256r1 and secp192r1.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 10 Apr 2014 17:13:00 +0000 (19:13 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Thu, 10 Apr 2014 19:20:53 +0000 (21:20 +0200)
ChangeLog
examples/hogweed-benchmark.c

index 24abf00436f0acd26480ba9a122098796f1d7704..c46e258246d461155c333285e87327855f3d2276 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-04-10  Niels Möller  <nisse@lysator.liu.se>
+
+       From Nikos Mavrogiannopoulos:
+       * examples/hogweed-benchmark.c (bench_openssl_ecdsa_init): Support
+       for secp192r1 and secp256r1.
+       (alg_list): Add them.
+
 2014-04-09  Niels Möller  <nisse@lysator.liu.se>
 
        * examples/nettle-benchmark.c (main): Benchmark sha512_224 and
index 3b189c4cc90947956f7b45ee30d2d1c4d43ecd2a..3125b034bd5807e9c2edf67323f149a6be225d0e 100644 (file)
@@ -564,28 +564,23 @@ bench_openssl_ecdsa_init (unsigned size)
 {
   struct openssl_ecdsa_ctx *ctx = xalloc (sizeof (*ctx));
 
-  /* Apparently, secp192r1 and secp256r1 are missing */
   switch (size)
     {
-#if 0
     case 192:
-      ctx->key = EC_KEY_new_by_curve_name (NID_secp192r1);
+      ctx->key = EC_KEY_new_by_curve_name (NID_X9_62_prime192v1);
       ctx->digest_length = 24; /* truncated */
       ctx->digest = hash_string (&nettle_sha224, 3, "abc");
       break;
-#endif
     case 224:
       ctx->key = EC_KEY_new_by_curve_name (NID_secp224r1);
       ctx->digest_length = SHA224_DIGEST_SIZE;
       ctx->digest = hash_string (&nettle_sha224, 3, "abc");
       break;
-#if 0
     case 256:
-      ctx->key = EC_KEY_new_by_curve_name (NID_secp256r1);
+      ctx->key = EC_KEY_new_by_curve_name (NID_X9_62_prime256v1);
       ctx->digest_length = SHA256_DIGEST_SIZE;
       ctx->digest = hash_string (&nettle_sha256, 3, "abc");
       break;
-#endif
     case 384:
       ctx->key = EC_KEY_new_by_curve_name (NID_secp384r1);
       ctx->digest_length = SHA384_DIGEST_SIZE;
@@ -653,7 +648,9 @@ struct alg alg_list[] = {
   { "ecdsa",  384, bench_ecdsa_init, bench_ecdsa_sign, bench_ecdsa_verify, bench_ecdsa_clear },
   { "ecdsa",  521, bench_ecdsa_init, bench_ecdsa_sign, bench_ecdsa_verify, bench_ecdsa_clear },
 #if WITH_OPENSSL
+  { "ecdsa (openssl)",  192, bench_openssl_ecdsa_init, bench_openssl_ecdsa_sign, bench_openssl_ecdsa_verify, bench_openssl_ecdsa_clear },
   { "ecdsa (openssl)",  224, bench_openssl_ecdsa_init, bench_openssl_ecdsa_sign, bench_openssl_ecdsa_verify, bench_openssl_ecdsa_clear },
+  { "ecdsa (openssl)",  256, bench_openssl_ecdsa_init, bench_openssl_ecdsa_sign, bench_openssl_ecdsa_verify, bench_openssl_ecdsa_clear },
   { "ecdsa (openssl)",  384, bench_openssl_ecdsa_init, bench_openssl_ecdsa_sign, bench_openssl_ecdsa_verify, bench_openssl_ecdsa_clear },
   { "ecdsa (openssl)",  521, bench_openssl_ecdsa_init, bench_openssl_ecdsa_sign, bench_openssl_ecdsa_verify, bench_openssl_ecdsa_clear },
 #endif