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

Function blindedpath_get_alias

common/blindedpath.c:220–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218}
219
220bool blindedpath_get_alias(const struct secret *ss,
221 const struct pubkey *my_id,
222 struct pubkey *alias)
223{
224 struct secret node_id_blinding;
225
226 /* BOLT #4:
227 * - $`B_i = HMAC256(\text{"blinded\_node\_id"}, ss_i) * N_i`$
228 * (blinded `node_id` for $`N_i`$, private key known only by $`N_i`$)
229 */
230 subkey_from_hmac("blinded_node_id", ss, &node_id_blinding);
231 SUPERVERBOSE("\t\"HMAC256('blinded_node_id', ss)\": \"%s\",\n",
232 fmt_secret(tmpctx, &node_id_blinding));
233
234 *alias = *my_id;
235 return secp256k1_ec_pubkey_tweak_mul(secp256k1_ctx,
236 &alias->pubkey,
237 node_id_blinding.data) == 1;
238}
239
240void blindedpath_next_path_key(const struct tlv_encrypted_data_tlv *enc,
241 const struct pubkey *path_key,

Callers 3

blind_nodeFunction · 0.85
decrypt_final_onionmsgFunction · 0.85
test_final_decryptFunction · 0.85

Calls 2

fmt_secretFunction · 0.85
subkey_from_hmacFunction · 0.70

Tested by 1

test_final_decryptFunction · 0.68