Skip to content

Commit 21d3fb6

Browse files
committed
bench_ecmult: improve clarity of output
Previously "ecmult{,_multi} xg" meant multiplication with (x - 1) random points and base point G. Now - xP means multiplication with x random points and - xP & G means multiplication with x random points and G
1 parent 20d791e commit 21d3fb6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/bench_ecmult.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,13 @@ static void run_ecmult_bench(bench_data* data, int iters) {
175175
sprintf(str, "ecmult_const");
176176
run_benchmark(str, bench_ecmult_const, bench_ecmult_setup, bench_ecmult_const_teardown, data, 10, iters);
177177
/* ecmult with non generator point */
178-
sprintf(str, "ecmult 1");
178+
sprintf(str, "ecmult 1P");
179179
run_benchmark(str, bench_ecmult_1, bench_ecmult_setup, bench_ecmult_1_teardown, data, 10, iters);
180180
/* ecmult with generator point */
181-
sprintf(str, "ecmult 1g");
181+
sprintf(str, "ecmult 0P & G");
182182
run_benchmark(str, bench_ecmult_1g, bench_ecmult_setup, bench_ecmult_1g_teardown, data, 10, iters);
183183
/* ecmult with generator and non-generator point. The reported time is per point. */
184-
sprintf(str, "ecmult 2g");
184+
sprintf(str, "ecmult 1P & G");
185185
run_benchmark(str, bench_ecmult_2g, bench_ecmult_setup, bench_ecmult_2g_teardown, data, 10, 2*iters);
186186
}
187187

@@ -270,7 +270,11 @@ static void run_ecmult_multi_bench(bench_data* data, size_t count, int includes_
270270
}
271271

272272
/* Run the benchmark. */
273-
sprintf(str, includes_g ? "ecmult_multi %ig" : "ecmult_multi %i", (int)count);
273+
if (includes_g) {
274+
sprintf(str, "ecmult_multi %iP & G", (int)count - 1);
275+
} else {
276+
sprintf(str, "ecmult_multi %iP", (int)count);
277+
}
274278
run_benchmark(str, bench_ecmult_multi, bench_ecmult_multi_setup, bench_ecmult_multi_teardown, data, 10, count * iters);
275279
}
276280

0 commit comments

Comments
 (0)