libcruft-util/test/hotp.cpp

35 lines
522 B
C++
Raw Normal View History

#include "hash/hotp.hpp"
2015-04-13 18:06:08 +10:00
#include "debug.hpp"
2015-04-13 16:45:56 +10:00
#include "tap.hpp"
#include "types.hpp"
using util::hash::HOTP;
int
main (int, char**)
{
HOTP h ("12345678901234567890", 0);
const unsigned EXPECTED[] = {
755224,
287082,
359152,
969429,
338314,
254676,
287922,
162583,
399871,
520489,
};
2016-01-19 18:31:49 +11:00
2015-04-13 16:45:56 +10:00
util::TAP::logger tap;
2016-01-19 18:31:49 +11:00
for (auto &i: EXPECTED)
tap.expect_eq (i, h.value (), "sequence");
return tap.status ();
}