Commit Graph

310 Commits

Author SHA1 Message Date
John Galt
880dfae098 Added BLAKE2 support 2015-11-12 12:33:20 -05:00
Vincent Hanquez
da2f445690 [Poly1305] fix size of Authentication tag creation from Bytestring 2015-11-06 22:00:49 +00:00
Vincent Hanquez
d47ae454d5 [Poly1305] Add a way to create AuthTag from ByteArray. 2015-11-05 15:02:50 +00:00
Vincent Hanquez
7928198923 [doc] Add missing documentation call 2015-11-04 15:18:05 +00:00
Vincent Hanquez
7bd3a8f892 [ChaChaPoly1305] Document everything 2015-11-04 15:17:32 +00: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
John Galt
55c6988a6e Added support for incrementing Nonces 2015-10-05 14:08:08 -04:00
Vincent Hanquez
c94df41f02 [ECC] fix compilation of missing numBits 2015-09-22 17:48:43 +01:00
Vincent Hanquez
b63dc38c49 [ECC] add generate for ECC generic's scalar and point Base Multiplication helper. 2015-09-22 17:23:22 +01:00
Vincent Hanquez
08a8155f12 [P256] add function to generate a new scalar, and to get the base point. 2015-09-22 17:22:13 +01:00
Vincent Hanquez
9a1f06e3e8 [ECC] add curveSizeBits 2015-09-22 17:21:35 +01:00
Luke Taylor
6d33b66245 BCrypt module doc updates
- Add doctest style example usage
- List most relevant functions
- Reformat comments
- Minor corrections and additions
2015-09-01 15:22:58 +01:00
Vincent Hanquez
71fe77da68 [endianess] fix some issues on non supported arches 2015-08-28 17:10:27 +01:00
Joachim Breitner
507a8f8cea Use mkLE, not LE
to make sure the conversion to little endian is actually happening. This
fixes a test failure in ChaChaPoly1305. Fixes #31.
2015-08-27 14:52:37 +02:00
Vincent Hanquez
ea8cb2d45a [blowfish] remove unnecessary list of word32 for the schedule
Just use the binary's array directly
2015-08-27 10:57:28 +01:00
Luke Taylor
f346c46243 Add BCrypt module doc and a validatePasswordEither fn 2015-08-26 10:33:36 +01:00
Luke Taylor
39d5eb13fe Add bcrypt password hashing and validation API 2015-08-26 10:33:36 +01:00
Luke Taylor
2566e46185 Implement the eksBlowfish function
This modifies the standard blowfish key schedule function to accept an
optional salt and cost as used in bcrypt and modifies the algorithm
accordingly to implement the "expensive" version.

The standard blowfish version is just the same but with a salt value of
zero and a single call to the expandKey function. See the original
bcrypt paper for more details.
2015-08-26 10:33:35 +01:00
Luke Taylor
08ebde2f09 Modify creation of Blowfish key schedule
Changes to create it from an array of Word32, instead of using
mutableArray32FromAddrBE, which seems to reverse the words.
2015-08-26 10:33:35 +01:00
Vincent Hanquez
cd8f70e062 [Padding] add PKCS5/PKCS7 padding/unpadding methods 2015-08-18 12:03:05 +01:00
Vincent Hanquez
4653f36d19 [Poly1305] add NFData for Tag. 2015-07-30 14:40:35 +01:00
Vincent Hanquez
ead424f793 [Scrypt] reduce line size of comment 2015-07-29 10:03:43 +01:00
Vincent Hanquez
8a0bacfc6d [Poly1305] make initialize explicitely failable 2015-07-29 09:49:49 +01:00
Vincent Hanquez
4af8185d65 add new MAC key error 2015-07-29 09:45:51 +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
ce849fb0d2 [ChaChaPoly1305] add implementation and simple KAT test 2015-07-19 17:53:56 +01:00
Vincent Hanquez
5dab0190ac [Poly1305] Rename Ctx to State 2015-07-19 17:51:46 +01:00
Vincent Hanquez
ce043f49a1 [AES] fix wrongly indented comment 2015-07-19 17:51:00 +01:00
Andrey Sverdlichenko
4581a737d7 Use non-blocking IO with /dev/random.
Do not wait for data to appear from /dev/random, otherwise server is blocked
for a few seconds if there is no entropy left.
2015-06-29 07:32:42 +00:00
Vincent Hanquez
b37ee01636 [random] add a System "DRG" 2015-06-20 15:51:42 +01:00
Vincent Hanquez
25526e24a1 Merge branch 'hashdescr' 2015-06-19 11:06:11 +01:00
Vincent Hanquez
0b6b2d661c [Random] allow drgNew to be run in any MonadRandom directly.
this allow cascading, create a DRG from another DRG
2015-06-19 11:05:54 +01:00
Vincent Hanquez
0d2290a4a1 [RSA] allow data to be passed as is, instead of hashed 2015-06-19 11:04:37 +01:00
Vincent Hanquez
39cf449ba7 add some missing instance of HashAlgorithmASN1 2015-06-19 11:04:17 +01:00
Tobias Florek
ff36164305 copy withRandomBytes from crypto-random 2015-06-12 20:52:15 +02:00
Vincent Hanquez
a9df2a2180 [RSA] remove hashdescr in favor of just specifying the algorithm directly
The extra information is embedded in the HashAlgorithmASN1 class
that allow a digest to ASN1 structured.
2015-06-10 12:27:37 +01:00
Vincent Hanquez
0900f3b1b0 Merge pull request #9 from tekul/aescleanup
Remove unused AES primitives functions and exports
2015-06-09 15:17:51 +01:00
Vincent Hanquez
fb4006b41a Merge branch 'master' of https://github.com/vincenthz/cryptonite 2015-06-09 14:39:33 +01:00
Vincent Hanquez
35bad8c241 [hash] properly display Digest just like cryptohash.
fix #8
2015-06-09 14:35:23 +01:00
Luke Taylor
875b80107c Remove unused AES primitives functions and exports
The code for initializing different AEAD modes is now encapsulated in
the BlockCipher type and the individual mode encryption and decryption
functions have been replaced by generalized versions, so are no longer
used.
2015-06-09 11:45:39 +02: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
7301c719bf [P256] use ScrubbedBytes for Scalar 2015-06-02 14:22:48 +01:00
Vincent Hanquez
be75de64e1 [aes] fast track length == 0 with ECB encryption/decryption 2015-06-02 14:22:26 +01:00
Vincent Hanquez
daff858fe1 [number] cleanup in serialization 2015-06-01 13:03:21 +01:00
Vincent Hanquez
453e9a6f35 [number] internal serialize, unconditionally zero the buffer. 2015-06-01 13:02:53 +01:00
Vincent Hanquez
6028e95805 [number] cleanup 2015-06-01 11:50:24 +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
d873564c54 [number] split the serialization to support a more bit banging direct approach 2015-06-01 05:59:54 +01:00
Vincent Hanquez
e9c812e4fd [error] make CryptoFailable an instance of Show and Eq if possible 2015-06-01 05:59:25 +01:00
Vincent Hanquez
4edb580cda [P256] add warning for non constant time operation 2015-05-30 10:38:59 +01:00