diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2011-07-30 22:54:40 +0200 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2011-07-30 22:54:40 +0200 |
commit | c5aea514a0fc8e9496f16dd212c314322965c780 (patch) | |
tree | 69f137d3fba61822b8cfc3dbeb016ae1e296b75a /rsa/key.py | |
parent | 5524a39f4114430ac4dee2f81fc436ac3b3a815b (diff) | |
download | rsa-c5aea514a0fc8e9496f16dd212c314322965c780.tar.gz |
Using int() rather than long()
Diffstat (limited to 'rsa/key.py')
-rw-r--r-- | rsa/key.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -221,11 +221,11 @@ class PrivateKey(AbstractKey): >>> pk = PrivateKey(3727264081, 65537, 3349121513, 65063, 57287) >>> pk.exp1 - 55063L + 55063 >>> pk.exp2 - 10095L + 10095 >>> pk.coef - 50797L + 50797 If you give exp1, exp2 or coef, they will be used as-is: @@ -250,12 +250,12 @@ class PrivateKey(AbstractKey): # Calculate the other values if they aren't supplied if exp1 is None: - self.exp1 = long(d % (p - 1)) + self.exp1 = int(d % (p - 1)) else: self.exp1 = exp1 if exp1 is None: - self.exp2 = long(d % (q - 1)) + self.exp2 = int(d % (q - 1)) else: self.exp2 = exp2 @@ -409,7 +409,7 @@ def extended_gcd(a, b): oa = a #Remember original a/b to remove ob = b #negative values from return results while b != 0: - q = long(a // b) + q = a // b (a, b) = (b, a % b) (x, lx) = ((lx - (q * x)),x) (y, ly) = ((ly - (q * y)),y) |