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

Function derive_keys

common/derive_basepoints.c:33–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31};
32
33static void derive_keys(const struct secret *seed, struct keys *keys)
34{
35 hkdf_sha256(keys, sizeof(*keys), NULL, 0, seed, sizeof(*seed),
36 "c-lightning", strlen("c-lightning"));
37
38 if (dev_force_channel_secrets) {
39 keys->f = dev_force_channel_secrets->funding_privkey;
40 keys->r.secret = dev_force_channel_secrets->revocation_basepoint_secret;
41 keys->p.secret = dev_force_channel_secrets->payment_basepoint_secret;
42 keys->h.secret = dev_force_channel_secrets->htlc_basepoint_secret;
43 keys->d.secret = dev_force_channel_secrets->delayed_payment_basepoint_secret;
44 }
45 if (dev_force_channel_secrets_shaseed)
46 keys->shaseed = *dev_force_channel_secrets_shaseed;
47}
48
49bool derive_basepoints(const struct secret *seed,
50 struct pubkey *funding_pubkey,

Callers 7

derive_basepointsFunction · 0.70
derive_payment_basepointFunction · 0.70
derive_shaseedFunction · 0.70
derive_funding_keyFunction · 0.70
derive_htlc_basepointFunction · 0.70

Calls 1

hkdf_sha256Function · 0.85

Tested by

no test coverage detected