Remove yolocrypto from avx2_backend

This commit is contained in:
Henry de Valence 2018-06-18 13:30:45 -07:00
parent d791047aac
commit 16f39c82e5
5 changed files with 13 additions and 10 deletions

View file

@ -10,7 +10,7 @@ env:
# Tests the u64 backend # Tests the u64 backend
- TEST_COMMAND=test EXTRA_FLAGS='--no-default-features' FEATURES='std u64_backend' - TEST_COMMAND=test EXTRA_FLAGS='--no-default-features' FEATURES='std u64_backend'
# Tests the avx2 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 # Tests serde support and default feature selection
- TEST_COMMAND=test EXTRA_FLAGS='' FEATURES='serde' - TEST_COMMAND=test EXTRA_FLAGS='' FEATURES='serde'
# Tests building without std. We have to select a backend, so we select the one # Tests building without std. We have to select a backend, so we select the one
@ -21,7 +21,7 @@ matrix:
exclude: exclude:
# Test the avx2 backend only on nightly # Test the avx2 backend only on nightly
- rust: stable - 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. # Test no_std only on nightly.
- rust: stable - rust: stable
env: TEST_COMMAND=build EXTRA_FLAGS=--no-default-features FEATURES='u32_backend' env: TEST_COMMAND=build EXTRA_FLAGS=--no-default-features FEATURES='u32_backend'

View file

@ -71,15 +71,17 @@ Curve arithmetic is implemented using one of the following backends:
* a `u32` backend using `u64` products; * a `u32` backend using `u64` products;
* a `u64` backend using `u128` products; * a `u64` backend using `u128` products;
* an experimental AVX2 backend, available using the `yolocrypto` feature when * an `avx2` backend using parallel formulas, available when compiling for a
compiling for a target with `target_feature=+avx2`. target with `target_feature=+avx2`.
By default the `u64` backend is selected. To select a specific backend, use: By default the `u64` backend is selected. To select a specific backend, use:
```sh ```sh
cargo build --no-default-features --features "std u32_backend" 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 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]: Benchmarks are run using [`criterion.rs`][criterion]:
@ -88,7 +90,7 @@ Benchmarks are run using [`criterion.rs`][criterion]:
export RUSTFLAGS="-C target_cpu=native" export RUSTFLAGS="-C target_cpu=native"
cargo bench --no-default-features --features "std u32_backend" 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 u64_backend"
cargo bench --no-default-features --features "std avx2_backend yolocrypto" cargo bench --no-default-features --features "std avx2_backend"
``` ```
# Contributing # Contributing
@ -117,7 +119,8 @@ to the Dalek race.*
Portions of this library were originally a port of [Adam Langley's Portions of this library were originally a port of [Adam Langley's
Golang ed25519 library](https://github.com/agl/ed25519), which was in 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 fast `u32` and `u64` scalar arithmetic was implemented by Andrew Moon, and
the addition chain for scalar inversion was provided by Brian Smith. the addition chain for scalar inversion was provided by Brian Smith.

View file

@ -1,5 +1,5 @@
#![cfg_attr(feature = "nightly", feature(cfg_target_feature))] #![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(unused_variables)]
#![allow(non_snake_case)] #![allow(non_snake_case)]
#![allow(dead_code)] #![allow(dead_code)]

View file

@ -27,6 +27,6 @@ pub mod u32;
#[cfg(feature = "u64_backend")] #[cfg(feature = "u64_backend")]
pub mod u64; pub mod u64;
#[cfg(all(feature = "avx2_backend", feature = "yolocrypto", target_feature = "avx2"))] #[cfg(all(feature = "avx2_backend", target_feature = "avx2"))]
pub mod avx2; pub mod avx2;

View file

@ -14,7 +14,7 @@
#![cfg_attr(feature = "nightly", feature(cfg_target_feature))] #![cfg_attr(feature = "nightly", feature(cfg_target_feature))]
#![cfg_attr(feature = "nightly", feature(external_doc))] #![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. // Refuse to compile if documentation is missing, but only on nightly.
// //