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

Function run

tests/fuzz/fuzz-hmac-sha256.c:68–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void run(const u8 *data, size_t size)
69{
70 struct hmac_sha256 expected;
71 u8 num_splits;
72
73 if (size < 1)
74 return;
75 hmac_key_len = (size_t) data[0];
76 ++data; --size;
77
78 if (size < hmac_key_len)
79 return;
80 hmac_key = (unsigned char*) data;
81 data += hmac_key_len; size -= hmac_key_len;
82
83 if (size < 1)
84 return;
85 num_splits = *data;
86 ++data; --size;
87
88 /* Compute expected HMAC using the one-shot function. */
89 hmac_sha256(&expected, hmac_key, hmac_key_len, data, size);
90 test_split_update(num_splits, &expected, data, size);
91 test_vs_openssl(&expected, data, size);
92}
93

Callers

nothing calls this directly

Calls 3

hmac_sha256Class · 0.70
test_split_updateFunction · 0.70
test_vs_opensslFunction · 0.70

Tested by

no test coverage detected