aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2014-08-08 16:26:27 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2016-11-14 16:20:51 +0100
commit0ab854789d26e7f3a1162ac78f7a3fa7cb9aa3a1 (patch)
treed2f89869da0e747e7fc99837915410a4e52bd269 /scripts
parent053275150bfc47f2fa0bfa8c584487d3a764c334 (diff)
downloadstrongswan-0ab854789d26e7f3a1162ac78f7a3fa7cb9aa3a1.tar.bz2
strongswan-0ab854789d26e7f3a1162ac78f7a3fa7cb9aa3a1.tar.xz
dh-speed: Include the get_my_public_value() call in public exponent timing
This fixes results where a DH backend does not generate the public value in the constructor internally.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/dh_speed.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/dh_speed.c b/scripts/dh_speed.c
index 300a7da8b..40b83168a 100644
--- a/scripts/dh_speed.c
+++ b/scripts/dh_speed.c
@@ -66,7 +66,7 @@ static double end_timing(struct timespec *start)
static void run_test(diffie_hellman_group_t group, int rounds)
{
diffie_hellman_t *l[rounds], *r;
- chunk_t chunk;
+ chunk_t chunk, chunks[rounds];
struct timespec timing;
int round;
@@ -85,14 +85,14 @@ static void run_test(diffie_hellman_group_t group, int rounds)
for (round = 0; round < rounds; round++)
{
l[round] = lib->crypto->create_dh(lib->crypto, group);
+ assert(l[round]->get_my_public_value(l[round], &chunks[round]));
}
printf("A = g^a/s: %8.1f", rounds / end_timing(&timing));
for (round = 0; round < rounds; round++)
{
- assert(l[round]->get_my_public_value(l[round], &chunk));
- assert(r->set_other_public_value(r, chunk));
- chunk_free(&chunk);
+ assert(r->set_other_public_value(r, chunks[round]));
+ chunk_free(&chunks[round]);
}
assert(r->get_my_public_value(r, &chunk));