From ed39abf2dcf0e5422ecdb755974b914bf9225ed6 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Tue, 11 Apr 2023 05:53:53 +0000 Subject: Correct benchmark result computation on 32 bit platforms. --- src/regress/lib/libcrypto/bn/bn_general.c | 4 ++-- src/regress/lib/libcrypto/bn/bn_mul_div.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/regress/lib/libcrypto/bn/bn_general.c b/src/regress/lib/libcrypto/bn/bn_general.c index 94f7af19ef..622cbaf105 100644 --- a/src/regress/lib/libcrypto/bn/bn_general.c +++ b/src/regress/lib/libcrypto/bn/bn_general.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_general.c,v 1.1 2023/04/10 19:02:30 jsing Exp $ */ +/* $OpenBSD: bn_general.c,v 1.2 2023/04/11 05:53:53 jsing Exp $ */ /* * Copyright (c) 2022, 2023 Joel Sing * @@ -148,7 +148,7 @@ benchmark_run(const struct benchmark *bm, int seconds) timespecsub(&end, &start, &duration); fprintf(stderr, "%d iterations in %f seconds - %llu op/s\n", i, duration.tv_sec + duration.tv_nsec / 1000000000.0, - (size_t)i * 1000000000 / + (uint64_t)i * 1000000000 / (duration.tv_sec * 1000000000 + duration.tv_nsec)); BN_free(src); diff --git a/src/regress/lib/libcrypto/bn/bn_mul_div.c b/src/regress/lib/libcrypto/bn/bn_mul_div.c index 278f8d715b..810c7cde19 100644 --- a/src/regress/lib/libcrypto/bn/bn_mul_div.c +++ b/src/regress/lib/libcrypto/bn/bn_mul_div.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_mul_div.c,v 1.5 2023/01/29 15:51:26 jsing Exp $ */ +/* $OpenBSD: bn_mul_div.c,v 1.6 2023/04/11 05:53:53 jsing Exp $ */ /* * Copyright (c) 2023 Joel Sing * @@ -386,7 +386,7 @@ benchmark_run(const struct benchmark *bm, int seconds) timespecsub(&end, &start, &duration); fprintf(stderr, "%d iterations in %f seconds - %llu op/s\n", i, duration.tv_sec + duration.tv_nsec / 1000000000.0, - (size_t)i * 1000000000 / + (uint64_t)i * 1000000000 / (duration.tv_sec * 1000000000 + duration.tv_nsec)); BN_CTX_end(bn_ctx); -- cgit v1.2.3-55-g6feb