mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 08:34:20 +01:00
lightningd/hsm_control.c: Implement getsharedsecret.
ChangeLog-Added: New `getsharedsecret` command, which lets you compute a shared secret with this node knowing only a public point. This implements the BOLT standard of hashing the ECDH point, and is incompatible with ECIES.
This commit is contained in:
committed by
Rusty Russell
parent
1b0807444b
commit
d9b2482415
@@ -1126,3 +1126,15 @@ class LightningRpc(UnixDomainSocketRpc):
|
||||
"pubkey": pubkey,
|
||||
}
|
||||
return self.call("checkmessage", payload)
|
||||
|
||||
def getsharedsecret(self, point, **kwargs):
|
||||
"""
|
||||
Compute the hash of the Elliptic Curve Diffie Hellman shared
|
||||
secret point from this node private key and an
|
||||
input {point}.
|
||||
"""
|
||||
payload = {
|
||||
"point": point
|
||||
}
|
||||
payload.update({k: v for k, v in kwargs.items()})
|
||||
return self.call("getsharedsecret", payload)
|
||||
|
||||
Reference in New Issue
Block a user