cryptonite/Crypto
Lars Petersen ff8a1c524d Extend the internal interface of the Blowfish module.
In preparation of an implementation of the bcrypt_pbkdf (a
variant of PBKDF2 used by OpenSSH) algorithm,
certain low-level operations of the Blowfish algorithm need to
be generalized and exposed.

The Blowfish.Primitive module has already been extended to
account for the requirements imposed by the BCrypt algorithm,
but the salt length was limited to 16 bytes and the BCrypt
specific key schedule setup has been hard-coded into the Blowfish
module.

This commit makes a clear distintion between the expandKey and
expandKeyWithSalt operation. Both take arbitrary sized salts
and keys now. The specialized operation for 16 byte salts as used
by BCrypt has been preserved and is selected automatically.
Also, the BCrypt specific parts have been move to the BCrypt
module with regard to separation of concern.

A benchmark for generating BCrypt hashes with cost 10 shows a
performance improvement from 158 to 141ms on average (Intel i5-6500)
after this refactoring.
Further experiments suggest that the specialized expandKeyWithSalt128
does not have any advantage over the generalized version
and might be removed in favour of less branches and exceptional
behaviour.
2018-05-08 22:08:20 +02:00
..
Cipher Extend the internal interface of the Blowfish module. 2018-05-08 22:08:20 +02:00
ConstructHash Various documentation copy editing 2017-11-18 14:27:44 -05:00
Data Various documentation copy editing 2017-11-18 14:27:44 -05:00
ECC Merge pull request #202 from ocheron/ed25519-arith-negate 2017-12-17 18:12:50 +00:00
Error remove dependency on foundation and moving to basement 2017-11-30 12:08:08 +00:00
Hash Remove conditionals related to SHAKE and Blake2 2018-04-28 08:09:25 +02:00
Internal Various documentation copy editing 2017-11-18 14:27:44 -05:00
KDF Extend the internal interface of the Blowfish module. 2018-05-08 22:08:20 +02:00
MAC Comment about not having Show instance for HMAC 2018-04-22 19:44:29 +02:00
Math Various documentation copy editing 2017-11-18 14:27:44 -05:00
Number Enable powModSecInteger with integer-gmp >= 1.0.2.0 2018-04-20 20:40:53 +02:00
PubKey Additional QA clean-up 2018-04-29 10:43:55 +02:00
Random withDev: Close the FD on exception 2017-11-30 10:30:29 +03:00
ECC.hs Merge pull request #202 from ocheron/ed25519-arith-negate 2017-12-17 18:12:50 +00:00
Error.hs add crypto errors standard enumeration and some helper. 2015-04-07 10:56:38 +01:00
Hash.hs Hash: use Block instead of UArray to reduce memory usage 2018-02-04 23:06:02 +00:00
OTP.hs Drop use of 'time' library from OTP implementation 2016-04-11 17:52:59 +01:00
Random.hs [ChaCha] only required byteArrayAccess and add a way to convert from binary 2017-07-07 17:32:09 +01:00
Tutorial.hs Add Crypto.Hash examples to tutorial 2017-08-22 20:39:27 +02:00