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
5217b6dbfd
Add TOTP KAT tests for SHA256 and SHA512
2016-01-04 19:37:03 +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
Vincent Hanquez
43890b1175
Add support for HKDF (RFC 5869)
2015-12-28 14:32:07 +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
Vincent Hanquez
812b5d1aed
[blake2] uncapitalize the modules and types as it's not abbreviation.
2015-11-19 14:24:54 +00:00
Vincent Hanquez
081a14326e
[tests] remove duplicated symbol in BCrypt
2015-11-19 14:23:45 +00:00
Vincent Hanquez
fae5f084cf
[Blake2] define the algorithm as a multiple algorithm so that the output digest size is explicit in the digest types.
2015-11-19 12:10:14 +00:00
Vincent Hanquez
6ae67d5c91
Merge pull request #46 from centromere/nonce-fix
...
Fix endianness of incrementNonce function for ChaChaPoly1305
2015-11-18 16:52:27 +00:00
Vincent Hanquez
093f1af8e4
Merge pull request #41 from kinoru/master
...
Fix typo: Kekkak -> Keccak
2015-11-18 15:38:19 +00:00
John Galt
320186cdd1
Fix endianness of incrementNonce function for ChaChaPoly1305
2015-11-16 12:59:01 -05:00
Vincent Hanquez
2191dddf5b
[Curve25519] use the Crypto.Error api instead of an Either type for parsing types
2015-11-02 11:17:19 +00:00
kinoru
558c21491e
Fix typo: Kekkak -> Keccak
...
The SHA-3 winning algorithm's name is Keccak (pronounced "catch-ack"),
not Kekkak.
- <http://keccak.noekeon.org/ >
- <http://www.nist.gov/itl/csd/sha-100212.cfm >
- <https://en.wikipedia.org/wiki/SHA-3 >
2015-10-27 14:56:42 +00:00
John Galt
55c6988a6e
Added support for incrementing Nonces
2015-10-05 14:08:08 -04:00
Vincent Hanquez
b00a1a2553
[tests] expands tabs, and remove redundant binding
2015-08-30 07:49:30 +01:00
Vincent Hanquez
5f72788041
[tests] fix last number test problem
2015-08-27 15:42:08 +01:00
Vincent Hanquez
3af592e997
[tests] make sure we don't use 0 for number parameters
2015-08-27 15:03:07 +01:00
Luke Taylor
a888501bb8
Add bcrypt tests
...
Mostly copied from openwall source, leaving out the unsupported 2x
tests and special bug-related tests for passwords containing 0xFF bytes.
2015-08-26 10:33:36 +01:00
Vincent Hanquez
cd8f70e062
[Padding] add PKCS5/PKCS7 padding/unpadding methods
2015-08-18 12:03:05 +01:00
Vincent Hanquez
8a0bacfc6d
[Poly1305] make initialize explicitely failable
2015-07-29 09:49:49 +01:00
Vincent Hanquez
e064af5cba
[chachapoly1305] properly handle the decryption, and change combine to encrypt.
2015-07-29 07:24:46 +01:00
Vincent Hanquez
169570c963
fix 0 case.
2015-07-29 07:13:04 +01:00
Vincent Hanquez
ce849fb0d2
[ChaChaPoly1305] add implementation and simple KAT test
2015-07-19 17:53:56 +01:00
Vincent Hanquez
58c6efe4c4
[tests] introduce a new checker for hunit based on the property checker
2015-07-19 17:53:07 +01:00
Vincent Hanquez
6e5ad0c640
[tests] reduce the size of the number generated as this basically block the test suite now
2015-07-19 17:52:35 +01:00
Luke Taylor
4e1437d4fd
Minor haddock fixes
...
Fix some incorrect parameter descriptions and spelling/typos.
2015-06-07 13:26:26 +02:00
Vincent Hanquez
59bc2a9528
[tests] remove unnecessary binding in P256
2015-06-01 13:03:38 +01:00
Vincent Hanquez
6c8ab6b610
[tests] remove unnecessary modules
2015-06-01 13:03:29 +01:00
Vincent Hanquez
69723be05c
[tests] add the reverse of the previous number kat test
2015-06-01 10:46:59 +01:00
Vincent Hanquez
360f4f51dc
[tests] add some vectors for i2ospOf_
2015-06-01 10:41:42 +01:00
Vincent Hanquez
f63a3c6025
[p256] fix all the bugs found by the now useful P256 test suite
2015-06-01 07:48:31 +01:00
Vincent Hanquez
2c112b8877
[tests] generate smaller number in one of the case
2015-06-01 07:47:40 +01:00
Vincent Hanquez
1d383a3d12
[ECC] add a simple property test for point addition
2015-06-01 05:59:08 +01:00
Vincent Hanquez
1634c6bbb5
[tests] add missing extension related to previous commit
2015-06-01 05:58:43 +01:00
Vincent Hanquez
df5ed2a4e9
[tests] add a more elaborate report testing for property checks
2015-06-01 05:58:32 +01:00
Vincent Hanquez
f79081670c
[tests] add better range integer generation. by default the number generated are fairly small.
2015-06-01 05:58:15 +01:00
Vincent Hanquez
3eda859c8d
[test] add marshalling tests for numbers
2015-06-01 05:57:09 +01:00
Vincent Hanquez
e2c1b82234
[tests] add first P256 test
2015-05-30 10:38:39 +01:00
Vincent Hanquez
d0cb713ccb
[tests] only generate prime > 48 bits
2015-05-23 16:22:58 +01:00
Vincent Hanquez
d9913a81f8
[tests] fix generate prime test to only start prime generation above 32 bits
2015-05-23 16:06:02 +01:00
Vincent Hanquez
e989d2a404
[tests] add a test for prime number
2015-05-23 15:55:05 +01:00
Vincent Hanquez
a4baf9383b
[test] add random number generation tests
2015-05-23 11:58:57 +01:00
Vincent Hanquez
ca2ec5a03d
[random] export MonadPseudoRandom
2015-05-23 11:58:36 +01:00
Vincent Hanquez
02956f9ef0
[KDF] move PBKDF2 and Scrypt to not be pinned to ByteString
2015-05-22 15:19:42 +01:00
Vincent Hanquez
1dacb7fa94
[Salsa] opaquify the state just like for hash functions
...
add more tests
2015-05-22 14:04:54 +01:00
Vincent Hanquez
9a69c61e84
[ChaCha] opaquify the state to be handled directly in the C level just like the hash function
...
increase the number of tests
2015-05-22 14:04:27 +01:00
Vincent Hanquez
80b379c98d
cleanup tests, and improve testing of hash algorithms
2015-05-20 07:14:05 +01:00
Vincent Hanquez
987f9e7bb6
[internal] update to latest memory, and remove builtin support as memory is now available
2015-05-18 18:33:14 +01:00
Vincent Hanquez
c5f9ab2d35
[internal] update memory to latest
2015-05-14 10:04:16 +01:00
Vincent Hanquez
26ec954a48
[Cipher] fix salsa and chacha related to chunking
2015-05-12 14:36:50 +01:00
Vincent Hanquez
ffe42392ca
[tests] more refactoring
2015-05-12 14:36:20 +01:00
Vincent Hanquez
5d2e2ce999
[Tests] factorise assertEq
2015-05-12 13:34:12 +01:00
Vincent Hanquez
ec57ecc0a0
[tests] add utility to do random chunking and add a Salsa chunking test
2015-05-12 07:54:27 +01:00
Vincent Hanquez
e6a7cc0dab
[Tests] split ChaCha in own module
2015-05-10 08:00:05 +01:00
Vincent Hanquez
7f39b15e91
[Tests] move Salsa tests
2015-05-10 07:57:20 +01:00
Vincent Hanquez
bdb463cc91
move Poly1305 tests to its own file
2015-05-10 07:50:18 +01:00
Vincent Hanquez
9ae9e38ce2
move to memory stuff
2015-05-09 14:23:32 +01:00
Vincent Hanquez
e82c0524e4
[tests] rename Hash module
2015-05-06 11:48:08 +01:00
Vincent Hanquez
81e335cfff
[HASH] re-enable SHA512t
2015-05-06 07:53:51 +01:00
Vincent Hanquez
c23ddb2eaa
[PBKDF2] make the code more friendly to a future mutable PRF.
...
Prevent doing B.take . B.concat by allocating only once the output buffer
2015-05-03 08:17:03 +01:00
Vincent Hanquez
b28109ecb4
[tests] re-enable poly1305
2015-05-02 15:43:49 +01:00
Vincent Hanquez
09e83a7f68
[hash] fix hash printing
2015-05-02 05:40:47 +01:00
Vincent Hanquez
db7c3bbb4f
[hash] massive overhaul of the hash interface
...
use the typeclass for the lowest IO impure C bindings definitions,
and define the pure interface as generic on top of this.
At the same time define an Hash.IO interface to allow mutable manipulations
of hash contextes when necessary.
Use HashAlgorithm instead of HashFunction in the [PubKey] sections
Tweak the HMAC, PBKDF2 functions to be more efficient and use the new interface
2015-04-30 06:18:07 +01:00
Vincent Hanquez
ec4e0c4ed9
remove all the byteArray prefix from byteArray function.
...
instead expect module import to be qualified for functions.
2015-04-24 06:54:33 +01:00
Vincent Hanquez
0424d67616
[Curve25519] convert to Bytearray
2015-04-22 06:26:06 +01:00
Vincent Hanquez
0aaa6a9e9a
[Ed25519] Add haskell bindings and tests
2015-04-19 09:24:37 +01:00
Vincent Hanquez
5ea8614999
[AES] tests: remove dead definitions
2015-04-18 07:59:15 +01:00
Vincent Hanquez
03fab98cd2
[AES] add KAT and properties tests for AES128,192,256
2015-04-18 07:33:34 +01:00
Vincent Hanquez
08732c0939
[AEAD] change interface to be less classy (!)
2015-04-18 06:57:18 +01:00
Vincent Hanquez
b93a424c9b
add missing KAT file
2015-04-09 19:59:53 +01:00
Vincent Hanquez
bc306afc1b
[DES] fix serialization
2015-04-09 17:22:57 +01:00
Vincent Hanquez
cf47754776
use more Imports
2015-04-08 22:48:46 +01:00
Vincent Hanquez
39d58bef52
remove tabs
2015-04-08 22:44:28 +01:00
Vincent Hanquez
842d3fd44a
fix some warnings
2015-04-08 22:30:01 +01:00
Vincent Hanquez
386e0e170f
fixup cipher tests
2015-04-08 20:44:20 +01:00
Vincent Hanquez
10995f7d01
fix DES tests
2015-04-08 20:43:31 +01:00
Vincent Hanquez
3a3b0a6277
fix Camellia tests
2015-04-08 20:43:20 +01:00
Vincent Hanquez
929047bc17
enable Blowfish tests
2015-04-08 20:43:07 +01:00
Vincent Hanquez
39ee0a4aa2
refactor some stuff
2015-04-08 14:58:49 +01:00
Vincent Hanquez
ca125f3e66
wip
2015-04-08 14:12:58 +01:00
Vincent Hanquez
72354397e8
merge all crypto ciphers available. add temporarily a vector dependency
2015-04-08 11:53:41 +01:00
Vincent Hanquez
6eae9b0557
fix warnings
2015-04-05 12:19:26 +01:00
Vincent Hanquez
842817086a
remove some warnings
2015-04-03 07:40:54 +01:00
Vincent Hanquez
599024e581
add public key tests
2015-04-03 07:33:16 +01:00
Vincent Hanquez
ba565ce6f0
add AFIS tests
2015-04-03 07:28:16 +01:00
Vincent Hanquez
033b9ced81
add support for curve 25519
2015-01-27 06:25:41 +00:00
Vincent Hanquez
244b0331ad
fix tests
2015-01-23 18:05:40 -08:00
Vincent Hanquez
6ba2a6b6b6
support proper SHA3
2015-01-18 16:09:07 -08:00
Vincent Hanquez
1f9d7af56f
add a working implementation of scrypt.
2014-08-23 16:36:29 +01:00
Vincent Hanquez
903ff726a2
add kekkak
2014-08-14 13:47:41 +02:00
Vincent Hanquez
3c3910cb34
add blowfish and scrypt tests
2014-07-23 06:06:30 -07:00
Vincent Hanquez
f2bfecfa3e
add RC4
2014-07-21 10:58:42 +01:00
Vincent Hanquez
d750233612
fix some KAThash warnings
2014-07-19 20:29:51 +01:00
Vincent Hanquez
1c964bb9f7
Merge branch 'legacy'
2014-07-18 15:40:57 +01:00
Vincent Hanquez
a0ce598e37
add PBKDF2
2014-07-18 15:26:01 +01:00
Vincent Hanquez
8779ba8927
add test vectors to test suite.
2014-07-18 06:04:22 +01:00