diff --git a/.travis.yml b/.travis.yml index cf6db51..50e9a3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ env: # Tests the u64 backend - TEST_COMMAND=test EXTRA_FLAGS='--no-default-features' FEATURES='std u64_backend' # Tests the avx2 backend - - TEST_COMMAND=test EXTRA_FLAGS='--no-default-features' FEATURES='std avx2_backend yolocrypto' + - TEST_COMMAND=test EXTRA_FLAGS='--no-default-features' FEATURES='std avx2_backend' # Tests serde support and default feature selection - TEST_COMMAND=test EXTRA_FLAGS='' FEATURES='serde' # Tests building without std. We have to select a backend, so we select the one @@ -21,7 +21,7 @@ matrix: exclude: # Test the avx2 backend only on nightly - rust: stable - env: TEST_COMMAND=test EXTRA_FLAGS='--no-default-features' FEATURES='std avx2_backend yolocrypto' + env: TEST_COMMAND=test EXTRA_FLAGS='--no-default-features' FEATURES='std avx2_backend' # Test no_std only on nightly. - rust: stable env: TEST_COMMAND=build EXTRA_FLAGS=--no-default-features FEATURES='u32_backend' diff --git a/README.md b/README.md index 7dba401..0943fd7 100644 --- a/README.md +++ b/README.md @@ -71,15 +71,17 @@ Curve arithmetic is implemented using one of the following backends: * a `u32` backend using `u64` products; * a `u64` backend using `u128` products; -* an experimental AVX2 backend, available using the `yolocrypto` feature when - compiling for a target with `target_feature=+avx2`. +* an `avx2` backend using parallel formulas, available when compiling for a + target with `target_feature=+avx2`. By default the `u64` backend is selected. To select a specific backend, use: ```sh cargo build --no-default-features --features "std u32_backend" cargo build --no-default-features --features "std u64_backend" -cargo build --no-default-features --features "std avx2_backend yolocrypto" +cargo build --no-default-features --features "std avx2_backend" ``` +Crates using `curve25519-dalek` can either select a backend on behalf of their +users, or expose feature flags that control the `curve25519-dalek` backend. Benchmarks are run using [`criterion.rs`][criterion]: @@ -88,7 +90,7 @@ Benchmarks are run using [`criterion.rs`][criterion]: export RUSTFLAGS="-C target_cpu=native" cargo bench --no-default-features --features "std u32_backend" cargo bench --no-default-features --features "std u64_backend" -cargo bench --no-default-features --features "std avx2_backend yolocrypto" +cargo bench --no-default-features --features "std avx2_backend" ``` # Contributing @@ -117,7 +119,8 @@ to the Dalek race.* Portions of this library were originally a port of [Adam Langley's Golang ed25519 library](https://github.com/agl/ed25519), which was in -turn a port of the reference `ref10` implementation. +turn a port of the reference `ref10` implementation. Most of this code, +including the 32-bit field arithmetic, has since been rewritten. The fast `u32` and `u64` scalar arithmetic was implemented by Andrew Moon, and the addition chain for scalar inversion was provided by Brian Smith. diff --git a/build.rs b/build.rs index 64aec5d..e0a2da7 100644 --- a/build.rs +++ b/build.rs @@ -1,5 +1,5 @@ #![cfg_attr(feature = "nightly", feature(cfg_target_feature))] -#![cfg_attr(all(feature = "nightly", feature = "yolocrypto"), feature(stdsimd))] +#![cfg_attr(all(feature = "nightly", feature = "avx2_backend"), feature(stdsimd))] #![allow(unused_variables)] #![allow(non_snake_case)] #![allow(dead_code)] diff --git a/src/backend/mod.rs b/src/backend/mod.rs index b095eef..aa44d52 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -27,6 +27,6 @@ pub mod u32; #[cfg(feature = "u64_backend")] pub mod u64; -#[cfg(all(feature = "avx2_backend", feature = "yolocrypto", target_feature = "avx2"))] +#[cfg(all(feature = "avx2_backend", target_feature = "avx2"))] pub mod avx2; diff --git a/src/lib.rs b/src/lib.rs index 4ebffe7..70f80f5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,7 +14,7 @@ #![cfg_attr(feature = "nightly", feature(cfg_target_feature))] #![cfg_attr(feature = "nightly", feature(external_doc))] -#![cfg_attr(all(feature = "nightly", feature = "yolocrypto"), feature(stdsimd))] +#![cfg_attr(all(feature = "nightly", feature = "avx2_backend"), feature(stdsimd))] // Refuse to compile if documentation is missing, but only on nightly. //