artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
72c289b
)
Set BN_FLG_CONSTTIME on benchmark inputs.
author
jsing
<jsing@openbsd.org>
Sun, 29 Jan 2023 15:33:43 +0000
(15:33 +0000)
committer
jsing
<jsing@openbsd.org>
Sun, 29 Jan 2023 15:33:43 +0000
(15:33 +0000)
The public APIs still change behaviour based on BN_FLG_CONSTTIME - set it
to avoid benchmark noise.
regress/lib/libcrypto/bn/bn_mul_div.c
patch
|
blob
|
history
diff --git
a/regress/lib/libcrypto/bn/bn_mul_div.c
b/regress/lib/libcrypto/bn/bn_mul_div.c
index
28f8f75
..
77805b9
100644
(file)
--- 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.
3 2023/01/29 15:26:55
jsing Exp $ */
+/* $OpenBSD: bn_mul_div.c,v 1.
4 2023/01/29 15:33:43
jsing Exp $ */
/*
* Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
*
@@
-358,6
+358,9
@@
benchmark_run(const struct benchmark *bm, int seconds)
if ((q = BN_CTX_get(bn_ctx)) == NULL)
errx(1, "BN_CTX_get");
+ BN_set_flags(a, BN_FLG_CONSTTIME);
+ BN_set_flags(b, BN_FLG_CONSTTIME);
+
if (!bm->setup(a, bm->a_bits, b, bm->b_bits, r, q))
errx(1, "benchmark setup failed");