summaryrefslogtreecommitdiff
path: root/rsa/__init__.py
diff options
context:
space:
mode:
authorBarry Mead <barrymead@cox.net>2010-02-23 23:17:16 -0700
committerBarry Mead <barrymead@cox.net>2010-02-23 23:17:16 -0700
commitb834cb936a8933ccd67ef099c625521a7a2fcfc0 (patch)
treeea12c7621d50d72be5714f08ce35933f9fb7a55d /rsa/__init__.py
parentf6679448c2fc8d5dd72ff6090f21a1d88d1e19ab (diff)
downloadrsa-b834cb936a8933ccd67ef099c625521a7a2fcfc0.tar.gz
replaced b^2 with b*b in jacobi,& fixed a comment in jacobi-witness
Diffstat (limited to 'rsa/__init__.py')
-rw-r--r--rsa/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/rsa/__init__.py b/rsa/__init__.py
index eef217f..306a569 100644
--- a/rsa/__init__.py
+++ b/rsa/__init__.py
@@ -208,7 +208,7 @@ def jacobi(a, b):
result = -result
a, b = b % a, a
else:
- if (((b ** 2) - 1) >> 3) & 1:
+ if (((b * b) - 1) >> 3) & 1:
result = -result
a >>= 1
if a == 0: return 0
@@ -229,7 +229,7 @@ def randomized_primality_testing(n, k):
"""Calculates whether n is composite (which is always correct) or
prime (which is incorrect with error probability 2**-k)
- Returns False if the number if composite, and True if it's
+ Returns False if the number is composite, and True if it's
probably prime.
"""