Commit graph

232 commits

Author SHA1 Message Date
Isis Lovecruft
bed5aa00c5
Bump subtle dependency version to 0.9.0. 2018-09-05 03:19:58 +00:00
Henry de Valence
acceea04f6 Bump byteorder version to avoid breaking on stable
As pointed out by @ruuda:

> This is more of a problem with `#[feature]` in Rust; once a feature becomes
> stable, having `#[feature]` becomes an error, so it is not easy to depend on a
> feature on nightly, and then have the same code work on stable once the feature
> is stabilized.

The earliest `byteorder` version without a `#[feature]` is `1.2.3`, so we
require any higher version than that one.

Closes #184.
Closes #186.
2018-08-27 11:48:53 -07:00
Henry de Valence
8a488d3032 Bump version number to 0.19.0
Add an interim version prior to 1.0.0-pre.0 in order to fix the AVX2
build.
2018-07-26 20:34:00 -07:00
Henry de Valence
288625418d Migrate to packed_simd from core::simd 2018-07-26 12:40:34 -07:00
Tony Arcieri
10e8abf926 Unify alloc and std cargo features
This change provides a common convention for using allocator-dependent
features with:

    #![cfg(feature = "alloc")]

When available, `Vec` is imported consistently as `prelude::Vec`, which
means modules that need access to `Vec` can simply do:

    use prelude::*;

and if an allocator is available, `Vec` will be in the crate prelude.

This allows all `alloc` vs `std` gating to be handled in `lib.rs`,
`build.rs`, and `prelude.rs` so the rest of the codebase doesn't have to
do any gating whatsoever.
2018-07-23 10:50:21 -07:00
Henry de Valence
1e74cb3e56 Replace Scalar::from_u64 with From impls
Unfortunately, Rust selects `i32` as the type for an integer literal
when the literal has no other type constraints.  This means that someone
cannot write `Scalar::from(1)`, as Rust will choose `i32` as the type for
`1`, and we don't `impl From<i32> for Scalar`.

We could implement `From` conversions for signed integers, but since
`Scalar` operations should be constant-time by default, this would
require us to extract the sign bit of the integer and use it to
conditionally select between the positive and negative of Scalar
constructed from the value bits.  This is more expensive than the
unsigned operation, and I don't think it's what anyone really wants.

Making API consumers specify that their literals are unsigned is
slightly annoying, but better than the above alternative.

It would also be nice to change `Scalar::from_hash` to be
`impl<D: Digest<OutputSize = U64>> From<D> for Scalar`,
but this isn't currently allowed by Rust (since that `impl` "could"
conflict with the `impl From<u8>` if someone decided that `u8` should
`impl Digest`).
2018-07-19 08:39:09 -07:00
Henry de Valence
f6f20f4598
Merge pull request #152 from isislovecruft/feature/update-rand-0.5.3
Update rand dependency to 0.5.3.
2018-07-05 11:52:46 -07:00
Isis Lovecruft
3dbfad2f7a
Update rand dependency to 0.5. 2018-07-04 20:16:31 +00:00
Isis Lovecruft
b214e6e796
Bump subtle dependency to 0.7.0. 2018-07-04 19:56:16 +00:00
Henry de Valence
28b7ed5709 Change version to 0.18.0 (since feature flags changed) 2018-06-22 12:24:20 -07:00
Tony Arcieri
42430f1a1f Upgrade rand to (non-pre)release version 0.5
It was previously using pre-release version 0.5.0-pre.2
2018-06-02 11:17:10 -07:00
Isis Lovecruft
337de2a204
Bump curve25519-dalek version to 0.17.0. 2018-05-15 20:39:01 +00:00
Henry de Valence
bbb64312f7 Use rand 0.5
Requires `0.5.0-pre.2`, which adds `impl CryptoRng for OsRng`.
2018-05-15 12:30:28 -07:00
Henry de Valence
34c43c20a9 Rework backend selection code.
Each backend can now be selected by an individual feature:

- `u32_backend` for `backend::u32`;
- `u64_backend` for `backend::u64`;
- `avx2_backend` for `backend::avx2`;

The `u64_backend` is selected by default, since most people use X64 and we have
no way to select based on target (see discussion in #126).  However, these
changes mean that it is possible to select the backend explicitly, and if we
had the ability to select target-default features, we could do so easily.
2018-05-14 17:43:54 -07:00
Henry de Valence
9b6c932635 Rename 'precomputed_tables' to the more accurate 'stage2_build' 2018-05-14 15:41:45 -07:00
Henry de Valence
7b802c7bf5 Bump version to 0.16.4 2018-05-10 17:46:37 -07:00
Oleg Andreev
2a1e122300 disable default features in byteorder dependency to be no_std-compatible 2018-05-10 15:13:50 -07:00
Henry de Valence
e492ac63d0 Bump version to 0.16.3 2018-04-09 09:50:03 -07:00
Henry de Valence
6bb2c02a1f
Merge pull request #127 from hdevalence/feature/generalize-naf
Generalize NAF code to wider window sizes.
2018-04-08 16:39:45 -07:00
Henry de Valence
dc563c7415 Bump version to 0.16.2
Only change is better Ristretto docs
2018-04-06 15:11:08 -07:00
Henry de Valence
7e0ddf6b98 Rewrite NAF code to work with more window sizes
Change Scalar::non_adjacent_form() to take a width parameter.

This rewrite also makes it faster, although it's probably a ways off
from optimal. I don't know how much it matters.

TODO: write up description of why this computes the same thing.

Thanks to @oleganza for pointing out an error reading bits across words
in an earlier version of this code.
2018-04-04 21:13:09 -07:00
Henry de Valence
207fbb640e Bump version to 0.16.1 2018-04-04 15:30:12 -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
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
ce439458a1 Bump version to 0.16.0 2018-03-22 12:35:41 -07:00
Henry de Valence
792ac0775e Change to the updated subtle API. 2018-03-22 11:13:26 -07:00
Henry de Valence
151911bc47 Try to tell docs.rs to build using the "nightly" feature
We need this to put the README.md into the docs, or else the crate description is bare.
2018-02-06 11:19:50 -08:00
Henry de Valence
3fb0ccc68f Bump version to 0.15 2018-02-06 10:56:39 -08:00
Henry de Valence
31dbb9e434 Fix no_std build failure 2018-01-26 16:36:42 -08:00
Henry de Valence
04506bbca2 Consolidate Cargo.toml and document the weird build hack 2018-01-26 16:29:23 -08:00
Henry de Valence
5a3f0a0fbb Merge remote-tracking branch 'origin/feature/subtle-0.5' into develop 2018-01-25 10:31:41 -08:00
Isis Lovecruft
3b7399a06f
Bump curve25519-dalek version to 0.14.4. 2018-01-25 02:58:00 +00:00
Isis Lovecruft
2f3d1e77a2
Enable subtle feature for using generic ConditionallySwappable and ConditionallyNegatable. 2018-01-25 02:11:12 +00:00
Isis Lovecruft
a6680838b3
Revert "Revert "Bump subtle dependency to 0.5.0."" 2018-01-25 02:11:03 +00:00
Isis Lovecruft
7f3e82bab5
Revert "Bump subtle dependency to 0.5.0."
This reverts commit 460355d5e0.
2018-01-24 21:25:03 +00:00
Isis Lovecruft
460355d5e0
Bump subtle dependency to 0.5.0. 2018-01-20 02:30:33 +00:00
Isis Lovecruft
da890be304
Bump curve25519-dalek version to 0.14.3. 2018-01-20 01:03:45 +00:00
Isis Lovecruft
6b4aa8548c
Specify stdsimd version. 2018-01-20 01:03:44 +00:00
Isis Lovecruft
d3959a5eb6
Update more links to point to the official CI and repos. 2018-01-20 00:56:26 +00:00
Isis Lovecruft
4b8f2963d8
Update links to point to new official repos. 2018-01-20 00:54:46 +00:00
Isis Lovecruft
489fad186f
Bump curve25519-dalek version to 0.14.2. 2018-01-20 00:00:04 +00:00
Isis Lovecruft
0012e1f12f
Merge remote-tracking branch 'hdevalence/feature/avx2_r7' into develop 2018-01-19 23:46:30 +00:00
Isis Lovecruft
f8325f2d51
Bump curve25519-dalek Cargo.toml version to 0.14.1. 2018-01-19 19:42:59 +00:00
Isis Lovecruft
5ffa4e3495
Merge remote-tracking branch 'jeandudey/master' into develop 2018-01-19 19:41:14 +00:00
Isis Lovecruft
1d6a9337bf
Merge remote-tracking branch 'tarcieri/update-digest-and-generic-array' into develop 2018-01-18 03:42:24 +00:00
Jean Pierre Dudey
b7376512dd Update rand >= 0.4
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-01-03 10:04:40 -04:00
Henry de Valence
9ad2188bb8 Try to get travis working if yolocrypto=>nightly 2017-12-18 15:15:23 -08:00
Tony Arcieri
55e49b436a Update digest => 0.7, generic_array => 0.9
These are the latest releases of these crates.
2017-12-16 13:14:01 -08:00
Henry de Valence
89753e7274 for some reason stdsimd dep isn't picked up if it's optional 2017-12-15 13:57:01 -08:00
Henry de Valence
0f6171b788 Try to make stdsimd an optional dependency 2017-12-15 13:57:01 -08:00
Henry de Valence
34f44dcf5d Merge branch 'develop' into feature/avx2_r8 2017-12-15 11:37:10 -08:00
Henry de Valence
98a78d7a58 Clear scalar digits from memory in multiscalar_mult 2017-12-07 12:34:40 -08:00
Henry de Valence
fbd0e74357 Fix Cargo.toml to use upstream stdsimd 2017-12-04 10:37:37 -08:00
Henry de Valence
f28635ab4e Add a new 'avx2_backend' yolocrypto feature 2017-12-04 10:37:37 -08:00
Henry de Valence
ed24d1c5fa Move AVX2 code into a backend 2017-12-04 10:37:37 -08:00
Henry de Valence
51f04d7cce first avx2 code 2017-12-04 10:37:37 -08:00
Isis Lovecruft
209854acc6
Bump curve25519-dalek version to 0.14.0. 2017-12-04 02:08:03 +00:00
Isis Lovecruft
6ed4e24ddd
Exclude all .gitignore files from all builds. 2017-12-01 01:28:33 +00:00
Isis Lovecruft
6e96e49eea
Merge remote-tracking branch 'hdevalence/feature/refactor-internal-code' into develop 2017-11-25 23:07:23 +00:00
Henry de Valence
2d69a8a7dc Eliminate array_ref dependency 2017-11-20 14:53:08 -08:00
Isis Lovecruft
0d59f6e709
Merge remote-tracking branch 'chain/feature/refactor-32bit_r2' into develop 2017-11-18 00:40:07 +00:00
Henry de Valence
108a690941 First attempt at generating basepoint tables at compile time 2017-11-16 12:13:13 -08:00
Isis Lovecruft
3de2bf0ddc
No idea how this XSS will work when the hash after "github.com-" changes. 2017-11-16 01:33:13 +00:00
Isis Lovecruft
f6f7059dbe
Avoid making a package with literally only one HTML file, lol. 2017-11-16 01:30:19 +00:00
Isis Lovecruft
a6806eacc3
Bump curve25519-dalek version to 0.13.2. 2017-11-16 01:18:46 +00:00
Isis Lovecruft
37a56bf2ba
Exclude .travis.yml from packages. 2017-11-16 01:13:57 +00:00
Isis Lovecruft
1b66c2de01
Include rustdoc-include-katex-header.html in package. 2017-11-16 01:13:30 +00:00
Isis Lovecruft
d267a5c54b
Bump curve25519-dalek version to 0.13.1. 2017-11-16 01:00:29 +00:00
Isis Lovecruft
b40cf14351
Maybe this gets rustdoc to build with latex headers??? 2017-11-16 00:59:36 +00:00
Isis Lovecruft
a03d5f2d58
Bump curve25519-dalek version to 0.13.0 2017-11-16 00:47:17 +00:00
Henry de Valence
b978f0ae02 Remove profile settings from Cargo.toml
These all have the default values, except for the "yolocrypto" requirement in
the test section, which is already covered by CI and which doesn't do what we
want anyways -- it does not enable the feature if it's not there.
2017-11-15 10:21:48 -08:00
Henry de Valence
448abf2e7c I think this will add KaTeX into docs.rs ??? 2017-11-15 10:21:39 -08:00
Henry de Valence
8c3ae7f010 Remove 'yolocrypto' from Ristretto 2017-10-30 16:34:36 -07:00
Isis Lovecruft
154bb75b46
Bump curve25519-dalek version number to 0.12.1. 2017-10-16 21:49:39 +00:00
Isis Lovecruft
bf25b2767b
Bump curve25519-dalek version to 0.12.0. 2017-10-05 06:29:39 +00:00
Isis Lovecruft
cb98a23230
Change Cargo.toml to use subtle-0.3.0. 2017-10-05 00:51:42 +00:00
Isis Lovecruft
49f8781681
Revert "Use subtle branch with ConditionallySwappable trait for now."
This reverts commit d86fcd4e17.
2017-10-05 00:49:49 +00:00
Isis Lovecruft
d86fcd4e17
Use subtle branch with ConditionallySwappable trait for now. 2017-09-14 04:55:12 +00:00
Isis Lovecruft
f1a1886d96
Bump dalek to 0.11.0. 2017-08-15 04:53:28 +00:00
Isis Lovecruft
911b71ae27
Bump arrayref to 0.3.4. 2017-08-15 04:47:19 +00:00
Isis Lovecruft
cbf3f6d8c2
Bump dalek version to 0.10.0. 2017-08-01 03:02:47 +00:00
Isis Lovecruft
2c86589939
Merge remote-tracking branch 'hdevalence/feature/fix-licence' into develop 2017-08-01 02:45:17 +00:00
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
Henry de Valence
4060059b40 Fix licence 2017-07-31 19:08:30 -07:00
Isis Lovecruft
1388f91925
Bump curve25519-dalek version to 0.9.3. 2017-07-31 19:40:17 +00:00
Isis Lovecruft
beb15b8807
Bump curve25519-dalek version to 0.9.2. 2017-06-27 20:47:45 +00:00
Tony Arcieri
bdcfc30fe8 Only pull in subtle's std feature if "std" is enabled
Otherwise subtle implicitly pulls in std because it's a default feature
2017-06-27 11:04:45 -07:00
Isis Lovecruft
8374fa3000
Bump generic-array version to ^0.8. 2017-06-26 20:31:37 +00:00
Isis Lovecruft
d7b3329780
Bump curve25519-dalek version to 0.9.1. 2017-06-26 20:27:22 +00:00
Isis Lovecruft
493786db35
Merge remote-tracking branch 'doomrobo/patch-1' into develop 2017-06-26 20:21:32 +00:00
Isis Lovecruft
4e63cbfe4c
Merge remote-tracking branch 'chain/no_std-fix' into develop 2017-06-26 20:14:38 +00:00
Michael Rosenberg
74b80b227e Update sha2 and digest deps 2017-06-26 10:20:07 -04: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
Isis Lovecruft
4d6e5e304c
Bump curve25519-dalek version to 0.9.0. 2017-05-26 20:14:18 +00:00
Isis Lovecruft
38e539d469
Bump curve25519-dalek version to 0.8.1. 2017-05-19 23:07:55 +00:00
Isis Lovecruft
562318d4b8
Bump curve25519-dalek version to 0.8.0. 2017-05-18 06:26:23 +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
Isis Lovecruft
f9a5915651
Bump curve25519-dalek version to 0.7.1. 2017-05-15 03:24:11 +00:00
Isis Lovecruft
1b3422c37d
Bump the version to 0.7.0. 2017-05-14 09:39:13 +00:00
Henry de Valence
127169c151 Remove boxes 2017-05-03 19:32:30 -07:00
Henry de Valence
b6a71304c8 Bump version 2017-03-14 01:53:05 -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
58c60526da
Add a Travis badge to the Cargo.toml package. 2017-03-14 03:38:13 +00:00
Isis Lovecruft
3cfaf0cf6d
Merge branch 'feature/generic-basepoint_r3' into develop 2017-03-14 03:26:51 +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 de Valence
cf9f9aa402 Enable radix_51 on nightly 2017-03-13 17:04:37 -07:00
Henry de Valence
a884260341 Add radix_51 and radix_25_5 features and start feature-gating 2017-03-13 16:38:05 -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
a93798d209 Add a function to hash a byte slice to a scalar. 2017-02-27 11:19:06 -08:00
Isis Lovecruft
f8139da0b6
We're not so yolo that we're not gonna test. Test yolocrypto by default. 2017-02-22 22:47:55 +00:00
Isis Lovecruft
f0c43ce798
Bump version to 0.5.0. 2017-02-22 22:25:13 +00:00
Isis Lovecruft
74feb0db75
Merge remote-tracking branch 'hdevalence/feature/decaf_r15' into develop 2017-02-22 05:30:18 +00:00
Isis Lovecruft
f168e6c70a
Point to the github repo since that's where issues are. 2017-02-21 21:53:06 +00:00
Henry & Isis
c2bee88c0f Add a feature gate for unfinished implementations. 2017-02-21 13:39:01 -08:00
Isis Lovecruft
78701d5441
Bump version to 0.4.0. 2017-02-21 20:59:17 +00:00
Isis Lovecruft
1dac334b84
Whitespace fix. 2017-02-21 20:59:04 +00:00
Isis Lovecruft
90cbe8b0e0
Merge remote-tracking branch 'tarcieri/categories' into develop 2017-02-20 02:00:35 +00:00
Tony Arcieri
90baaba591 Add "cryptography" and "no-std" categories 2017-02-14 08:34:24 -08:00
Isis Lovecruft
7d434f2d37
Bump curve25519-dalek version to 0.3.0 in Cargo.toml. 2017-01-27 02:23:10 +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
Isis Lovecruft
226f5c7019
Update version to 0.2.0 in Cargo.toml. 2016-12-14 05:02:36 +00: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
02bbc4eec9
Bump version to 0.1.3 in Cargo.toml. 2016-12-09 02:34:11 +00:00
Isis Lovecruft
0c9d43e82a
Fix another typo in the package description. 2016-12-09 02:13:04 +00:00
Isis Lovecruft
cd4642c57e
Fix typo in package description. 2016-12-09 01:39:55 +00:00
Isis Lovecruft
1047f753d3
Bump version to 0.1.2 in Cargo.toml. 2016-12-08 22:00:30 +00:00
Isis Lovecruft
bedde25a70
Bump the version to 0.1.1 in Cargo.toml. 2016-12-08 21:56:30 +00:00
Isis Lovecruft
8bf730e84c
Use 'license' rather than 'license-file' directive.
If 'license' is used, then crates.io thinks we're using a "non-standard"
license, when, in fact, we are using CC0 (public domain).
2016-12-08 21:54:02 +00:00
Isis Lovecruft
387a56fe2c
Initial commit. 2016-12-08 05:12:00 +00:00