summaryrefslogtreecommitdiffstats
path: root/Lib/hashlib.py
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2021-09-20 18:22:55 (GMT)
committerGitHub <noreply@github.com>2021-09-20 18:22:55 (GMT)
commit9510e6f3c797b4398aaf58abc1072b9db0a644f9 (patch)
tree02cc57a588d356766df4bd191430c7cbdeca5a18 /Lib/hashlib.py
parent5846c9b71ee9277fe866b1bdee4cc6702323fe7e (diff)
downloadcpython-9510e6f3c797b4398aaf58abc1072b9db0a644f9.zip
cpython-9510e6f3c797b4398aaf58abc1072b9db0a644f9.tar.gz
cpython-9510e6f3c797b4398aaf58abc1072b9db0a644f9.tar.bz2
bpo-45155: Apply new byteorder default values for int.to/from_bytes (GH-28465)
Diffstat (limited to 'Lib/hashlib.py')
-rw-r--r--Lib/hashlib.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/hashlib.py b/Lib/hashlib.py
index 21a73f3..5625018 100644
--- a/Lib/hashlib.py
+++ b/Lib/hashlib.py
@@ -235,15 +235,15 @@ except ImportError:
loop = 1
from_bytes = int.from_bytes
while len(dkey) < dklen:
- prev = prf(salt + loop.to_bytes(4, 'big'))
+ prev = prf(salt + loop.to_bytes(4))
# endianness doesn't matter here as long to / from use the same
- rkey = int.from_bytes(prev, 'big')
+ rkey = from_bytes(prev)
for i in range(iterations - 1):
prev = prf(prev)
# rkey = rkey ^ prev
- rkey ^= from_bytes(prev, 'big')
+ rkey ^= from_bytes(prev)
loop += 1
- dkey += rkey.to_bytes(inner.digest_size, 'big')
+ dkey += rkey.to_bytes(inner.digest_size)
return dkey[:dklen]