27 HOTP(
const SymmetricKey& key, std::string_view hash_algo =
"SHA-1",
size_t digits = 6) :
28 HOTP(key.begin(), key.size(), hash_algo, digits) {}
27 HOTP(
const SymmetricKey& key, std::string_view hash_algo =
"SHA-1",
size_t digits = 6) : {
…}
36 HOTP(
const uint8_t key[],
size_t key_len, std::string_view hash_algo =
"SHA-1",
size_t digits = 6);
42 uint32_t generate_hotp(uint64_t counter);
54 std::pair<bool, uint64_t> verify_hotp(uint32_t otp, uint64_t starting_counter,
size_t resync_range = 0);
57 std::unique_ptr<MessageAuthenticationCode> m_mac;
72 TOTP(
const SymmetricKey& key, std::string_view hash_algo =
"SHA-1",
size_t digits = 6,
size_t time_step = 30) :
73 TOTP(key.begin(), key.size(), hash_algo, digits, time_step) {}
72 TOTP(
const SymmetricKey& key, std::string_view hash_algo =
"SHA-1",
size_t digits = 6,
size_t time_step = 30) : {
…}
82 TOTP(
const uint8_t key[],
84 std::string_view hash_algo =
"SHA-1",
86 size_t time_step = 30);
91 uint32_t generate_totp(std::chrono::system_clock::time_point time_point);
97 uint32_t generate_totp(uint64_t unix_time);
99 bool verify_totp(uint32_t otp, std::chrono::system_clock::time_point time,
size_t clock_drift_accepted = 0);
101 bool verify_totp(uint32_t otp, uint64_t unix_time,
size_t clock_drift_accepted = 0);
106 std::chrono::system_clock::time_point m_unix_epoch;