summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@corsac.net>2017-04-01 16:26:44 +0200
committerYves-Alexis Perez <corsac@corsac.net>2017-04-01 16:26:44 +0200
commit05ddd767992d68bb38c7f16ece142e8c2e9ae016 (patch)
tree302c618be306d4ed3c7f9fc58a1f6aaad4dd252f /scripts
parent25663e04c3ab01ef8dc9f906608282319cfea2db (diff)
downloadvyos-strongswan-05ddd767992d68bb38c7f16ece142e8c2e9ae016.tar.gz
vyos-strongswan-05ddd767992d68bb38c7f16ece142e8c2e9ae016.zip
New upstream version 5.5.2
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.in2
-rw-r--r--scripts/dh_speed.c17
2 files changed, 12 insertions, 7 deletions
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 606efcf41..6b8319cca 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -418,7 +418,6 @@ exec_prefix = @exec_prefix@
fips_mode = @fips_mode@
gtk_CFLAGS = @gtk_CFLAGS@
gtk_LIBS = @gtk_LIBS@
-h_plugins = @h_plugins@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
@@ -453,6 +452,7 @@ nm_LIBS = @nm_LIBS@
nm_ca_dir = @nm_ca_dir@
nm_plugins = @nm_plugins@
oldincludedir = @oldincludedir@
+p_plugins = @p_plugins@
pcsclite_CFLAGS = @pcsclite_CFLAGS@
pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
diff --git a/scripts/dh_speed.c b/scripts/dh_speed.c
index 0643ea92a..c2cac0260 100644
--- a/scripts/dh_speed.c
+++ b/scripts/dh_speed.c
@@ -46,6 +46,7 @@ struct {
{"ecp521", ECP_521_BIT},
{"ecp192", ECP_192_BIT},
{"ecp224", ECP_224_BIT},
+ {"curve25519", CURVE_25519},
};
static void start_timing(struct timespec *start)
@@ -65,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], lsecrets[rounds], rsecrets[rounds];
struct timespec timing;
int round;
@@ -77,21 +78,21 @@ static void run_test(diffie_hellman_group_t group, int rounds)
return;
}
- printf("%N:\t",
- diffie_hellman_group_names, group);
+ printf("%N:\t", diffie_hellman_group_names, group);
start_timing(&timing);
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]));
+ assert(r->get_shared_secret(r, &rsecrets[round]));
+ chunk_free(&chunks[round]);
}
assert(r->get_my_public_value(r, &chunk));
@@ -99,12 +100,16 @@ static void run_test(diffie_hellman_group_t group, int rounds)
for (round = 0; round < rounds; round++)
{
assert(l[round]->set_other_public_value(l[round], chunk));
+ assert(l[round]->get_shared_secret(l[round], &lsecrets[round]));
}
printf(" | S = B^a/s: %8.1f\n", rounds / end_timing(&timing));
chunk_free(&chunk);
for (round = 0; round < rounds; round++)
{
+ assert(chunk_equals(rsecrets[round], lsecrets[round]));
+ free(lsecrets[round].ptr);
+ free(rsecrets[round].ptr);
l[round]->destroy(l[round]);
}
r->destroy(r);