Commit Graph

17 Commits

Author SHA1 Message Date
Vincent Hanquez
253bf0cb8b Argon2: add working hash function
* Cleanup argon c files:
  * Remove encoded format and base64 encoder
  * Remove verification code
  * Remove all variants based simple caller
* Add basic hashing function
* Add a simple KAT test
* Define more things at the haskell level
2017-02-24 13:37:40 +00:00
Colin Atkinson
0cec622ddf Fix generate(Safe)Prime to guarantee prime size
Add check for size in generatePrime

Add size test in generateSafePrime

Require only that top bit is set, instead of top 2

This is the general standard, see e.g. OpenSSL

Add an error for too few bits being supplied to prime generator, and add documentation

Add some documentation and require highest two bits set

Simplify return syntax in generatePrime and generateSafePrime

Switch exponent to bit-shift for small performance boost
2017-01-19 00:10:50 -05:00
Vincent Hanquez
052417e5b1 properly check for point validity before making a point 2016-12-02 15:28:03 +00:00
Vincent Hanquez
07b6e80b6d Rewrite EC primitive and types to have the curve as type 2016-12-01 16:56:28 +00:00
Vincent Hanquez
d80a87da48 add new EC errors 2016-12-01 12:50:10 +00:00
Eric Mertens
5b8ae08701 Derive Show instance for CryptoFailable
Fixes #50

The derived instances use precedences to decide when
parentheses are appropriate.
2016-07-28 14:02:36 -07:00
Vincent Hanquez
d47ae454d5 [Poly1305] Add a way to create AuthTag from ByteArray. 2015-11-05 15:02:50 +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
Vincent Hanquez
4af8185d65 add new MAC key error 2015-07-29 09:45:51 +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
655d8b9c33 [Error] Add new public key error values 2015-04-19 09:24:21 +01:00
Vincent Hanquez
08732c0939 [AEAD] change interface to be less classy (!) 2015-04-18 06:57:18 +01:00
Vincent Hanquez
af0b1ece4d [internal] add documentation and finish implementing various combinator for CryptoFailable 2015-04-12 08:18:00 +01:00
Vincent Hanquez
7d1b5117a8 export some crypto failable combinators 2015-04-10 07:23:51 +01:00
Vincent Hanquez
f73b0e142e comments some work in progress piece of code with error handling 2015-04-08 22:33:39 +01:00
Vincent Hanquez
842d3fd44a fix some warnings 2015-04-08 22:30:01 +01:00
Vincent Hanquez
3b19f768ce add crypto errors standard enumeration and some helper. 2015-04-07 10:56:38 +01:00