| 147 | } |
| 148 | |
| 149 | template <class Context> void benchmarkHmac(const String& expected) |
| 150 | { |
| 151 | MicroTimes times(Context::Engine::name); |
| 152 | for(unsigned i = 0; i < iterations; ++i) { |
| 153 | times.start(); |
| 154 | auto hash = Context(hmacKey).calculate(plainText); |
| 155 | times.update(); |
| 156 | TEST_ASSERT(Crypto::toString(hash) == expected); |
| 157 | } |
| 158 | Serial.println(times); |
| 159 | } |
| 160 | |
| 161 | void benchmarkFunction(const String& title, Delegate<void()> func) |
| 162 | { |