| 135 | } |
| 136 | |
| 137 | template <class Context> void benchmarkHash(const String& expected) |
| 138 | { |
| 139 | MicroTimes times(Context::Engine::name); |
| 140 | for(unsigned i = 0; i < iterations; ++i) { |
| 141 | times.start(); |
| 142 | auto hash = Context().calculate(plainText); |
| 143 | times.update(); |
| 144 | TEST_ASSERT(Crypto::toString(hash) == expected); |
| 145 | } |
| 146 | Serial.println(times); |
| 147 | } |
| 148 | |
| 149 | template <class Context> void benchmarkHmac(const String& expected) |
| 150 | { |