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

Function compute_hmac

common/sphinx.c:263–274  ·  view source on GitHub ↗

Convenience function: s2/s2len can be NULL/0 if unwanted */

Source from the content-addressed store, hash-verified

261
262/* Convenience function: s2/s2len can be NULL/0 if unwanted */
263static void compute_hmac(const struct secret *key,
264 const u8 *s1, size_t s1len,
265 const u8 *s2, size_t s2len,
266 struct hmac *hmac)
267{
268 crypto_auth_hmacsha256_state state;
269
270 hmac_start(&state, key->data, sizeof(key->data));
271 hmac_update(&state, s1, s1len);
272 hmac_update(&state, s2, s2len);
273 hmac_done(&state, hmac);
274}
275
276static void compute_packet_hmac(const struct onionpacket *packet,
277 const u8 *assocdata, const size_t assocdatalen,

Callers 3

compute_packet_hmacFunction · 0.85
create_onionreplyFunction · 0.85
unwrap_onionreplyFunction · 0.85

Calls 3

hmac_startFunction · 0.70
hmac_updateFunction · 0.70
hmac_doneFunction · 0.70

Tested by

no test coverage detected