From: jsing Date: Tue, 11 Apr 2023 05:53:53 +0000 (+0000) Subject: Correct benchmark result computation on 32 bit platforms. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b2cabbc12a1e72cb4d2da0aba0e38395928f0709;p=openbsd Correct benchmark result computation on 32 bit platforms. --- diff --git a/regress/lib/libcrypto/bn/bn_general.c b/regress/lib/libcrypto/bn/bn_general.c index 94f7af19efe..622cbaf1051 100644 --- a/regress/lib/libcrypto/bn/bn_general.c +++ b/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/regress/lib/libcrypto/bn/bn_mul_div.c b/regress/lib/libcrypto/bn/bn_mul_div.c index 278f8d715ba..810c7cde19c 100644 --- a/regress/lib/libcrypto/bn/bn_mul_div.c +++ b/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);