summaryrefslogtreecommitdiff
path: root/rsa/core.py
diff options
context:
space:
mode:
authorSybren A. St?vel <sybren@stuvel.eu>2011-07-10 14:16:19 +0200
committerSybren A. St?vel <sybren@stuvel.eu>2011-07-10 14:16:19 +0200
commitb666624b20a20d7e5861c93cdea2356cc0bb3c79 (patch)
tree0a7d714c9a5f0edaa69c3e6203ce8ec1b4d804e4 /rsa/core.py
parent11016f9b792c59f4f95c1efb379db5d5ad8c7786 (diff)
downloadrsa-b666624b20a20d7e5861c93cdea2356cc0bb3c79.tar.gz
Removed safebit stuff as it breaks in certain situations. Will look at it later.
Diffstat (limited to 'rsa/core.py')
-rwxr-xr-xrsa/core.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/rsa/core.py b/rsa/core.py
index 2df4be5..aa72957 100755
--- a/rsa/core.py
+++ b/rsa/core.py
@@ -6,7 +6,7 @@ mathematically on integers.
import types
-import rsa.common
+#import rsa.common
def encrypt_int(message, ekey, n):
"""Encrypts a message using encryption key 'ekey', working modulo n"""
@@ -24,8 +24,8 @@ def encrypt_int(message, ekey, n):
raise OverflowError("The message %i is too long for n=%i" % (message, n))
#Note: Bit exponents start at zero (bit counts start at 1) this is correct
- safebit = rsa.common.bit_size(n) - 2 # compute safe bit (MSB - 1)
- message += (1 << safebit) # add safebit to ensure folding
+# safebit = rsa.common.bit_size(n) - 2 # compute safe bit (MSB - 1)
+# message += (1 << safebit) # add safebit to ensure folding
return pow(message, ekey, n)
@@ -35,8 +35,8 @@ def decrypt_int(cyphertext, dkey, n):
message = pow(cyphertext, dkey, n)
- safebit = rsa.common.bit_size(n) - 2 # compute safe bit (MSB - 1)
- message -= (1 << safebit) # remove safebit before decode
+# safebit = rsa.common.bit_size(n) - 2 # compute safe bit (MSB - 1)
+# message -= (1 << safebit) # remove safebit before decode
return message