Commit graph

2349 commits

Author SHA1 Message Date
Henry de Valence
2465e0f962
Merge pull request #121 from isislovecruft/feature/montgomery-mul-variants
Define mul variants for MontgomeryPoints.
2018-04-03 10:06:48 -07:00
Robin Millette
51f176007e
fix links
image and #9
2018-04-02 17:25:40 -04:00
Isis Lovecruft
3281708965
Define mul variants for MontgomeryPoints.
This results in less changes to the x25519-dalek code to upgrade to
the latest version.
2018-04-02 21:09:41 +00:00
Isis Lovecruft
1a8cf7beed
Merge remote-tracking branch 'hdevalence/feature/refactor-scalar-mul_r1' into develop 2018-04-02 21:03:17 +00:00
Isis Lovecruft
031179d111
Use new repository links. 2018-04-02 20:07:25 +00:00
Isis Lovecruft
86d23006fa
Add slack notifications for Travis results. 2018-04-02 20:06:02 +00:00
Isis Lovecruft
9970b8d17b
Merge branch 'release/0.1.0' 2018-04-02 20:01:01 +00:00
Henry de Valence
4a648df713 Feature-gate multiscalar impls on alloc 2018-03-26 17:58:31 -07:00
Henry de Valence
7ef6a1e6fa Reorganize AVX2 point code 2018-03-26 17:41:05 -07:00
Henry de Valence
e8b053b281 Remove AVX2 addition formulas
Only the readdition formulas are actually used by scalar multiplication, so
there's no reason to implement vectorized addition.
2018-03-26 17:41:05 -07:00
Henry de Valence
c73a0fd0d6 Remove AVX2 fixed-base code.
This was faster than the non-AVX2 code, but the serial code is already so fast that there's no reason not to use it.
2018-03-26 17:41:05 -07:00
Henry de Valence
0c4e7188a0 Pull out vartime double-base scalar mul code 2018-03-26 17:41:05 -07:00
Henry de Valence
2d99892eab Pull out variable-time straus implementation 2018-03-26 17:41:05 -07:00
Henry de Valence
2864a422bc Pull out constant-time straus implementation 2018-03-26 16:04:17 -07:00
Henry de Valence
ac739a3edd Split out constant-time variable-base scalar mul.
The serial (`u32`/`u64`) implementations use a multiple curve models, passing
between extended and projective coordinates when performing addition and
doubling (respectively). But the AVX2 backend doesn't, so in order to write a
single scalar mult implementation, we have to either abstract over the curve
models or have two implementations.

A generic solution is possible but extremely unreadable: the scalar mul
implementation would be parameterized over the point types used by the serial
implementations, with many where clauses describing how the types relate. The
AVX2 types could then be substituted in the appropriate places.

Instead we just duplicate the code into the `avx2` backend.
2018-03-26 16:01:51 -07:00
Henry de Valence
76a8d43a04 Create a new scalar_mul module hierarchy.
This should contain generic implementations of scalar multiplication algorithms
that can be used with multiple backends.  The goal is to move the existing
scalar multiplication code into this submodule, then call it from the
user-facing API.  This can also contain code for things we can't do now, like
multiscalar multiplication with precomputation.
2018-03-26 14:34:28 -07:00
Henry de Valence
ed4b1c6b6b
Merge pull request #119 from hdevalence/feature/criterion
Use `criterion.rs` instead of libtest for benchmarks.
2018-03-25 19:42:02 -07:00
Isis Lovecruft
66b3712f1d
Merge branch 'master' into develop 2018-03-26 02:36:31 +00:00
Isis Lovecruft
93149bc071
Merge branch 'release/0.6.2' 2018-03-26 02:36:18 +00:00
Isis Lovecruft
e3dfc8843c
Bump ed25519-dalek version to 0.6.2. 2018-03-26 02:32:38 +00:00
Isis Lovecruft
d61808cb08
Remove done TODO item from README. 2018-03-26 02:32:01 +00:00
Isis Lovecruft
f53e914b15
Merge branch 'update/curve25519-0.16' into develop 2018-03-26 02:31:41 +00:00
Isis Lovecruft
fd9f5aaef6
Merge branch 'master' into develop 2018-03-26 02:31:05 +00:00
Isis Lovecruft
45d5ccd197
Merge branch 'release/0.6.1' 2018-03-26 02:30:57 +00:00
Isis Lovecruft
f790bd2ce1
Update subtle and curve25519-dalek dependencies. 2018-03-26 02:13:39 +00:00
Isis Lovecruft
ac3d974f70
Update Travis badge to point to dalek-cryptography repo. 2018-03-26 02:11:43 +00:00
Henry de Valence
d6b8389428 Use criterion.rs instead of libtest for benchmarks.
Since Criterion can only benchmark public API, these changes just drop
all internal benchmarks (e.g., benchmarks for field operations). But
those are usually microbenchmarks whose meaning is kind of questionable
anyways, so I don't think this is a big loss.

The `bench` feature disappears, since Criterion works on stable Rust.
2018-03-25 17:14:37 -07:00
Henry de Valence
049e338430 Merge branch 'master' into develop 2018-03-22 12:37:41 -07:00
Henry de Valence
ffeb8cfadd Merge branch 'release/0.16.0' 2018-03-22 12:37:09 -07:00
Henry de Valence
ce439458a1 Bump version to 0.16.0 2018-03-22 12:35:41 -07:00
Henry de Valence
c9239f54e9 Merge branch 'fix/warnings' into develop 2018-03-22 12:34:31 -07:00
Henry de Valence
8091609bc1 Merge branch 'fix/avx2-docs' into develop 2018-03-22 12:20:13 -07:00
Henry de Valence
6f9c229e65 Remove Elligator stubs for now, since this isn't the API we want anyways 2018-03-22 12:17:23 -07:00
Henry de Valence
f2e44898ee Suppress warnings about square() on UnpackedScalars 2018-03-22 12:17:23 -07:00
Henry de Valence
0ba5c72122 This variable doesn't need to be mut since it's immediately consumed 2018-03-22 12:17:23 -07:00
Henry de Valence
e73b635fe0 Remove unused constants 2018-03-22 12:17:23 -07:00
Henry de Valence
844da9712b Fix AVX2 docs formatting, remove obsolete AVX512 note 2018-03-22 12:13:39 -07:00
Henry de Valence
d67e895619 Merge branch 'feature/rename-to-multiscalar-mul' into develop 2018-03-22 12:08:49 -07:00
Henry de Valence
132b1a9d77 Merge branch 'feature/ristretto-uniform-hash' into develop 2018-03-22 11:44:52 -07:00
Henry de Valence
7b0e6495e7 Merge branch 'feature/batch-scalar-inversion' into develop 2018-03-22 11:43:31 -07:00
Henry de Valence
2e73b2bc20 Use scalar_mul instead of scalar_mult 2018-03-22 11:40:13 -07:00
Henry de Valence
70eee5208a Rename double_scalar_mult_basepoint to double_scalar_mul_basepoint for consistency 2018-03-22 11:39:47 -07:00
Henry de Valence
296cd16463 Rename mult_by_cofactor to mul_by_cofactor for consistency 2018-03-22 11:36:34 -07:00
Henry de Valence
8de3d7576a Rename mult_by_pow_2 to mul_by_pow_2 for consistency 2018-03-22 11:35:42 -07:00
Henry de Valence
b48d568f47 Add debug_assert that Scalar::batch_invert inputs are nonzero 2018-03-22 11:32:00 -07:00
Henry de Valence
0e7d872ad0 Add batch inversion for Scalars 2018-03-22 11:32:00 -07:00
Henry de Valence
1f0e2d2ed6 Merge branch 'feature/subtle-choice_r1' into develop 2018-03-22 11:20:31 -07:00
Henry de Valence
792ac0775e Change to the updated subtle API. 2018-03-22 11:13:26 -07:00
Henry de Valence
7f39656b4a Apply the Elligator map twice to ensure a uniform distribution
As noted in the Decaf paper, mapping twice and adding the results ensures a
uniform distribution over the group.  This changes our random point and
hash-to-point functions to do this, matching the Sage script.
2018-03-19 15:37:38 -07:00
Henry de Valence
c20e09f6cc Rename multiscalar_mult->multiscalar_mul to match Mul traits 2018-03-19 14:28:21 -07:00