Commit graph

810 commits

Author SHA1 Message Date
Henry de Valence
dbca373639 Promote headers 2018-04-05 14:52:01 -07:00
Henry de Valence
f446ea82e0 Explicit decoding formulas 2018-04-05 14:52:01 -07:00
Henry de Valence
35c18cfc51 Stub out remaining sections, add overview of batching 2018-04-05 14:52:01 -07:00
Henry de Valence
b713274890 Describe encoding better and more generally 2018-04-05 14:52:01 -07:00
Henry de Valence
5385399854 Use Q_4 instead of T_4
T_4 is nicer because it sounds like "torsion", but T is also used as a variable in ext. coordinates, so Q is better overall since it avoids conflicts later.
2018-04-05 14:52:01 -07:00
Henry de Valence
34a6de83e0 Split out torquing section to cover cof=4 case better 2018-04-05 14:52:01 -07:00
Henry de Valence
fbee5e252c Split explanation of encoding formulas 2018-04-05 14:52:01 -07:00
Henry de Valence
25024a63bc Add dual isogeny 2018-04-05 14:52:01 -07:00
Henry de Valence
3f68349480 Fix whitespace characters 2018-04-05 14:52:01 -07:00
Henry de Valence
862dd33695 Add link to curve models 2018-04-05 14:52:01 -07:00
Henry de Valence
83c3d97651 clarify wording 2018-04-05 14:52:01 -07:00
Henry de Valence
c2d409788a Add links, tweak intro 2018-04-05 14:52:01 -07:00
Henry de Valence
ff787c2f12 Clarify Ristretto / Decaf relation in user docs 2018-04-05 14:52:00 -07:00
Henry de Valence
c99bd62b25 Add example to RistrettoBasepointTable 2018-04-05 14:52:00 -07:00
Henry de Valence
46048e451b Clarify wording on canonical scalars 2018-04-05 14:52:00 -07:00
Henry de Valence
35e1b07e72 Clarify abstraction layers in Ristretto intro 2018-04-05 14:52:00 -07:00
Henry de Valence
c841998b07 Extract Ristretto notes into a markdown file 2018-04-05 14:52:00 -07:00
Henry de Valence
ef0dae241a Add an explanatory note that's built on stable
When building on stable, the README.md is not included in the documentation,
leaving a bare entry. This adds a warning stub, pointing people to use nightly
rust.
2018-04-05 14:52:00 -07:00
Henry de Valence
51f9823c91 Create a new docs/ subtree and move assets into it 2018-04-05 14:52:00 -07:00
Henry de Valence
ece4bd715a Merge branch 'master' into develop 2018-04-04 15:35:16 -07:00
Henry de Valence
bf41bde917 Merge branch 'release/0.16.1' 2018-04-04 15:34:40 -07:00
Henry de Valence
207fbb640e Bump version to 0.16.1 2018-04-04 15:30:12 -07:00
Henry de Valence
05c1d073d1
Merge pull request #123 from hdevalence/feature/drop-bench-travis
Drop benchmarks from Travis
2018-04-04 15:23:50 -07:00
Henry de Valence
46d8f9c45d
Merge pull request #122 from hdevalence/feature/drop-stdsimd
Move from external `stdsimd` crate to `core::{arch, simd}` intrinsics
2018-04-04 11:06:23 -07:00
Henry de Valence
5f136fbd0c Remove some warnings.
Not all of the warnings are removed, since although this code works, it still
needs a significant amount of cleanup, editing, and polish.
2018-04-04 10:25:42 -07:00
Henry de Valence
1048100cd0 Reduce benchmark runs 2018-04-04 10:16:32 -07:00
Henry de Valence
f830268128 Drop benchmarks from Travis 2018-04-04 10:00:18 -07:00
Henry de Valence
b0bda0278c Drop the stdsimd crate in favor of core::{simd, arch}.
This change required some work, because the to-be-stabilized SIMD functions
don't allow non-constant `imm8`s.  Previously, the `stdsimd` functions had a
constifying macro that ensured that the immediates were known.  The dalek code
used this to build helper functions which would be inlined into different
places where the immediates were known.  Unfortunately, since constexprs aren't
fully supported in Rust yet, this is done by a hidden compiler attribute, and
there's no way to propagate "constness".

To deal with this, some of the functions are specialized (e.g.,
`square_and_negate_D` instead of taking a mask), and others use an enum.
2018-04-03 17:58:23 -07:00
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
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
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
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