diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_mul_div.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/regress/lib/libcrypto/bn/bn_mul_div.c b/src/regress/lib/libcrypto/bn/bn_mul_div.c index 2ebb06f821..2615904c45 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.1 2023/01/29 15:18:49 jsing Exp $ */ | 1 | /* $OpenBSD: bn_mul_div.c,v 1.2 2023/01/29 15:22:12 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -30,9 +30,9 @@ static int | |||
30 | benchmark_bn_mul_setup(BIGNUM *a, size_t a_bits, BIGNUM *b, size_t b_bits, | 30 | benchmark_bn_mul_setup(BIGNUM *a, size_t a_bits, BIGNUM *b, size_t b_bits, |
31 | BIGNUM *r) | 31 | BIGNUM *r) |
32 | { | 32 | { |
33 | if (!BN_rand(a, a_bits - 1, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY)) | 33 | if (!BN_rand(a, a_bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY)) |
34 | return 0; | 34 | return 0; |
35 | if (!BN_rand(b, b_bits - 1, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY)) | 35 | if (!BN_rand(b, b_bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY)) |
36 | return 0; | 36 | return 0; |
37 | if (!BN_set_bit(r, (a_bits + b_bits) - 1)) | 37 | if (!BN_set_bit(r, (a_bits + b_bits) - 1)) |
38 | return 0; | 38 | return 0; |
@@ -51,7 +51,7 @@ static int | |||
51 | benchmark_bn_sqr_setup(BIGNUM *a, size_t a_bits, BIGNUM *b, size_t b_bits, | 51 | benchmark_bn_sqr_setup(BIGNUM *a, size_t a_bits, BIGNUM *b, size_t b_bits, |
52 | BIGNUM *r) | 52 | BIGNUM *r) |
53 | { | 53 | { |
54 | if (!BN_rand(a, a_bits - 1, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY)) | 54 | if (!BN_rand(a, a_bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY)) |
55 | return 0; | 55 | return 0; |
56 | if (!BN_set_bit(r, (a_bits + a_bits) - 1)) | 56 | if (!BN_set_bit(r, (a_bits + a_bits) - 1)) |
57 | return 0; | 57 | return 0; |