bitcoin: remove multiple imports
This commit is contained in:
@@ -604,8 +604,6 @@ def CKD_priv(k, c, n):
|
|||||||
return _CKD_priv(k, c, rev_hex(int_to_hex(n,4)).decode('hex'), is_prime)
|
return _CKD_priv(k, c, rev_hex(int_to_hex(n,4)).decode('hex'), is_prime)
|
||||||
|
|
||||||
def _CKD_priv(k, c, s, is_prime):
|
def _CKD_priv(k, c, s, is_prime):
|
||||||
import hmac
|
|
||||||
from ecdsa.util import string_to_number, number_to_string
|
|
||||||
order = generator_secp256k1.order()
|
order = generator_secp256k1.order()
|
||||||
keypair = EC_KEY(k)
|
keypair = EC_KEY(k)
|
||||||
cK = GetPubKey(keypair.pubkey,True)
|
cK = GetPubKey(keypair.pubkey,True)
|
||||||
@@ -627,8 +625,6 @@ def CKD_pub(cK, c, n):
|
|||||||
|
|
||||||
# helper function, callable with arbitrary string
|
# helper function, callable with arbitrary string
|
||||||
def _CKD_pub(cK, c, s):
|
def _CKD_pub(cK, c, s):
|
||||||
import hmac
|
|
||||||
from ecdsa.util import string_to_number, number_to_string
|
|
||||||
order = generator_secp256k1.order()
|
order = generator_secp256k1.order()
|
||||||
I = hmac.new(c, cK + s, hashlib.sha512).digest()
|
I = hmac.new(c, cK + s, hashlib.sha512).digest()
|
||||||
curve = SECP256k1
|
curve = SECP256k1
|
||||||
@@ -706,7 +702,6 @@ def xpub_from_xprv(xprv, testnet=False):
|
|||||||
|
|
||||||
|
|
||||||
def bip32_root(seed, testnet=False):
|
def bip32_root(seed, testnet=False):
|
||||||
import hmac
|
|
||||||
header_pub, header_priv = _get_headers(testnet)
|
header_pub, header_priv = _get_headers(testnet)
|
||||||
I = hmac.new("Bitcoin seed", seed, hashlib.sha512).digest()
|
I = hmac.new("Bitcoin seed", seed, hashlib.sha512).digest()
|
||||||
master_k = I[0:32]
|
master_k = I[0:32]
|
||||||
|
|||||||
Reference in New Issue
Block a user