Skip to content
Snippets Groups Projects
Commit 07db57cd authored by Niels Möller's avatar Niels Möller
Browse files

Benchmark salsa20r12.

parent fc9f5348
No related branches found
No related tags found
No related merge requests found
2013-04-17 Niels Möller <nisse@lysator.liu.se> 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. * Makefile.in (eccdata): Depend on mini-gmp files. Drop -lgmp.
* eccdata.c: Use mini-gmp, to avoid gmp dependency and associated * eccdata.c: Use mini-gmp, to avoid gmp dependency and associated
......
...@@ -662,7 +662,7 @@ main(int argc, char **argv) ...@@ -662,7 +662,7 @@ main(int argc, char **argv)
&nettle_des3, &nettle_des3,
&nettle_serpent256, &nettle_serpent256,
&nettle_twofish128, &nettle_twofish192, &nettle_twofish256, &nettle_twofish128, &nettle_twofish192, &nettle_twofish256,
&nettle_salsa20, &nettle_salsa20, &nettle_salsa20r12,
NULL NULL
}; };
......
...@@ -97,6 +97,15 @@ nettle_salsa20 = { ...@@ -97,6 +97,15 @@ nettle_salsa20 = {
(nettle_crypt_func *) salsa20_crypt (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 const struct nettle_aead
nettle_gcm_aes128 = _NETTLE_AEAD(gcm, GCM, aes, 128); nettle_gcm_aes128 = _NETTLE_AEAD(gcm, GCM, aes, 128);
const struct nettle_aead const struct nettle_aead
......
...@@ -62,6 +62,7 @@ extern const struct nettle_cipher nettle_blowfish128; ...@@ -62,6 +62,7 @@ extern const struct nettle_cipher nettle_blowfish128;
/* For benchmarking only, sets no iv and lies about the block size. */ /* 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_salsa20;
extern const struct nettle_cipher nettle_salsa20r12;
/* Glue to openssl, for comparative benchmarking. Code in /* Glue to openssl, for comparative benchmarking. Code in
* examples/nettle-openssl.c. */ * examples/nettle-openssl.c. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment