diff options
Diffstat (limited to 'passlib/crypto/scrypt/_builtin.py')
-rw-r--r-- | passlib/crypto/scrypt/_builtin.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/passlib/crypto/scrypt/_builtin.py b/passlib/crypto/scrypt/_builtin.py index e9bb305..c93e7a3 100644 --- a/passlib/crypto/scrypt/_builtin.py +++ b/passlib/crypto/scrypt/_builtin.py @@ -6,7 +6,6 @@ import operator import struct # pkg -from passlib.utils.compat import izip from passlib.crypto.digest import pbkdf2_hmac from passlib.crypto.scrypt._salsa import salsa20 # local @@ -170,7 +169,7 @@ class ScryptEngine(object): i = 0 while i < n: j = integerify(buffer) & n_mask - result = tuple(a ^ b for a, b in izip(buffer, get_v_elem(j))) + result = tuple(a ^ b for a, b in zip(buffer, get_v_elem(j))) bmix(result, buffer) i += 1 @@ -179,7 +178,7 @@ class ScryptEngine(object): # if not n_is_log_2: # while i < n: # j = integerify(buffer) % n - # tmp = tuple(a^b for a,b in izip(buffer, get_v_elem(j))) + # tmp = tuple(a^b for a,b in zip(buffer, get_v_elem(j))) # bmix(tmp,buffer) # i += 1 @@ -225,15 +224,15 @@ class ScryptEngine(object): j = 0 while j < half: jn = j+16 - target[j:jn] = tmp = salsa20(a ^ b for a, b in izip(tmp, siter)) - target[half+j:half+jn] = tmp = salsa20(a ^ b for a, b in izip(tmp, siter)) + target[j:jn] = tmp = salsa20(a ^ b for a, b in zip(tmp, siter)) + target[half+j:half+jn] = tmp = salsa20(a ^ b for a, b in zip(tmp, siter)) j = jn def _bmix_1(self, source, target): """special bmix() method optimized for ``r=1`` case""" B = source[16:] - target[:16] = tmp = salsa20(a ^ b for a, b in izip(B, iter(source))) - target[16:] = salsa20(a ^ b for a, b in izip(tmp, B)) + target[:16] = tmp = salsa20(a ^ b for a, b in zip(B, iter(source))) + target[16:] = salsa20(a ^ b for a, b in zip(tmp, B)) #================================================================= # eoc |