Commit Graph

185 Commits

Author SHA1 Message Date
Carlos Rodriguez
314a9caba7 Merge branch 'master' of https://github.com/haskell-crypto/cryptonite
# Conflicts:
#	cryptonite.cabal
#	tests/KAT_PubKey.hs
2018-11-03 20:23:25 +01:00
Olivier Chéron
01faa66fd4 Add tests for RSA signature and verification
This includes tests for SignatureTooLong edge cases.
2018-10-29 20:43:07 +01:00
Olivier Chéron
455504b8e2 Implement SHAKE output not divisible by 8 bits 2018-10-23 06:59:07 +02:00
Olivier Chéron
e10ef06885 Remove unnecessary language extension 2018-10-23 06:59:07 +02:00
Carlos Rodriguez
c285d7f527 Added OAEP scheme and created test vectors for Rabin cryptosystem. 2018-10-06 16:53:22 +02:00
Carlos Rodriguez
e7b3abebf8 Implemented Rabin cryptosystem and some of its variations (including Rabin-Williams). 2018-09-06 20:27:32 +02:00
Olivier Chéron
b3a1506d82 Remove conditionals related to SHAKE and Blake2
Not needed anymore now that GHC > 8.0.
2018-04-28 08:09:25 +02:00
Luke Taylor
d27d464627 Fix cost parsing for bcrypt
The tens value was wrong for values of 20+, as reported in #230.
It should be 10*costTens not 10^costTens. This wasn't detected because
the values are the same when costTens is 1, and using high cost values
is rare with bcrypt because of the performance hit.

Also added a simple hash and validate test since the KAT tests only do
validation. This doesn't cover this bug since the cost value is too
high to include in the test. It allows similar issues to be tested
locally though.
2018-04-17 13:51:04 +01:00
Olivier Chéron
07be32728e Avoid warning with tasty-quickcheck-0.9.2 2018-02-04 15:27:45 +01:00
Olivier Chéron
4926cbb143 Improve types and indentation, fix typo 2018-02-03 19:05:20 +01:00
Baojun Wang
f6d9fb0cf1 aeadInit (ccm) returns CryptoError_IvSizeInvalid when iv size is wrong 2018-02-03 09:34:57 +01:00
Baojun Wang
ccc7c3e7a6 kill unused imports 2018-02-03 09:34:57 +01:00
Baojun Wang
6fef094e90 Add KATCCM test file 2018-02-03 09:34:57 +01:00
Baojun Wang
e01ef4386e Add AESCCM test vectors for testing 2018-02-03 09:34:57 +01:00
Baojun Wang
1e04890d73 Add ccm decrypt 2018-02-03 09:34:57 +01:00
Olivier Chéron
3217038a1a Add pointMulByCofactor and pointHasPrimeOrder 2017-12-17 11:56:33 +01:00
Olivier Chéron
9cd77ed3e2 Test points with a torsion component 2017-12-17 09:46:42 +01:00
Olivier Chéron
0820cd5c38 Simpler Edwards25519.scalarGenerate 2017-12-16 11:33:38 +01:00
Olivier Chéron
fbe1c213e2 Use throwCryptoError 2017-12-11 06:40:41 +01:00
Olivier Chéron
45723e3542 Rename to Edwards25519 2017-12-10 21:14:47 +01:00
Olivier Chéron
d472d9b74f Import Ed25519 unqualified 2017-12-10 21:13:09 +01:00
Olivier Chéron
8d7e0d236c Add P256.pointNegate 2017-11-20 19:28:17 +01:00
Olivier Chéron
e8f1bc08c8 Decrease iterations of ECC tests 2017-11-20 19:28:17 +01:00
Olivier Chéron
4f7d742461 Export and test ECC.pointNegate 2017-11-20 19:28:16 +01:00
Olivier Chéron
5778909761 Add Ed25519.pointsMulVarTime 2017-11-20 19:28:16 +01:00
Olivier Chéron
416fc649e1 Test Ed25519 arithmetic primitives 2017-11-20 19:28:16 +01:00
Olivier Chéron
bb2363eea7 Add CAST5 aka CAST-128
Haskell translation of RFC 2144.
2017-09-17 11:28:56 +02:00
Olivier Chéron
5c4458d626 Test ECC functions ecdh and ecdhRaw 2017-07-05 22:24:22 +02:00
Olivier Chéron
8e274f8e60 Validate output point when calling P256.pointFromBinary
Function unsafePointFromBinary is added when validation is not needed.
2017-07-05 22:24:22 +02:00
Vincent Hanquez
1bcfa2e087 Merge pull request #167 from ocheron/eddsa-minimal
Improve Curve448 and add Ed448
2017-06-19 13:49:07 +01:00
Olivier Chéron
b0d207c77b Test point encoding/decoding with Crypto.ECC 2017-06-10 14:33:37 +02:00
Olivier Chéron
4392ef57b8 More EdDSA vectors from RFC 8032 2017-06-04 19:25:19 +02:00
Olivier Chéron
6805ddd4f7 Add support for Ed448
This replaces the Diffie-Hellman API that was previously exported.
2017-06-04 19:25:19 +02:00
Olivier Chéron
7472caf838 Test Curve25519.toPublic 2017-06-02 19:37:25 +02:00
Olivier Chéron
51b36f77b8 Test for Ed25519 signature verification 2017-06-02 19:37:25 +02:00
Olivier Chéron
8fb59dfc19 Test IV arithmetic
With emphasis on ivAdd overflow behaviour.
2017-05-26 09:59:54 +02:00
Parnell Springmeyer
94d67ad86d
ed25519: Adding generateSecretKey and a unit test 2017-05-02 16:18:26 -05:00
Vincent Hanquez
4f988181c7 Merge pull request #150 from SamProtas/twofish
Twofish
2017-04-12 07:47:19 +01:00
Sam Protas
762d818ec0 Twofish 192 and 256 bit key support 2017-04-10 00:33:54 -04:00
Sam Protas
7eedbaa112 Initial implementaiton with passing tests 2017-04-02 18:34:10 -04:00
Nicolas DI PRIMA
653e67d221 add tests for the new digest sizes 2017-03-13 00:25:04 +00:00
Olivier Chéron
f9b593520f Fixed test suite when base < 4.7
ExistentialQuantification is needed for HashAlg.
2017-02-26 16:27:55 +01:00
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
Olivier Chéron
d8ed5ce9f1 Add SHAKE128 and SHAKE256 as HashAlgorithm instances
Generalizes SHA-3 code for SHAKE support and uses GHC type-level literals
to keep the output length variable.
2017-02-14 23:01:18 +00:00
Vincent Hanquez
7378fe3f45 add some missing blake2 modes 2017-02-14 16:26:44 +00:00
Vincent Hanquez
e3ef0684f9 Merge pull request #132 from NicolasDP/master
Add Fast PBKDF2 for SHA1, SHA256 and SHA512
2017-02-14 09:43:21 +00:00
Nicolas DI PRIMA
4bd98c80e0 add tests for pbkdf2 sha512 for both haskell's and fast implementation 2017-02-11 14:08:28 +00:00
Nicolas DI PRIMA
002f300021 add fastpbkdf2 with sha512 2017-02-11 14:08:27 +00:00
Nicolas DI PRIMA
4189aa9389 Port Fast PBKDF2 for sha1 and sha256 2017-02-11 14:08:23 +00:00
Vincent Hanquez
d2a8763918 Merge pull request #125 from colatkinson/fix_prime_size
Fix generated primes being too large
2017-02-09 07:48:16 +00:00