summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-07-15 06:14:17 +0000
committertb <>2022-07-15 06:14:17 +0000
commitfa90e9b69959a68d38f6eac15a9a192cd04cff92 (patch)
treeb1e5e4e1d5b0d82676e3f4e09d5bd176cfc9fce6 /src
parentac5cf725e1e142a94bedd1081a6e13562a10e88f (diff)
downloadopenbsd-fa90e9b69959a68d38f6eac15a9a192cd04cff92.tar.gz
openbsd-fa90e9b69959a68d38f6eac15a9a192cd04cff92.tar.bz2
openbsd-fa90e9b69959a68d38f6eac15a9a192cd04cff92.zip
Comment for factorization of n - 1 = k * 2^s in bn_miller_rabin_base_2()
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/bn/bn_bpsw.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libcrypto/bn/bn_bpsw.c b/src/lib/libcrypto/bn/bn_bpsw.c
index 0741c6fffe..f189571ebe 100644
--- a/src/lib/libcrypto/bn/bn_bpsw.c
+++ b/src/lib/libcrypto/bn/bn_bpsw.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_bpsw.c,v 1.1 2022/07/13 06:32:15 tb Exp $ */ 1/* $OpenBSD: bn_bpsw.c,v 1.2 2022/07/15 06:14:17 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2022 Martin Grenouilloux <martin.grenouilloux@lse.epita.fr> 3 * Copyright (c) 2022 Martin Grenouilloux <martin.grenouilloux@lse.epita.fr>
4 * Copyright (c) 2022 Theo Buehler <tb@openbsd.org> 4 * 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)
319 if (!BN_sub(n_minus_one, n, BN_value_one())) 319 if (!BN_sub(n_minus_one, n, BN_value_one()))
320 goto err; 320 goto err;
321 321
322 /* Factorize n - 1 = k * 2^s. */
322 s = 0; 323 s = 0;
323 while (!BN_is_bit_set(n_minus_one, s)) 324 while (!BN_is_bit_set(n_minus_one, s))
324 s++; 325 s++;