MCPcopy Create free account
hub / github.com/SmingHub/Sming / hmacVT

Function hmacVT

Sming/Components/crypto/src/hmac.cpp:18–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16{
17template <class Hash>
18void hmacVT(const uint8_t** msg, int* msg_len, int count, const uint8_t* key, int key_len, uint8_t* digest)
19{
20 Crypto::HmacContext<Hash> hmac(Crypto::Secret(key, key_len));
21 for(int i = 0; i < count; ++i) {
22 hmac.update(msg[i], msg_len[i]);
23 }
24 auto hash = hmac.getHash();
25 memcpy(digest, hash.data(), hash.size());
26}
27
28} // namespace
29

Callers

nothing calls this directly

Calls 4

dataMethod · 0.80
updateMethod · 0.45
getHashMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected