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

Method checkHmac

tests/HostTests/modules/Network/Crypto.cpp:127–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 }
126
127 template <class Context> void checkHmac(const FlashString& expectedHash)
128 {
129 auto hash = Context(String(FS_hmacKey)).calculate(FS_plainText);
130 auto hashText = Crypto::toString(hash);
131 Serial.print(Context::Engine::name);
132 Serial.print(": ");
133 Serial.println(hashText);
134 REQUIRE(hashText == expectedHash);
135 }
136
137 template <class Context> void benchmarkHash(const String& expected)
138 {

Callers

nothing calls this directly

Calls 6

printlnMethod · 0.80
ContextClass · 0.50
StringClass · 0.50
toStringFunction · 0.50
calculateMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected