aboutsummaryrefslogtreecommitdiff
path: root/src/test/bench.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-12-04 21:27:07 -0500
committerNick Mathewson <nickm@torproject.org>2013-01-03 11:29:46 -0500
commitf58d4dfcd61aec7ea1900873ca08ecc31d7a7ef7 (patch)
tree12e9b9fbcbbaf319638926575b913daaea05f7e9 /src/test/bench.c
parent5fa1c7484cba293e6467acbca06a4143ce9da68d (diff)
downloadtor-f58d4dfcd61aec7ea1900873ca08ecc31d7a7ef7.tar
tor-f58d4dfcd61aec7ea1900873ca08ecc31d7a7ef7.tar.gz
Massive refactoring of the various handshake types
The three handshake types are now accessed from a unified interface; their state is abstracted from the rest of the cpath state, and so on.
Diffstat (limited to 'src/test/bench.c')
-rw-r--r--src/test/bench.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/test/bench.c b/src/test/bench.c
index 567b1a4d7..23560cd43 100644
--- a/src/test/bench.c
+++ b/src/test/bench.c
@@ -110,8 +110,8 @@ bench_onion_TAP(void)
int i;
crypto_pk_t *key, *key2;
uint64_t start, end;
- char os[ONIONSKIN_CHALLENGE_LEN];
- char or[ONIONSKIN_REPLY_LEN];
+ char os[TAP_ONIONSKIN_CHALLENGE_LEN];
+ char or[TAP_ONIONSKIN_REPLY_LEN];
crypto_dh_t *dh_out;
key = crypto_pk_new();
@@ -122,17 +122,18 @@ bench_onion_TAP(void)
reset_perftime();
start = perftime();
for (i = 0; i < iters; ++i) {
- onion_skin_create(key, &dh_out, os);
+ onion_skin_TAP_create(key, &dh_out, os);
crypto_dh_free(dh_out);
}
end = perftime();
printf("Client-side, part 1: %f usec.\n", NANOCOUNT(start, end, iters)/1e3);
- onion_skin_create(key, &dh_out, os);
+ onion_skin_TAP_create(key, &dh_out, os);
start = perftime();
for (i = 0; i < iters; ++i) {
char key_out[CPATH_KEY_MATERIAL_LEN];
- onion_skin_server_handshake(os, key, NULL, or, key_out, sizeof(key_out));
+ onion_skin_TAP_server_handshake(os, key, NULL, or,
+ key_out, sizeof(key_out));
}
end = perftime();
printf("Server-side, key guessed right: %f usec\n",
@@ -141,7 +142,8 @@ bench_onion_TAP(void)
start = perftime();
for (i = 0; i < iters; ++i) {
char key_out[CPATH_KEY_MATERIAL_LEN];
- onion_skin_server_handshake(os, key2, key, or, key_out, sizeof(key_out));
+ onion_skin_TAP_server_handshake(os, key2, key, or,
+ key_out, sizeof(key_out));
}
end = perftime();
printf("Server-side, key guessed wrong: %f usec.\n",
@@ -153,7 +155,7 @@ bench_onion_TAP(void)
char key_out[CPATH_KEY_MATERIAL_LEN];
int s;
dh = crypto_dh_dup(dh_out);
- s = onion_skin_client_handshake(dh, or, key_out, sizeof(key_out));
+ s = onion_skin_TAP_client_handshake(dh, or, key_out, sizeof(key_out));
tor_assert(s == 0);
}
end = perftime();