Commit graph

69 commits

Author SHA1 Message Date
Isis Lovecruft
f2883028dc
Use subtle version 0.2.0.
* CLOSES PR#66 https://github.com/isislovecruft/curve25519-dalek/pull/66
2017-08-01 02:22:43 +00:00
Isis Lovecruft
7202ab8e63
Merge remote-tracking branch 'hdevalence/feature/constant-time-k-fold-scalar-mult' into develop 2017-08-01 01:51:58 +00:00
Henry de Valence
ddaf602a09 Add multiscalar_mult to Decaf. 2017-07-31 18:40:53 -07:00
Henry de Valence
d2ce1ce5dc Revert "Add size checking to multiscalar multiplication."
This reverts commit 720da348c0.

Unfortunately, iter::chain on two ExactSizeIterators does not produce an ExactSizeIterator, for reasons described here: https://github.com/rust-lang/rust/issues/34433 .
2017-07-31 18:23:26 -07:00
Henry de Valence
720da348c0 Add size checking to multiscalar multiplication. 2017-07-30 23:54:13 -07:00
Henry de Valence
aaefb90ed3 Rename k_fold_scalar_mult to multiscalar_mult 2017-07-30 22:16:22 -07:00
Henry de Valence
f72de04003 Remove unneeded imports to suppress warnings 2017-07-30 16:29:37 -07:00
Henry de Valence
77103986a3 Split field arithmetic into per-implementation files
Split the field arithmetic implementations into `FieldElement`,
`FieldElement32`, and `FieldElement64`.  `FieldElement` is a type alias for one
of `FieldElement32` or `FieldElement64`, depending on feature selection.
`field.rs` contains tests and code which is generic with respect to the
implementation (e.g., inversions), while `field_32bit.rs` and `field_64bit.rs`
contain the implementation-specific code.

The implementation is not completely hidden, since `FieldElement32` and
`FieldElement64` are tuple structs whose elements are public; `pub(crate)`
doesn't seem to work for tuple structs.

Similarly, the constants file is split over multiple files, depending on the
implementation.
2017-07-30 16:25:42 -07:00
Isis Lovecruft
4bcf8bed9d
Move subtle to its own crate. 2017-05-31 21:20:56 +00:00
Isis Lovecruft
674a00df5b
Some rustfmt fixes. I disagreed with all the other ones. 2017-05-28 22:42:09 +00:00
Isis Lovecruft
3a664a054a
Whitespace fix in decaf module. 2017-05-27 01:20:14 +00:00
Isis Lovecruft
c6057cb2d0
Merge remote-tracking branch 'hdevalence/feature/fast-decaf' into develop 2017-05-25 21:51:57 +00:00
Isis Lovecruft
8772e863e7
Merge remote-tracking branch 'manishearth/fuzz' into develop 2017-05-25 21:50:48 +00:00
Isis Lovecruft
00f3a20329
Merge branch 'feature/add-sub-assign' into develop 2017-05-21 23:04:06 +00:00
Henry de Valence
58982cbc2b Lower the trial number in decaf_random
The radix_51 implementation has many more debug checks, so this takes quite
long to run, and it's rude to run a fuzzer on the CI server.
2017-05-20 21:39:58 -07:00
Henry de Valence
27dbfa9536 Use Mike Hamburg's trick for Decaf compression. 2017-05-20 21:39:58 -07:00
Henry de Valence
e4913dfc2b Batch inversions in Decaf decompression. 2017-05-20 21:39:58 -07:00
Henry de Valence
f741e50eb5 Add a test against current encodings of small multiples of the ed25519 basepoint 2017-05-20 21:39:58 -07:00
Manish Goregaokar
e076079772 Add cargo-fuzz 2017-05-19 16:44:05 -07:00
Henry de Valence
714bf3dd07 Set the number of trials back to 10,000 2017-05-19 14:23:51 -07:00
Henry de Valence
fbd8d0a605 Rewrite decaf elligator code to avoid two consecutive additions 2017-05-19 14:23:51 -07:00
Henry de Valence
b6cb7a7983 Increase number of trials for decaf elligator 2017-05-19 14:23:51 -07:00
Isis Lovecruft
e374451249
Implement {AddAssign, SubAssign} for DecafPoint. 2017-05-18 23:02:39 +00:00
Isis Lovecruft
b97868beb8
Remove unused import of ExtendedPoint in decaf::test module. 2017-05-18 03:44:42 +00:00
Isis Lovecruft
767c99adf5
Remove unused assignment in a decaf test. 2017-05-18 03:43:15 +00:00
Isis Lovecruft
0b70ab3638
Move DecafPoint * Scalar definition to decaf module. 2017-05-18 02:57:10 +00:00
Isis Lovecruft
e3adf3eea3
Merge remote-tracking branch 'hdevalence/feature/decaf_elligator_hash_to_point' into develop 2017-05-18 02:50:28 +00:00
Henry de Valence
69fd268aa4 Make serde an optional feature 2017-05-15 22:40:09 -07:00
Henry de Valence
7c32271346 Initial work on Serde support 2017-05-15 22:37:50 -07:00
Henry de Valence
608634a7bd Implement DecafPoint::{random, hash_from_bytes, from_hash} using Decaf-flavoured elligator 2017-05-15 21:06:26 -07:00
Isis Lovecruft
1b7b57c351
Make basepoint multiplication for precomputed tables go both ways. 2017-05-14 03:10:26 +00:00
Isis Lovecruft
7478814dfc
Implement CTAssignable for DecafPoint. 2017-05-14 02:59:54 +00:00
Henry de Valence
c18627f7c2 Generalize k_fold_scalar_mult 2017-05-04 00:02:29 -07:00
Henry de Valence
0ae0d2b72a Add function to get the basepoint from a basepoint table 2017-05-03 19:32:30 -07:00
Henry de Valence
127169c151 Remove boxes 2017-05-03 19:32:30 -07:00
Henry de Valence
0678e619cc Implement Mul for basepoint tables 2017-05-03 19:32:30 -07:00
Henry de Valence
59453d755d Implement Mul for scalar multiplication 2017-05-03 19:32:30 -07:00
Henry de Valence
a479b627a8 Add Decaf wrapper for k-fold vartime 2017-05-03 17:39:06 -07:00
Isis Lovecruft
3cfaf0cf6d
Merge branch 'feature/generic-basepoint_r3' into develop 2017-03-14 03:26:51 +00:00
Isis Lovecruft
26a77cd7f3
Feature-gate box syntax on both std and basepoint_table_creation. 2017-03-14 03:21:32 +00:00
Isis Lovecruft
f6930997d2
Make #[feature(test)] depend on #[cfg(all(test, feature = "bench"))].
* FIXES Issue #38:
   https://github.com/isislovecruft/curve25519-dalek/pull/38
2017-03-14 01:59:08 +00:00
Henry & Isis
049556147f Add wrapper for basepoint precomputations for decaf 2017-03-13 15:50:44 -07:00
Henry & Isis
f312160d2c Fixup errors introduced from not running yolocrypto tests by default 2017-03-13 15:50:43 -07:00
Isis Lovecruft
65136a202a
Merge remote-tracking branch 'isislovecruft/develop' into develop 2017-03-13 21:52:20 +00:00
Isis Lovecruft
2039a66cb3
Fix two decaf unittests to use compress_edwards(). 2017-03-10 02:35:38 +00:00
Henry de Valence
b61ed818b8 Remove all remaining warnings 2017-03-07 01:37:31 -08:00
Henry de Valence
913e699145 Rename Decaf tests 2017-03-07 01:28:38 -08:00
Henry de Valence
1dac2f53bb Implement Identity for CompressedEdwardsY 2017-02-26 15:25:05 -08:00
Henry de Valence
f39566cf16 Change CompressedDecaf::to_bytes to ::as_bytes 2017-02-26 15:25:05 -08:00
Henry de Valence
a202f36916 Rewrite invsqrt to avoid using an Option type. 2017-02-22 16:24:11 -08:00