Browse Source

bitcoin: remove multiple imports

283
Roman Zeyde 10 years ago
parent
commit
abc7429b0f
  1. 5
      lib/bitcoin.py

5
lib/bitcoin.py

@ -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)
def _CKD_priv(k, c, s, is_prime):
import hmac
from ecdsa.util import string_to_number, number_to_string
order = generator_secp256k1.order()
keypair = EC_KEY(k)
cK = GetPubKey(keypair.pubkey,True)
@ -627,8 +625,6 @@ def CKD_pub(cK, c, n):
# helper function, callable with arbitrary string
def _CKD_pub(cK, c, s):
import hmac
from ecdsa.util import string_to_number, number_to_string
order = generator_secp256k1.order()
I = hmac.new(c, cK + s, hashlib.sha512).digest()
curve = SECP256k1
@ -706,7 +702,6 @@ def xpub_from_xprv(xprv, testnet=False):
def bip32_root(seed, testnet=False):
import hmac
header_pub, header_priv = _get_headers(testnet)
I = hmac.new("Bitcoin seed", seed, hashlib.sha512).digest()
master_k = I[0:32]

Loading…
Cancel
Save