1
0

rm some legacy cruft for old python versions

This commit is contained in:
SomberNight
2024-06-05 14:55:48 +00:00
parent 982443eaa3
commit 13e2949088
4 changed files with 5 additions and 15 deletions

View File

@@ -348,12 +348,9 @@ def ripemd(x: bytes) -> bytes:
md = ripemd.new(x)
return md.digest()
def hmac_oneshot(key: bytes, msg: bytes, digest) -> bytes:
if hasattr(hmac, 'digest'):
# requires python 3.7+; faster
return hmac.digest(key, msg, digest)
else:
return hmac.new(key, msg, digest).digest()
return hmac.digest(key, msg, digest)
def chacha20_poly1305_encrypt(