summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2022-07-15 06:14:18 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2022-07-15 06:14:18 +0000
commit1bcb655acd64114ebd8997e0b88fbe210878e724 (patch)
tree143e9039918e180945b7e9954afd6bccc29753c3 /lib/libcrypto
parentcf1886f44bcb8b4fabb2eee8236797e8be74af83 (diff)
Comment for factorization of n - 1 = k * 2^s in bn_miller_rabin_base_2()
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/bn/bn_bpsw.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libcrypto/bn/bn_bpsw.c b/lib/libcrypto/bn/bn_bpsw.c
index 0741c6fffea..f189571ebe0 100644
--- a/lib/libcrypto/bn/bn_bpsw.c
+++ b/lib/libcrypto/bn/bn_bpsw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn_bpsw.c,v 1.1 2022/07/13 06:32:15 tb Exp $ */
+/* $OpenBSD: bn_bpsw.c,v 1.2 2022/07/15 06:14:17 tb Exp $ */
/*
* Copyright (c) 2022 Martin Grenouilloux <martin.grenouilloux@lse.epita.fr>
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
@@ -319,6 +319,7 @@ bn_miller_rabin_base_2(int *is_prime, const BIGNUM *n, BN_CTX *ctx)
if (!BN_sub(n_minus_one, n, BN_value_one()))
goto err;
+ /* Factorize n - 1 = k * 2^s. */
s = 0;
while (!BN_is_bit_set(n_minus_one, s))
s++;