Commit Graph

8 Commits

Author SHA1 Message Date
Lucas dd84a23e7e Provide a single OTP function that accepts a configuration struct 2021-02-16 16:59:56 +00:00
Lucas bfafd6b964 Fixes regarding CC0 license headers 2021-02-12 23:05:40 +00:00
Lucas fcd0f1747c Rename step -> period 2021-02-12 01:38:22 +00:00
Lucas dde97e45d0 Don't call otp if the hmac is unknown 2021-02-11 21:21:01 +00:00
Lucas 4d2024128e Fix an overflow for 10-digits OTP 2021-02-11 21:20:06 +00:00
Lucas 41ca24d151 Add TOTP support
Add all the test vectors from RFC 6238, but comment the non-SHA1 ones
for the time being.
2020-06-14 17:31:33 +00:00
Lucas 22333c5d6e Change totp to take a uint64_t instead of time_t
Let the application deal with converting time_t to uint64_t. For TOTP,
it's just a counter.

While there, rename 'granularity' to 'step', as it's used in RFC 6238.
2020-06-14 17:13:07 +00:00
Lucas a28d7cca02 Add HOTP implementation 2020-06-14 04:02:13 +00:00