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

Function blindedpath_next_path_key

common/blindedpath.c:240–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240void blindedpath_next_path_key(const struct tlv_encrypted_data_tlv *enc,
241 const struct pubkey *path_key,
242 const struct secret *ss,
243 struct pubkey *next_path_key)
244{
245 /* BOLT #4:
246 * - $`E_{i+1} = SHA256(E_i || ss_i) * E_i`$
247 * ...
248 * - If the `encrypted_data_tlv` contains a `next_path_key_override`:
249 * - MUST use it as the next `path_key`.
250 * - Otherwise:
251 * - MUST use $`E_{i+1} = SHA256(E_i || ss_i) * E_i`$ as the next `path_key`
252 */
253 if (enc->next_path_key_override)
254 *next_path_key = *enc->next_path_key_override;
255 else {
256 struct sha256 h;
257 blinding_hash_e_and_ss(path_key, ss, &h);
258 blinding_next_path_key(path_key, &h, next_path_key);
259 }
260}

Callers 3

next_onionFunction · 0.85
test_decryptFunction · 0.85

Calls 2

blinding_hash_e_and_ssFunction · 0.85
blinding_next_path_keyFunction · 0.85

Tested by 2

next_onionFunction · 0.68
test_decryptFunction · 0.68