Olivier Chéron
8567bacc2e
Add pointNegate to class EllipticCurveArith
2017-11-20 19:28:17 +01:00
Olivier Chéron
8d7e0d236c
Add P256.pointNegate
2017-11-20 19:28:17 +01:00
Olivier Chéron
b8b59be5a5
Normalize result of ECC.pointNegate
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
c55dd4d27f
Add Curve_Ed25519
2017-11-20 19:28:16 +01:00
Olivier Chéron
6b3bf37eea
Use only fixed-window implementation
2017-11-20 19:28:16 +01:00
Olivier Chéron
123e22ec08
Ed25519 scalar multiplication with 4-bit fixed window
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
35f1d20b79
Ed25519 scalar add & multiply
2017-11-20 19:28:15 +01:00
Olivier Chéron
7d61abff03
Ed25519 point negation
2017-11-20 19:28:15 +01:00
Olivier Chéron
9ea718f55e
Arithmetic primitives over curve Ed25519
2017-11-20 19:28:15 +01:00
Vincent Hanquez
896382dfbc
Merge pull request #201 from chris-martin/pr/caps
...
Various documentation copy editing
2017-11-19 16:04:40 +00:00
Vincent Hanquez
c26b331c8e
Merge pull request #199 from ocheron/proxy-backend
...
Use Proxy for openBackend
2017-11-19 16:00:41 +00:00
Chris Martin
f77994a729
Various documentation copy editing
2017-11-18 14:27:44 -05:00
Olivier Chéron
4723dc0b39
Use Proxy in openBackend
...
Replaces 'undefined' and fixes #198 .
2017-10-23 20:39:00 +02:00
Vincent Hanquez
84e96d2fa3
Update context size for Blake2bp and Blake2sp
...
Also fix Blake2bp to not use blake2sp functions
2017-10-02 21:05:30 +01:00
Vincent Hanquez
74f1c1872b
[BLAKE2] update context size on the haskell to the latest code
2017-10-02 20:44:51 +01:00
Vincent Hanquez
2ecbd5c052
Merge pull request #189 from ocheron/cast5-wordarray
...
CAST5 block cipher
2017-09-18 21:09:49 +09:00
Vincent Hanquez
110ad7b510
Merge pull request #188 from ocheron/hash-tutorial
...
More content for Crypto.Tutorial
2017-09-18 20:54:40 +09:00
Vincent Hanquez
57fc438c83
typo in documentation
2017-09-18 10:32:21 +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
c6c715f465
Add note about Digest implementing ByteArrayAccess
2017-08-22 20:39:29 +02:00
Olivier Chéron
007f69c557
Add Crypto.Hash examples to tutorial
2017-08-22 20:39:27 +02:00
Olivier Chéron
80ed642f85
Add introduction to tutorial
2017-08-22 20:39:24 +02:00
Vincent Hanquez
9d43c332de
fix digest size for nat-typed blake2
2017-07-08 07:58:09 +01:00
Vincent Hanquez
ccc3930072
Merge pull request #182 from haskell-crypto/hash-type-nat
...
Add HashBlockSize & HashDigestSize & HashInternalContextSize type family
2017-07-07 21:45:22 +01:00
Vincent Hanquez
d13ce585ab
add further unrolling of Div8 to match Mod8
2017-07-07 21:44:29 +01:00
Vincent Hanquez
b18ec653b8
rename bitLen -> bitlen. GHC 8.2 is stricted about name of type variables
2017-07-07 19:26:59 +01:00
Vincent Hanquez
0dc0f30b86
Add HashBlockSize & HashDigestSize & HashInternalContextSize type family for all Hash algorithms
...
supercedes PR #158
2017-07-07 18:28:06 +01:00
Vincent Hanquez
664a37c16d
[ChaCha] only required byteArrayAccess and add a way to convert from binary
2017-07-07 17:32:09 +01:00
Vincent Hanquez
f559c7bd9d
[ChaCha] only need ByteArrayAccess for initialization
2017-07-07 17:31:30 +01:00
Olivier Chéron
9b56689885
Check that ECDH and ECIES result is not point-at-infinity
...
This guards against invalid public keys when curves have a cofactor.
Fixes #178
2017-07-05 22:24:22 +02:00
Olivier Chéron
aec6af5de4
Add note about P256 encoding of point-at-infinity
2017-07-05 22:24:22 +02:00
Olivier Chéron
adc192ac17
Add constAllZero
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
Fraser Tweedale
f6c1f21e59
clarify padding requirements for PKCS15 encrypt/decrypt
...
The types do not say whether it is necessary to apply pad/unpad to
the input/output of the PKCS15 encrypt/decrypt functions. Add
comments to clarify that it is not necessary to manually pad/unpad
the message.
2017-06-26 15:30:01 +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
Sergei Trofimovich
d911a34258
fix build failure with -f-support_deepseq disabled
...
How to reproduce:
```
$ cabal configure -f-support_deepseq
Resolving dependencies...
Configuring cryptonite-0.23...
$ cabal build
Building cryptonite-0.23...
Preprocessing library cryptonite-0.23...
[114 of 120] Compiling Crypto.PubKey.RSA.Types ( Crypto/PubKey/RSA/Types.hs, dist/build/Crypto/PubKey/RSA/Types
Crypto/PubKey/RSA/Types.hs:48:30: error:
• No instance for (NFData Integer) arising from a use of ‘rnf’
• In the first argument of ‘seq’, namely ‘rnf n’
In the expression: rnf n `seq` rnf e `seq` sz `seq` ()
In an equation for ‘rnf’:
rnf (PublicKey sz n e) = rnf n `seq` rnf e `seq` sz `seq` ()
```
The fix is to inctoruce 'NFData Integer' instance to `Crypto/Internal/DeepSeq`.
Closes: https://github.com/haskell-crypto/cryptonite/issues/171
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2017-06-19 10:37:23 +01:00
Olivier Chéron
e71d9b135c
Derive Show,Data,Typeable when defining curve singletons
2017-06-10 14:26:59 +02:00
Olivier Chéron
5c2988716e
Validate P256 point when decoding
...
Fixes #165 .
2017-06-10 14:26:59 +02:00
Olivier Chéron
a879845434
Add note about the optional all-zero test
...
This is actually a lie: the condition is tested in both curve
implementations but not returned by the Haskell API. Will be a reminder to
add this in the future. A function 'allocRetAndFreeze' could be useful.
2017-06-04 19:25:19 +02:00
Olivier Chéron
75e3bd555e
Add Show instances for EdDSA secret keys
...
Other algorithms define Show instances for their secrets.
Here ScrubbedBytes will obfuscate the content anyway.
Will be useful for X509.PrivKey, which requires a Show instance.
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
6fb412e2af
Use decaf_x448_derive_public_key
2017-06-04 19:25:19 +02:00
Olivier Chéron
23b359d842
Switch Haskell APIs to decaf implementation
...
Module 'Curve448' now use decaf.
2017-06-04 19:25:19 +02:00
Olivier Chéron
ac7eaac523
Simplify Ed25519.generateSecretKey
2017-06-02 19:37:25 +02:00
Olivier Chéron
edd5d94bd4
Make ivAdd more constant-time
...
All IV bytes are processed even if accumulator is zero.
2017-05-31 23:31:29 +02:00
Olivier Chéron
07592ab237
Fix ivAdd overflow behaviour
2017-05-26 09:59:54 +02:00
Olivier Chéron
c6caba88ed
Merge pull request #159 from wangbj/patch-1
...
Allow sign/verify digest directly
2017-05-26 09:52:53 +02:00
Baojun Wang
a8902fe119
remove redundant condition test on `hashLen /= B.length mHash`
2017-05-18 21:00:14 -07:00