Olivier Chéron
db8d47a76c
ECC arithmetic in prime-order subgroup
...
A type-class extension packs together additional functions related to
a chosen basepoint as well as scalar serialization and arithmetic
modulo the subgroup order.
2019-10-05 08:34:12 +02:00
Olivier Chéron
bdf1a7a133
Require point equality in EllipticCurveArith
...
This is an incompatible API change but is very useful to test
properties and algorithms derived from the primitives. An ECC
instance sufficiently advanced to have math primitives should
implement equality too.
2019-10-05 08:34:12 +02:00
Olivier Chéron
2e92639679
Add P256.scalarMul
2019-10-05 08:34:12 +02:00
Olivier Chéron
096e2ec0bd
Add XSalsa.derive and example
...
This function adds one more HSalsa key derivation to an XSalsa context
that has previously been initialized. It allows multi-level cascades
like the 2-level done by NaCl crypto_box.
2019-09-09 19:32:24 +02:00
Olivier Chéron
3ae08ed509
Add API to generate a random nonce
...
This AEAD scheme is compatible with choosing the nonce randomly.
2019-08-25 16:38:08 +02:00
Olivier Chéron
908f979d44
Add AES-GCM-SIV
2019-08-25 16:38:01 +02:00
Olivier Chéron
0075b57f90
Add internal AES CTR variant with 32-bit counter
...
This variant of CTR mode is used by AES-GCM-SIV. The counter is in
little-endian format and uses the first four bytes of the IV only.
2019-08-25 08:55:49 +02:00
Olivier Chéron
91c87deae1
Add Crypto.System.CPU
2019-06-15 09:28:02 +02:00
Olivier Chéron
4df2a95276
AES GCM: use Shoup's method with 4-bit table
2019-06-06 06:48:16 +02:00
Vincent Hanquez
60ddb49298
Merge pull request #277 from ocheron/little-endian
...
Little-endian integer serialization
2019-05-19 21:56:41 +01:00
Olivier Chéron
76ba39fc95
Add benchmark with AES GCM and CCM
2019-05-19 11:16:34 +02:00
Olivier Chéron
af98a837d1
Add missing INLINABLE pragma
2019-05-16 06:33:35 +02:00
Olivier Chéron
7ecb259aae
Fix LE.i2osp 0
...
Little-endian bytes are stored at the beginning of the buffer.
2019-05-16 06:33:35 +02:00
Olivier Chéron
6893eae70a
Make os2ip loop argument strict
2019-05-16 06:33:35 +02:00
Olivier Chéron
6e1b6fdb90
Little-endian integer serialization
2019-05-16 06:33:35 +02:00
Olivier Chéron
158d8dfd0c
Remove unnecessary imports
2019-05-08 10:22:30 +02:00
Olivier Chéron
ae107a9285
Merge last cshakeUpdate with cshakeFinalize
2019-05-01 07:03:45 +02:00
Olivier Chéron
8b235612be
Merge cshakeInit with first cshakeUpdate
2019-04-28 09:14:25 +02:00
Olivier Chéron
14093ac298
Optimize KMAC allocations
...
Adds a minimalist Builder type to merge intermediate allocations into
a single ByteArray. Key is now copied to a ScrubbedBytes only.
2019-04-28 09:14:25 +02:00
Olivier Chéron
1551436111
Add KMAC
2019-04-28 09:14:25 +02:00
Olivier Chéron
e3edc100c3
Remove unnecessary import
2019-03-24 07:59:57 +01:00
Olivier Chéron
3253501166
Time-constant P256.scalarAdd and P256.scalarSub
2019-03-21 07:04:01 +01:00
Lars Petersen
2a26202a32
Add implementation of bcrypt_pbkdf
2019-03-14 21:30:29 +01:00
Olivier Chéron
d67a21f95f
Remove unnecessary imports and calls
2019-03-09 09:08:53 +01:00
Olivier Chéron
107317c84d
Improve strictness in Blowfish rounds
2019-03-04 06:39:55 +01:00
Olivier Chéron
717de392cd
Merge pull request #238 from lpeterse/master
...
Extend the internal interface of the Blowfish module.
2019-03-04 06:37:15 +01:00
Olivier Chéron
8e28d7b2cd
Merge pull request #271 from ocheron/hash-nat-constraints
...
Hash algorithms with runtime output length
2019-03-04 06:33:59 +01:00
Olivier Chéron
299140f884
Remove unnecessary hash arguments
...
We don't need to give the hash algorithm as a separate argument since
it is already available from the digest value itself.
2019-03-01 06:28:55 +01:00
Olivier Chéron
997cea369b
Rename to signDigestWith
2019-03-01 06:28:55 +01:00
Baojun Wang
b55a93dfdc
add ECDSA sign/verify digest APIs
...
(rebased from commit 045793427e8d46594b0b2afedb314d027ec707ab)
2019-03-01 06:28:32 +01:00
Olivier Chéron
3c41966b9a
Add module Crypto.Number.Nat
...
This new module exposes type constraints required by some hash
algorithms and provides functions to check whether the constraints are
satisfied with runtime values.
Resolves #256 .
2019-02-28 07:07:48 +01:00
Olivier Chéron
eccbc11824
Remove Crypto.Internal.Proxy
...
Data.Proxy can be used instead now that GHC >= 8.0. In Data.Proxy the
Proxy type is poly-kinded.
2019-02-28 07:07:48 +01:00
Olivier Chéron
65932e5a7e
Add missing Data instances in Crypto.Hash.Blake2
2019-02-25 06:40:53 +01:00
Crockett
133c6e1b2d
Added some redundant constraints for documentation/consistency. Added an INLINABLE pragma to i2ospOf to hopefully increase specializations.
2019-02-24 17:04:10 -08:00
Crockett
0fb8a73d3b
Fixed compiler warnings
2019-02-03 16:06:05 -08:00
Crockett
88596509f0
Changed imports to match style of rest of library
2019-02-03 13:51:01 -08:00
Crockett
109600cec2
Added missing imports and removed duplicate imports. Tests pass.
2019-02-03 13:43:54 -08:00
Crockett
c71a6733dd
Unified DSA and ECDSA truncate&hash function.
2019-02-03 13:30:56 -08:00
Crockett
d5003a46a6
Fixed hash truncation bug in DSA; added more KATs from RFC 6979.
2019-01-26 15:15:34 -08:00
Olivier Chéron
1d5947f055
Use any instead of not all
2019-01-15 21:24:31 +01:00
Olivier Chéron
f9ae52327c
RSASSA-PSS with key of arbitrary length
...
Instead of public_size / private_size which are in bytes only, this
uses function numBits to recover the effective length of the modulus
in bits. The patch also handles removal of unneeded initial byte when
the length is 1 modulo 8.
2019-01-12 17:43:49 +01:00
Olivier Chéron
274911c608
Accept hlint suggestions
2019-01-12 17:43:49 +01:00
Olivier Chéron
d964064d80
Use heterogeneous equality
2019-01-12 17:43:49 +01:00
Carlos Rodriguez
ddfdbbd4be
Removed unnecessary reference to random.
2018-12-18 20:19:14 +01:00
Carlos Rodriguez
cc18bf41ee
Corrected value boundaries in description of function.
2018-11-11 17:14:23 +01:00
Carlos Rodriguez
95f0f3d0c9
Fixed typos in name.
2018-11-03 21:17:46 +01:00
Carlos Rodriguez
3165027840
Fixed typo in name.
2018-11-03 21:12:53 +01:00
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
9847554392
Fixed comment about expSafe
2018-11-01 09:08:39 +01:00
Olivier Chéron
f4e094aacb
Fix PKCS#1 v1.5 padding
...
The padding string is at least 8 bytes long + 3 other bytes,
so it should be 11.
2018-10-29 20:43:02 +01:00