From 6d2b53cdca4b0327b278d99985b4cd0116c808ba Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sun, 27 Aug 2017 10:02:15 +0200 Subject: [PATCH] fix bip39 check --- lib/keystore.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/keystore.py b/lib/keystore.py index 94fd30c1..25da2ece 100644 --- a/lib/keystore.py +++ b/lib/keystore.py @@ -35,7 +35,7 @@ from .bitcoin import public_key_from_private_key, public_key_to_p2pkh from .bitcoin import * from .bitcoin import is_old_seed, is_new_seed, is_seed -from .util import PrintError, InvalidPassword +from .util import PrintError, InvalidPassword, hfu from .mnemonic import Mnemonic, load_wordlist @@ -581,7 +581,7 @@ def bip39_is_checksum_valid(mnemonic): while len(h) < entropy_length/4: h = '0'+h b = bytearray.fromhex(h) - hashed = int(hashlib.sha256(b).digest().encode('hex'), 16) + hashed = int(hfu(hashlib.sha256(b).digest()), 16) calculated_checksum = hashed >> (256 - checksum_length) return checksum == calculated_checksum, True