MCPcopy Create free account
hub / github.com/ElementsProject/lightning / ecdh

Function ecdh

common/ecdh_hsmd.c:9–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7static void (*stashed_failed)(enum status_failreason, const char *fmt, ...);
8
9void ecdh(const struct pubkey *point, struct secret *ss)
10{
11 const u8 *msg = towire_hsmd_ecdh_req(NULL, point);
12
13 if (!wire_sync_write(stashed_hsm_fd, take(msg)))
14 stashed_failed(STATUS_FAIL_HSM_IO, "Write ECDH to hsmd failed");
15
16 msg = wire_sync_read(tmpctx, stashed_hsm_fd);
17 if (!msg)
18 stashed_failed(STATUS_FAIL_HSM_IO, "No hsmd ECDH response");
19
20 if (!fromwire_hsmd_ecdh_resp(msg, ss))
21 stashed_failed(STATUS_FAIL_HSM_IO, "Invalid hsmd ECDH response");
22}
23
24void ecdh_hsmd_setup(int hsm_fd,
25 void (*failed)(enum status_failreason,

Callers 2

unblind_onionFunction · 0.70
marshall_htlc_infoFunction · 0.50

Calls 2

wire_sync_writeFunction · 0.50
wire_sync_readFunction · 0.50

Tested by

no test coverage detected