Use bytearray for pbkdf2
This commit is contained in:
@@ -66,7 +66,7 @@ def pbkdf2_bin(data, salt, iterations=1000, keylen=24, hashfunc=None):
|
|||||||
def _pseudorandom(x, mac=mac):
|
def _pseudorandom(x, mac=mac):
|
||||||
h = mac.copy()
|
h = mac.copy()
|
||||||
h.update(x)
|
h.update(x)
|
||||||
return list(map(ord, h.digest()))
|
return bytearray(h.digest())
|
||||||
buf = []
|
buf = []
|
||||||
for block in range(1, -(-keylen // mac.digest_size) + 1):
|
for block in range(1, -(-keylen // mac.digest_size) + 1):
|
||||||
rv = u = _pseudorandom(salt + _pack_int(block))
|
rv = u = _pseudorandom(salt + _pack_int(block))
|
||||||
|
Reference in New Issue
Block a user