From fa90e9b69959a68d38f6eac15a9a192cd04cff92 Mon Sep 17 00:00:00 2001 From: tb <> Date: Fri, 15 Jul 2022 06:14:17 +0000 Subject: Comment for factorization of n - 1 = k * 2^s in bn_miller_rabin_base_2() --- src/lib/libcrypto/bn/bn_bpsw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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 @@ -/* $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 * Copyright (c) 2022 Theo Buehler @@ -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++; -- cgit v1.2.3-55-g6feb