diff options
author | jsing <> | 2023-01-29 15:33:43 +0000 |
---|---|---|
committer | jsing <> | 2023-01-29 15:33:43 +0000 |
commit | c66da55bf83b33c7f819d7ad8cef1c38dfef07e0 (patch) | |
tree | 07bdf209e46b71be673ef90e00cbfe00a004011a /src | |
parent | af65aea58ca04917a71384b3049d8888bb88e79d (diff) | |
download | openbsd-c66da55bf83b33c7f819d7ad8cef1c38dfef07e0.tar.gz openbsd-c66da55bf83b33c7f819d7ad8cef1c38dfef07e0.tar.bz2 openbsd-c66da55bf83b33c7f819d7ad8cef1c38dfef07e0.zip |
Set BN_FLG_CONSTTIME on benchmark inputs.
The public APIs still change behaviour based on BN_FLG_CONSTTIME - set it
to avoid benchmark noise.
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_mul_div.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/regress/lib/libcrypto/bn/bn_mul_div.c b/src/regress/lib/libcrypto/bn/bn_mul_div.c index 28f8f75646..77805b9a80 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 @@ | |||
1 | /* $OpenBSD: bn_mul_div.c,v 1.3 2023/01/29 15:26:55 jsing Exp $ */ | 1 | /* $OpenBSD: bn_mul_div.c,v 1.4 2023/01/29 15:33:43 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -358,6 +358,9 @@ benchmark_run(const struct benchmark *bm, int seconds) | |||
358 | if ((q = BN_CTX_get(bn_ctx)) == NULL) | 358 | if ((q = BN_CTX_get(bn_ctx)) == NULL) |
359 | errx(1, "BN_CTX_get"); | 359 | errx(1, "BN_CTX_get"); |
360 | 360 | ||
361 | BN_set_flags(a, BN_FLG_CONSTTIME); | ||
362 | BN_set_flags(b, BN_FLG_CONSTTIME); | ||
363 | |||
361 | if (!bm->setup(a, bm->a_bits, b, bm->b_bits, r, q)) | 364 | if (!bm->setup(a, bm->a_bits, b, bm->b_bits, r, q)) |
362 | errx(1, "benchmark setup failed"); | 365 | errx(1, "benchmark setup failed"); |
363 | 366 | ||