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

Function compute_blinding_factor

common/sphinx.c:371–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371static void compute_blinding_factor(const struct pubkey *key,
372 const struct secret *sharedsecret,
373 u8 res[BLINDING_FACTOR_SIZE])
374{
375 struct sha256_ctx ctx;
376 u8 der[PUBKEY_CMPR_LEN];
377 struct sha256 temp;
378
379 pubkey_to_der(der, key);
380 sha256_init(&ctx);
381 sha256_update(&ctx, der, sizeof(der));
382 sha256_update(&ctx, sharedsecret->data, sizeof(sharedsecret->data));
383 sha256_done(&ctx, &temp);
384 memcpy(res, &temp, 32);
385}
386
387static bool blind_group_element(struct pubkey *blindedelement,
388 const struct pubkey *pubkey,

Callers 2

generate_hop_paramsFunction · 0.85
process_onionpacketFunction · 0.85

Calls 4

pubkey_to_derFunction · 0.85
sha256_initFunction · 0.85
sha256_updateFunction · 0.85
sha256_doneFunction · 0.85

Tested by

no test coverage detected