1
0

ecc: abstract away some usage of python-ecdsa: randrange

This commit is contained in:
SomberNight
2020-02-04 18:17:12 +01:00
parent a600873cf9
commit 004acb906d
5 changed files with 19 additions and 15 deletions

View File

@@ -28,9 +28,7 @@ import hashlib
import unicodedata
import string
import ecdsa
from .util import resource_path, bfh, bh2u
from .util import resource_path, bfh, bh2u, randrange
from .crypto import hmac_oneshot
from . import version
from .logging import Logger
@@ -180,7 +178,7 @@ class Mnemonic(Logger):
entropy = 1
while entropy < pow(2, n - bpw):
# try again if seed would not contain enough words
entropy = ecdsa.util.randrange(pow(2, n))
entropy = randrange(pow(2, n))
nonce = 0
while True:
nonce += 1