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

Function compute_blinding_factor

common/sphinx.c:343–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343static void compute_blinding_factor(const struct pubkey *key,
344 const struct secret *sharedsecret,
345 u8 res[BLINDING_FACTOR_SIZE])
346{
347 struct sha256_ctx ctx;
348 u8 der[PUBKEY_CMPR_LEN];
349 struct sha256 temp;
350
351 pubkey_to_der(der, key);
352 sha256_init(&ctx);
353 sha256_update(&ctx, der, sizeof(der));
354 sha256_update(&ctx, sharedsecret->data, sizeof(sharedsecret->data));
355 sha256_done(&ctx, &temp);
356 memcpy(res, &temp, 32);
357}
358
359static bool blind_group_element(struct pubkey *blindedelement,
360 const struct pubkey *pubkey,

Callers 2

generate_hop_paramsFunction · 0.85
process_onionpacketFunction · 0.85

Calls 4

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

Tested by

no test coverage detected