diff options
author | Yawning Angel <yawning@schwanenlied.me> | 2015-07-06 10:11:10 +0000 |
---|---|---|
committer | Yawning Angel <yawning@schwanenlied.me> | 2015-07-06 10:11:10 +0000 |
commit | 840e68d9171d62a1fdaf0395e248daad2cbe014f (patch) | |
tree | 3a8fba7c3e90ddb885ad817e68e8bb0afe003245 /src/test/bench.c | |
parent | f079c27761a676f7c4200f7275112edd0b5e1270 (diff) | |
download | tor-840e68d9171d62a1fdaf0395e248daad2cbe014f.tar.gz tor-840e68d9171d62a1fdaf0395e248daad2cbe014f.zip |
Integrate and enable ed25519-donna.
The runtime sanity checking is slightly different from the optimized
basepoint stuff in that it uses a given implementation's self tests if
available, and checks if signing/verification works with a test vector
from the IETF EdDSA draft.
The unit tests include a new testcase that will fuzz donna against ref0,
including the blinding and curve25519 key conversion routines. If this
is something that should be done at runtime (No?), the code can be
stolen from there.
Note: Integrating batch verification is not done yet.
Diffstat (limited to 'src/test/bench.c')
-rw-r--r-- | src/test/bench.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/test/bench.c b/src/test/bench.c index dbff7d0262..2a27377c80 100644 --- a/src/test/bench.c +++ b/src/test/bench.c @@ -248,7 +248,7 @@ bench_onion_ntor(void) } static void -bench_ed25519(void) +bench_ed25519_impl(void) { uint64_t start, end; const int iters = 1<<12; @@ -305,6 +305,19 @@ bench_ed25519(void) } static void +bench_ed25519(void) +{ + int donna; + + for (donna = 0; donna <= 1; ++donna) { + printf("Ed25519-donna = %s.\n", + (donna == 0) ? "disabled" : "enabled"); + ed25519_set_impl_params(donna); + bench_ed25519_impl(); + } +} + +static void bench_cell_aes(void) { uint64_t start, end; |