electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 6d2b53cdca4b0327b278d99985b4cd0116c808ba
parent 7b14516cc0e9d26ec3be63f98ead5660359aa8c8
Author: ThomasV <thomasv@electrum.org>
Date:   Sun, 27 Aug 2017 10:02:15 +0200

fix bip39 check

Diffstat:
Mlib/keystore.py | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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