Commit Graph

10 Commits

Author SHA1 Message Date
Crockett
133c6e1b2d Added some redundant constraints for documentation/consistency. Added an INLINABLE pragma to i2ospOf to hopefully increase specializations. 2019-02-24 17:04:10 -08:00
Crockett
0fb8a73d3b Fixed compiler warnings 2019-02-03 16:06:05 -08:00
Luke Taylor
e39c849b18 Drop use of 'time' library from OTP implementation
It now exposes a type alias for Word64 and relies on the user to supply
a value for the current time, allowing them to use the time library of
their choice.

Also bump memory dep to 0.12 and use fromW64BE from that library.
2016-04-11 17:52:59 +01:00
Luke Taylor
f2e5942246 Add totpVerify function
Also adds a ClockSkew type which limits the acceptable clock skew window
to a limited number of time steps.
2016-01-10 18:19:53 +00:00
Luke Taylor
0be97fc5ca Add hash parameter to hotp function
While HOTP only mentions SHA1, TOTP allows the use of different hash
functions, which implicitly requires that the HOTP implementation support
them too.

This will also allow users to use HOTP with another hash if they so choose,
though it would not be compatible with most client applications, such as
Google authenticator.
2016-01-04 19:04:38 +00:00
Luke Taylor
47d202a90f Add TOTParams data type
Reduce the arguments to the totp function (most people will use defaults)
and allows validation of the time step value.

Added a top-level module overview.
2015-12-28 17:23:26 +00:00
Luke Taylor
88a2cd80f6 Add TOTP function and KATs
Just uses SHA1 for now. HashAlgorithm is ignored.
2015-12-27 19:13:22 +00:00
Luke Taylor
48f0598cc7 Make OTP resynch values a tuple
This is clearer than having two separate arguments.
2015-12-27 18:43:00 +00:00
Luke Taylor
c5b3622562 Add an OTP resynchronize function
Allows server to reset its counter to the client's current value, given
a sequence of one or more OTP values.
2015-12-20 23:33:52 +00:00
Luke Taylor
476f7c10d5 One-time password (OTP) implementation
Initial commit

- Implementation of HOTP algorithm as defined in RFC 4226
- Tests using values from the spec
2015-12-20 23:04:14 +00:00