From 97982f8cb757491c010f952b51d71fc8f9f25fdc Mon Sep 17 00:00:00 2001 From: Pedro Barbosa Date: Fri, 12 Apr 2024 11:09:50 +0200 Subject: [PATCH] No public description PiperOrigin-RevId: 624097515 --- paranoid_crypto/lib/special_case_factoring.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paranoid_crypto/lib/special_case_factoring.py b/paranoid_crypto/lib/special_case_factoring.py index 8c9dd47..ed4ce2f 100644 --- a/paranoid_crypto/lib/special_case_factoring.py +++ b/paranoid_crypto/lib/special_case_factoring.py @@ -69,7 +69,7 @@ def FactorWithGuess(n: int, p_0: int) -> Optional[list[int]]: # To avoid this the cube root of n // 2**(3*shift) is computed instead. bits = n.bit_length() shift = max(0, (bits // 3) - 52) - bound = int((n >> (3 * shift)) ** (1 / 3)) << shift + bound = int((int(n) >> (3 * shift)) ** (1 / 3)) << shift for _, u, v in ntheory_util.ContinuedFraction(p_0, q_0): # An approximation u / v of p_0 / q_0 is good enough for this factoring