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

Function compute_hmac

common/sphinx.c:291–302  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

289
290/* Convenience function: s2/s2len can be NULL/0 if unwanted */
291static void compute_hmac(const struct secret *key,
292 const u8 *s1, size_t s1len,
293 const u8 *s2, size_t s2len,
294 struct hmac *hmac)
295{
296 crypto_auth_hmacsha256_state state;
297
298 hmac_start(&state, key->data, sizeof(key->data));
299 hmac_update(&state, s1, s1len);
300 hmac_update(&state, s2, s2len);
301 hmac_done(&state, hmac);
302}
303
304static void compute_packet_hmac(const struct onionpacket *packet,
305 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