]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Benchmark salsa20r12.
authorNiels Möller <nisse@lysator.liu.se>
Wed, 17 Apr 2013 11:22:35 +0000 (13:22 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Wed, 17 Apr 2013 11:22:35 +0000 (13:22 +0200)
ChangeLog
examples/nettle-benchmark.c
nettle-internal.c
nettle-internal.h

index ce8dde47a423861d7d7bcf7e4dcf67168318b5d2..ca9322bddb14cfaa7a6385aff034a5f7ae74ab40 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2013-04-17  Niels Möller  <nisse@lysator.liu.se>
 
+       * examples/nettle-benchmark.c (main): Benchmark salsa20r12.
+
+       * nettle-internal.c (nettle_salsa20r12): Cipher struct for
+       benchmarking only.
+       * nettle-internal.h (nettle_salsa20): Declare it.
+
        * Makefile.in (eccdata): Depend on mini-gmp files. Drop -lgmp.
 
        * eccdata.c: Use mini-gmp, to avoid gmp dependency and associated
index 5be3d49b9d5b94b19ef6fb583f2aea2676a36f8e..5d38aa153f73ce4c8f9d15364639f7bc2469f3c2 100644 (file)
@@ -662,7 +662,7 @@ main(int argc, char **argv)
       &nettle_des3,
       &nettle_serpent256,
       &nettle_twofish128, &nettle_twofish192, &nettle_twofish256,
-      &nettle_salsa20,
+      &nettle_salsa20, &nettle_salsa20r12,
       NULL
     };
 
index d1d76752cafc28047bb6224d9cc8639fff5173d7..f271eac051a20d73738e2c68600aea26e2ff9032 100644 (file)
@@ -97,6 +97,15 @@ nettle_salsa20 = {
   (nettle_crypt_func *) salsa20_crypt
 };
 
+const struct nettle_cipher
+nettle_salsa20r12 = {
+  "salsa20r12", sizeof(struct salsa20_ctx),
+  0, SALSA20_KEY_SIZE,
+  salsa20_set_key_hack, salsa20_set_key_hack,
+  (nettle_crypt_func *) salsa20r12_crypt,
+  (nettle_crypt_func *) salsa20r12_crypt
+};
+
 const struct nettle_aead
 nettle_gcm_aes128 = _NETTLE_AEAD(gcm, GCM, aes, 128);
 const struct nettle_aead
index 3b7f771d0c5b9b442fc0886dfa213f715ce95240..71452d45d72aa5b01bbb91bb74ecad9c82e77aba 100644 (file)
@@ -62,6 +62,7 @@ extern const struct nettle_cipher nettle_blowfish128;
 
 /* For benchmarking only, sets no iv and lies about the block size. */
 extern const struct nettle_cipher nettle_salsa20;
+extern const struct nettle_cipher nettle_salsa20r12;
 
 /* Glue to openssl, for comparative benchmarking. Code in
  * examples/nettle-openssl.c. */