lightning: fix handling of secret_multiplier
This commit is contained in:
parent
8624552268
commit
44ddac371f
@ -858,7 +858,7 @@ def DerivePrivKey(json):
|
|||||||
|
|
||||||
m = rpc_pb2.DerivePrivKeyResponse()
|
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)
|
msg = json_format.MessageToJson(m)
|
||||||
return msg
|
return msg
|
||||||
@ -918,7 +918,7 @@ def ScalarMult(json):
|
|||||||
|
|
||||||
point = bitcoin.ser_to_point(req.pubKey)
|
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 = hashlib.sha256()
|
||||||
c.update(bitcoin.point_to_ser(point, True))
|
c.update(bitcoin.point_to_ser(point, True))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user