1
0

ecc: abstract away some usage of python-ecdsa: bytes<->int conversions

This commit is contained in:
SomberNight
2020-02-04 19:41:06 +01:00
parent 004acb906d
commit 2cf2135528
7 changed files with 22 additions and 22 deletions

View File

@@ -65,7 +65,7 @@ def _CKD_priv(parent_privkey: bytes, parent_chaincode: bytes,
child_privkey = (I_left + ecc.string_to_number(parent_privkey)) % ecc.CURVE_ORDER
if I_left >= ecc.CURVE_ORDER or child_privkey == 0:
raise ecc.InvalidECPointException()
child_privkey = ecc.number_to_string(child_privkey, ecc.CURVE_ORDER)
child_privkey = int.to_bytes(child_privkey, length=32, byteorder='big', signed=False)
child_chaincode = I[32:]
return child_privkey, child_chaincode