Commit graph

100 commits

Author SHA1 Message Date
Henry de Valence
51f04d7cce first avx2 code 2017-12-04 10:37:37 -08:00
Henry de Valence
fce10f5736 Merge branch 'feature/texify-formulas' into develop 2017-12-01 11:54:12 -08:00
Isis Lovecruft
d21b74ea36
Line wrap an inline comment. 2017-11-30 22:41:06 +00:00
Henry de Valence
c209b49264 Tweak description and fix formatting 2017-11-29 13:00:50 -08:00
Henry de Valence
2d69a8a7dc Eliminate array_ref dependency 2017-11-20 14:53:08 -08:00
Henry de Valence
8d0808a077 Split internal curve models into a private submodule 2017-11-16 17:34:28 -08:00
Henry de Valence
e196f8347c Move 32/64-bit code into submodules in a backend module.
See the doc comment in `backend/mod.rs` for motivation on naming.
2017-11-16 16:07:55 -08:00
Henry de Valence
6ce7a4ee2d Remove catchall 'utils' module 2017-11-16 12:13:13 -08:00
Henry de Valence
8952c7f476 initial work on rewriting 32bit arithmetic 2017-11-16 12:13:13 -08:00
Henry de Valence
108a690941 First attempt at generating basepoint tables at compile time 2017-11-16 12:13:13 -08:00
Isis Lovecruft
c59af2c6b8
Merge branch 'optimzed_scalar_r1' into develop 2017-11-15 22:02:36 +00:00
Henry de Valence
f3a7108c55 Remove sha2 crate, which is only used in doctests 2017-10-31 14:12:29 -07:00
Henry de Valence
8c3ae7f010 Remove 'yolocrypto' from Ristretto 2017-10-30 16:34:36 -07:00
Henry de Valence
58a55117be Rename Decaf to Ristretto 2017-10-30 16:34:36 -07:00
Isis Lovecruft
6079b0269f
Revert "Revert "Merge remote-tracking branch 'floodyberry/optimized_scalar' into develop""
This reverts commit 90b69c13ee.

Signed-off-by: Isis Lovecruft <isis@torproject.org>
2017-10-30 19:27:44 +00:00
Isis Lovecruft
90b69c13ee
Revert "Merge remote-tracking branch 'floodyberry/optimized_scalar' into develop"
This reverts commit 804dab8924, reversing
changes made to 5d15ca77ff.

This is due to a (previously undocumented) contract on the behaviours of
(potentially unreduced mod \ell) "packed" scalars w.r.t. to the manner in which
their bytes are interpreted.

Upon documentation fixes and corresponding fixes being made on top of the
floodyberry/optimized_scalar branch, this revert will again be reverted and then
the additional changes merged (à la
file:///usr/share/doc/git/html/howto/revert-a-faulty-merge.html).

Signed-off-by: Isis Lovecruft <isis@patternsinthevoid.net>
2017-10-16 21:41:52 +00:00
Andrew Moon
7e53499a10 optimized scalar implementations for 32/64 bit 2017-09-24 22:24:35 -05:00
Isis Lovecruft
17290db44c
Update copyright/license headers in source files. 2017-08-15 05:09:20 +00:00
Henry de Valence
3dddecb4a8 Move Montgomery code to a montgomery.rs module 2017-08-02 22:58:15 -07:00
Henry de Valence
8ad02e2f57 Move curve.rs to edwards.rs 2017-08-02 22:35:12 -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
4e63cbfe4c
Merge remote-tracking branch 'chain/no_std-fix' into develop 2017-06-26 20:14:38 +00:00
Tony Arcieri
d9742c2367 Switch from libcollections to liballoc (gated on an "alloc" feature)
libcollections was recently merged into liballoc:

https://github.com/rust-lang/rust/pull/42648

I went ahead and also added an "alloc" feature which no_std users can use to opt
into liballoc features (i.e. any code using Vec). This should have no effect on
anything but no_std usage. It does make it possible for people without
allocators to use curve25519-dalek if they want though. Might be nice for
"bare metal" development.

All that said, from what I can gather liballoc, while not "stable", should
likely stick around for the forseeable future.

Some backstory on the liballoc/libcollections merge here:

https://github.com/rust-lang/rust/pull/42565
2017-06-19 16:59:45 -07:00
Isis Lovecruft
4bcf8bed9d
Move subtle to its own crate. 2017-05-31 21:20:56 +00:00
Isis Lovecruft
4ecf6ab326
Implement constant-time selection between two things. 2017-05-31 01:29:59 +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
127169c151 Remove boxes 2017-05-03 19:32:30 -07:00
Isis Lovecruft
6991b4264b
Merge remote-tracking branch 'hdevalence/feature/64bit-multiplication_r3' into develop 2017-03-14 04:23:11 +00:00
Isis Lovecruft
3cfaf0cf6d
Merge branch 'feature/generic-basepoint_r3' into develop 2017-03-14 03:26:51 +00:00
Henry de Valence
b8b5af24b6 fixup! Enable radix_51 on nightly 2017-03-13 20:24:59 -07: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 de Valence
97b60d61ab draft of 64-bit multiplication 2017-03-13 16:36:32 -07:00
Henry de Valence
2610ab872a Feature-gate basepoint table creation on a nightly feature 2017-03-13 16:28:52 -07:00
Henry de Valence
a4ed8e2b81 Use box syntax instead of an unsafe block 2017-03-13 15:50:43 -07:00
Henry de Valence
80d4566853 Merge remote-tracking branch 'tarcieri/nostd-cleanups' into develop 2017-03-13 15:00:20 -07:00
Tony Arcieri
384cf1df31 no_std import cleanups
- Gate no_std on the "std" feature
- Import core when std is present
- Import collections when std is absent
- Add a placeholder gated "use" directive for Box in curve.rs
2017-03-08 00:19:08 -08:00
Henry de Valence
a93798d209 Add a function to hash a byte slice to a scalar. 2017-02-27 11:19:06 -08:00
Isis Lovecruft
74feb0db75
Merge remote-tracking branch 'hdevalence/feature/decaf_r15' into develop 2017-02-22 05:30:18 +00:00
Isis Lovecruft
ff28cacd13
Enable std and std macros during test builds. 2017-02-22 03:07:57 +00:00
Henry & Isis
c2bee88c0f Add a feature gate for unfinished implementations. 2017-02-21 13:39:01 -08:00
Henry de Valence
eec7747be7 Move Decaf code to decaf.rs 2017-02-21 13:38:59 -08:00
Isis Lovecruft
e4d041836e
Move load3 and load4 to new utils module and remove #[allow(dead_code)]. 2017-02-21 06:15:08 +00:00
Isis Lovecruft
6f67a7d716
Rename util module to subtle.
* CHANGE subtle module documentation slightly to clarify the module's purpose.
 * FIXES issue #25.
2017-02-21 06:01:22 +00:00
Isis Lovecruft
d88b6c01c4
Merge remote-tracking branch 'tarcieri/no-std' into develop 2017-01-27 02:13:04 +00:00
Tony Arcieri
d08bc7395e Add #![no_std] (fixes #16)
Use ::core in lieu of ::std, allowing this crate to be usable in #![no_std]
environments.

Gates features that presently depend on ::std (presently just rand) behind a
"std" cargo feature, which is enabled by default.
2017-01-18 15:16:01 -08:00
Henry de Valence
a9e3c330a6 Move constants into its own module 2017-01-08 14:39:25 -05:00
Henry de Valence
d8476fe6cf Add a Scalar::random() constructor
This adds a dependency on the `rand` crate, used to construct an
OS-backed CSPRNG.  The implementation in this commit is somewhat
inefficient as it constructs a new OsRng object every time; it might be
better to construct it once.  (Seems like a lot of overhead for a few
getrandom(2) calls...)
2016-12-09 17:38:51 -08:00
Isis Lovecruft
f7972041ab
Fix a typo in lib.rs module documention. 2016-12-08 21:59:52 +00:00
Isis Lovecruft
387a56fe2c
Initial commit. 2016-12-08 05:12:00 +00:00