mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-06 20:41:14 +00:00
Merge remote-tracking branch 'origin/release/2.0' into fix-docsrs
This commit is contained in:
commit
379e506336
2 changed files with 103 additions and 76 deletions
177
.github/workflows/rust.yml
vendored
177
.github/workflows/rust.yml
vendored
|
|
@ -8,94 +8,121 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
RUSTFLAGS: '-D warnings'
|
||||||
|
RUSTDOCFLAGS: '-D warnings'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-u32:
|
test:
|
||||||
name: Test u32 backend
|
name: Test all features
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
# 32-bit target
|
||||||
|
- target: i686-unknown-linux-gnu
|
||||||
|
deps: sudo apt update && sudo apt install gcc-multilib
|
||||||
|
# 64-bit target
|
||||||
|
- target: x86_64-unknown-linux-gnu
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
profile: minimal
|
target: ${{ matrix.target }}
|
||||||
toolchain: stable
|
- run: ${{ matrix.deps }}
|
||||||
override: true
|
- run: cargo test --target ${{ matrix.target }} --all-features
|
||||||
- uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: --no-default-features --features "std u32_backend"
|
|
||||||
|
|
||||||
test-u64:
|
build-simd:
|
||||||
name: Test u64 backend
|
name: Test simd backend (nightly)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: dtolnay/rust-toolchain@nightly
|
||||||
with:
|
- env:
|
||||||
profile: minimal
|
RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx2'
|
||||||
toolchain: stable
|
run: cargo build --target x86_64-unknown-linux-gnu
|
||||||
override: true
|
- env:
|
||||||
- uses: actions-rs/cargo@v1
|
RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx512ifma'
|
||||||
with:
|
run: cargo build --target x86_64-unknown-linux-gnu
|
||||||
command: test
|
|
||||||
args: --no-default-features --features "std u64_backend"
|
|
||||||
|
|
||||||
nightly:
|
|
||||||
name: Test nightly compiler
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
profile: minimal
|
|
||||||
toolchain: nightly
|
|
||||||
override: true
|
|
||||||
- uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: --features "nightly"
|
|
||||||
|
|
||||||
test-defaults-serde:
|
|
||||||
name: Test default feature selection and serde
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
- uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: --features "serde"
|
|
||||||
|
|
||||||
msrv:
|
msrv:
|
||||||
name: Current MSRV is 1.51
|
name: Current MSRV is 1.60.0
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions-rs/toolchain@v1
|
# First delete the checked-in `Cargo.lock`. We're going to regenerate it
|
||||||
with:
|
- run: rm Cargo.lock
|
||||||
profile: minimal
|
# Now run `cargo +nightly -Z minimal-verisons check` in order to get a
|
||||||
toolchain: 1.51
|
# Cargo.lock with the oldest possible deps
|
||||||
override: true
|
- uses: dtolnay/rust-toolchain@nightly
|
||||||
- uses: actions-rs/cargo@v1
|
- run: cargo -Z minimal-versions check --no-default-features --features serde
|
||||||
with:
|
# Now check that `cargo build` works with respect to the oldest possible
|
||||||
command: build
|
# deps and the stated MSRV
|
||||||
|
- uses: dtolnay/rust-toolchain@1.60.0
|
||||||
|
- run: cargo build
|
||||||
|
|
||||||
|
# no_std support is pending feature, tracking:
|
||||||
|
# https://github.com/dalek-cryptography/x25519-dalek/issues/111
|
||||||
|
# # Test no_std integration with no features
|
||||||
|
# build-nostd-base:
|
||||||
|
# name: Build on no_std target (thumbv7em-none-eabi)
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v3
|
||||||
|
# - uses: dtolnay/rust-toolchain@master
|
||||||
|
# with:
|
||||||
|
# toolchain: stable
|
||||||
|
# targets: thumbv7em-none-eabi
|
||||||
|
# - uses: taiki-e/install-action@cargo-hack
|
||||||
|
# # No default features build
|
||||||
|
# - run: cargo build --target thumbv7em-none-eabi --release --no-default-features
|
||||||
|
#
|
||||||
|
# # Test no_std integration with all no_std features
|
||||||
|
# build-nostd-features:
|
||||||
|
# name: Build on no_std target (thumbv7em-none-eabi)
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v3
|
||||||
|
# - uses: dtolnay/rust-toolchain@master
|
||||||
|
# with:
|
||||||
|
# toolchain: stable
|
||||||
|
# targets: thumbv7em-none-eabi
|
||||||
|
# - uses: taiki-e/install-action@cargo-hack
|
||||||
|
# # No default features build
|
||||||
|
# - run: cargo hack build --target thumbv7em-none-eabi --release --each-feature --exclude-features default,std
|
||||||
|
|
||||||
bench:
|
bench:
|
||||||
name: Check that benchmarks compile
|
name: Check that benchmarks compile
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
- run: cargo build --benches
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
rustfmt:
|
||||||
override: true
|
name: Check formatting
|
||||||
- uses: actions-rs/cargo@v1
|
runs-on: ubuntu-latest
|
||||||
with:
|
steps:
|
||||||
command: bench
|
- uses: actions/checkout@v3
|
||||||
# This filter selects no benchmarks, so we don't run any, only build them.
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
args: "DONTRUNBENCHMARKS"
|
with:
|
||||||
|
components: rustfmt
|
||||||
|
- run: cargo fmt --all -- --check
|
||||||
|
|
||||||
|
clippy:
|
||||||
|
name: Check that clippy is happy
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: dtolnay/rust-toolchain@1.65
|
||||||
|
with:
|
||||||
|
components: clippy
|
||||||
|
- run: cargo clippy
|
||||||
|
|
||||||
|
doc:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
- run: cargo doc --all-features
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ impl ReusableSecret {
|
||||||
SharedSecret(self.0 * their_public.0)
|
SharedSecret(self.0 * their_public.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Generate a non-serializeable x25519 [`ReuseableSecret`] key.
|
/// Generate a non-serializeable x25519 [`ReusableSecret`] key.
|
||||||
pub fn new<T: RngCore + CryptoRng>(mut csprng: T) -> Self {
|
pub fn new<T: RngCore + CryptoRng>(mut csprng: T) -> Self {
|
||||||
let mut bytes = [0u8; 32];
|
let mut bytes = [0u8; 32];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue