aboutsummaryrefslogtreecommitdiff
path: root/src/test/bench.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/bench.c')
-rw-r--r--src/test/bench.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/bench.c b/src/test/bench.c
index c9cc101b7..f6c33626f 100644
--- a/src/test/bench.c
+++ b/src/test/bench.c
@@ -338,6 +338,28 @@ bench_dmap(void)
}
static void
+bench_siphash(void)
+{
+ char buf[128];
+ int lens[] = { 7, 8, 15, 16, 20, 32, 111, 128, -1 };
+ int i, j;
+ uint64_t start, end;
+ const int N = 300000;
+ crypto_rand(buf, sizeof(buf));
+
+ for (i = 0; lens[i] > 0; ++i) {
+ reset_perftime();
+ start = perftime();
+ for (j = 0; j < N; ++j) {
+ siphash24g(buf, lens[i]);
+ }
+ end = perftime();
+ printf("siphash24g(%d): %.2f ns per call\n",
+ lens[i], NANOCOUNT(start,end,N));
+ }
+}
+
+static void
bench_cell_ops(void)
{
const int iters = 1<<16;
@@ -487,6 +509,7 @@ typedef struct benchmark_t {
static struct benchmark_t benchmarks[] = {
ENT(dmap),
+ ENT(siphash),
ENT(aes),
ENT(onion_TAP),
#ifdef CURVE25519_ENABLED