use optimized hmac.digest() instead of hmac.new().digest()

This commit is contained in:
The MMGen Project 2021-10-07 20:03:17 +00:00
commit 350c600bb3
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2

View file

@ -32,7 +32,7 @@ def sha256_rounds(s,n):
def scramble_seed(seed,scramble_key):
import hmac
step1 = hmac.new(seed,scramble_key,sha256).digest()
step1 = hmac.digest(seed,scramble_key,'sha256')
if g.debug:
msg(f'Seed: {seed.hex()!r}\nScramble key: {scramble_key}\nScrambled seed: {step1.hex()}\n')
return sha256_rounds(step1,g.scramble_hash_rounds)