lightning: fix handling of secret_multiplier

This commit is contained in:
Janus 2018-03-13 15:18:53 +01:00
parent 8624552268
commit 44ddac371f

View File

@ -858,7 +858,7 @@ def DerivePrivKey(json):
m = rpc_pb2.DerivePrivKeyResponse()
m.privKey = derivePrivKey(req.keyDescriptor).privkey.secret_multiplier
m.privKey = derivePrivKey(req.keyDescriptor).privkey.secret_multiplier.to_bytes(32, "big")
msg = json_format.MessageToJson(m)
return msg
@ -918,7 +918,7 @@ def ScalarMult(json):
point = bitcoin.ser_to_point(req.pubKey)
point = point * int.from_bytes(privKey.secret_multiplier, "big")
point = point * privKey.secret_multiplier
c = hashlib.sha256()
c.update(bitcoin.point_to_ser(point, True))