Commit Graph

1152 Commits

Author SHA1 Message Date
Olivier Chéron
d8a39637f5 Ignore hint "Use camelCase" globally 2020-03-14 07:39:06 +01:00
Olivier Chéron
64f097788e Merge pull request #315 from ocheron/i386-sse
Fix support_sse on i386 architecture
2020-03-14 07:36:30 +01:00
Olivier Chéron
b9e1e75a10 Fix support_sse on i386 architecture
On i386 compilation failed with support_sse enabled and support_aesni
disabled.  This enables the minimum required instruction set, guarded
with an architecture condition.
2020-03-11 19:15:32 +01:00
Olivier Chéron
e56308f9d0 Fix ignored allow_failures and weeder build in Travis CI
Used haskell-ci commit cbf9d90 from PR vincenthz/haskell-ci#5 to
regenerate the files.
2020-03-08 18:34:59 +01:00
Olivier Chéron
4b9584dbe4 Use lts-15 in CI and bump versions 2020-02-24 06:53:19 +01:00
Olivier Chéron
4b8a8229cf Remove redundant where 2020-02-24 06:53:03 +01:00
Olivier Chéron
43a9967b1d Remove redundant superclass in MonadRandom
Reported by @frasertweedale
2020-02-16 19:49:49 +01:00
Olivier Chéron
86470d5563 Use conventional declaration order 2020-02-10 06:43:26 +01:00
Olivier Chéron
d2df760e34 Use zipWith 2020-02-10 06:43:26 +01:00
Vincent Hanquez
be517c9273
Merge pull request #307 from ocheron/p256-b64
Add 64-bit implementation for P256
2020-01-21 10:33:56 +08:00
Olivier Chéron
2579d1e7aa Use smaller value in felem_diff 2020-01-14 21:11:51 +01:00
Olivier Chéron
44a1651d26 Remove NULL checks in inner loop 2020-01-12 18:33:32 +01:00
Olivier Chéron
b08ce5e3ae Add 64-bit implementation for p256 2020-01-12 18:33:32 +01:00
Olivier Chéron
f9a6a35ce3 Prepare 64-bit implementation for p256 2020-01-12 18:33:32 +01:00
Olivier Chéron
f291bd08ef Move p256 felem code 2020-01-12 18:33:32 +01:00
Olivier Chéron
b5d9b6cba5 Add AppVeyor file 2020-01-12 18:21:17 +01:00
Olivier Chéron
7f1c2980e2 Merge pull request #305 from ocheron/p256-point-mul
Better P256.pointMul performance
2020-01-12 18:20:17 +01:00
Olivier Chéron
7ac3060873 Better P256.pointMul performance
Use dedicated function to avoid multiplying the basepoint with 0.
2020-01-06 18:49:12 +01:00
Olivier Chéron
1f6ed5711c Warn about non-uniform distribution with QuickCheck 2020-01-04 10:58:22 +01:00
Olivier Chéron
17879cbecd Merge pull request #303 from ocheron/square-root
Modular square root
2020-01-04 10:55:48 +01:00
Olivier Chéron
9e0dbb3231 Modular square root 2019-12-07 08:35:14 +01:00
Olivier Chéron
0a1aa3517c Fix warnings and whitespace 2019-12-03 21:06:17 +01:00
Olivier Chéron
18c6e37ef1 Merge pull request #300 from ocheron/tc-ecdsa
ECDSA with a type class
2019-12-01 08:47:33 +01:00
Olivier Chéron
95ebd3996f Merge pull request #301 from bwignall/typo
Fix typos
2019-12-01 08:45:37 +01:00
Brian Wignall
78684bc62b Fix typos 2019-11-30 18:22:26 -05:00
Olivier Chéron
99820c742d Truncate the digest without Integer conversion 2019-11-11 17:46:16 +01:00
Olivier Chéron
b9a8a6b83d ECDSA with digest 2019-11-11 17:46:16 +01:00
Olivier Chéron
15327ecd4f ECDSA with a type class 2019-11-11 17:46:16 +01:00
Olivier Chéron
8f75165f8b Time-constant P256 scalar inversion 2019-11-11 17:46:16 +01:00
Olivier Chéron
977e75f478 Add P256 functions to implement ECDSA 2019-11-11 17:46:16 +01:00
Olivier Chéron
19b7ab375a Time-constant modular inverse 2019-11-11 17:46:16 +01:00
Olivier Chéron
ce35a1e07d Merge pull request #299 from ocheron/ecc-scalar-ext
Extended ECC type class
2019-11-11 17:45:18 +01:00
Olivier Chéron
6f2a59e470 Apply hlint suggestions 2019-10-05 08:34:12 +02:00
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
e0b201b5e7 Test P256.pointMul 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
68c93ccbb1 Add GHC 8.8.1 to CI and bump versions 2019-10-05 08:23:45 +02:00
Olivier Chéron
e8b8a199e8 Merge pull request #293 from ocheron/xsalsa-derive
Add XSalsa.derive
2019-09-14 08:53:43 +02:00
Olivier Chéron
2433893730 Test XSalsa.derive
Adds a test case taken from NaCl paper, but without the parts related
to Curve25519 and Poly1305 because we want to test only XSalsa here.
2019-09-14 08:35:43 +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
65643a3bea Merge pull request #292 from ocheron/aes-gcm-siv
AES-GCM-SIV
2019-09-08 09:49:35 +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
29f0fd1b7a Test AES-GCM-SIV
Includes the test vectors from RFC 8452 and QuickCheck properties with
encryption-decryption round trip.
2019-08-25 16:38:03 +02:00
Olivier Chéron
73719cbe88 Add AES-GCM-SIV to AEAD benchmarks 2019-08-25 16:38:03 +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
262252a5c4 Merge pull request #291 from ocheron/p256-point-add
Faster P256.pointAdd
2019-08-25 08:51:58 +02:00
Olivier Chéron
f2fa7836cb Merge pull request #290 from ocheron/gcm-wrapping
Fix counter wrapping in AES GCM
2019-08-25 08:51:03 +02:00
Olivier Chéron
4ca77b8cf5 Faster P256.pointAdd
Convert to projective coordinates without expansive calls to function
'scalar_mult'.
2019-08-21 09:32:53 +02:00