diff options
author | Yawning Angel <yawning@schwanenlied.me> | 2015-07-06 09:57:23 +0000 |
---|---|---|
committer | Yawning Angel <yawning@schwanenlied.me> | 2015-07-06 09:57:23 +0000 |
commit | f079c27761a676f7c4200f7275112edd0b5e1270 (patch) | |
tree | 1bc4675ea4d302882507d21ce8b958bf569b7e4b /src/test/bench.c | |
parent | be113f0bce4516df1ad5b7a7a50707c466bdf9a4 (diff) | |
download | tor-f079c27761a676f7c4200f7275112edd0b5e1270.tar.gz tor-f079c27761a676f7c4200f7275112edd0b5e1270.zip |
Integrate the accelerated Curve25519 scalar basemult.
Integration work scavanged from nickm's `ticket8897_9663_v2` branch,
with minor modifications. Tor will still sanity check the output but
now also attempts to catch extreme breakage by spot checking the
optimized implementation vs known values from the NaCl documentation.
Implements feature 9663.
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 bc2b1f04d8..dbff7d0262 100644 --- a/src/test/bench.c +++ b/src/test/bench.c @@ -177,7 +177,7 @@ bench_onion_TAP(void) } static void -bench_onion_ntor(void) +bench_onion_ntor_impl(void) { const int iters = 1<<10; int i; @@ -235,6 +235,19 @@ bench_onion_ntor(void) } static void +bench_onion_ntor(void) +{ + int ed; + + for (ed = 0; ed <= 1; ++ed) { + printf("Ed25519-based basepoint multiply = %s.\n", + (ed == 0) ? "disabled" : "enabled"); + curve25519_set_impl_params(ed); + bench_onion_ntor_impl(); + } +} + +static void bench_ed25519(void) { uint64_t start, end; |