Skip to content

Commit 5080b42

Browse files
committed
Merge remote-tracking branch 'origin/release/2.0' into fix-no_std
2 parents f3c46bc + 853a3df commit 5080b42

File tree

2 files changed

+100
-73
lines changed

2 files changed

+100
-73
lines changed

.github/workflows/rust.yml

+99-72
Original file line numberDiff line numberDiff line change
@@ -8,94 +8,121 @@ on:
88

99
env:
1010
CARGO_TERM_COLOR: always
11+
RUSTFLAGS: '-D warnings'
12+
RUSTDOCFLAGS: '-D warnings'
1113

1214
jobs:
13-
test-u32:
14-
name: Test u32 backend
15+
test:
16+
name: Test all features
1517
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
include:
21+
# 32-bit target
22+
- target: i686-unknown-linux-gnu
23+
deps: sudo apt update && sudo apt install gcc-multilib
24+
# 64-bit target
25+
- target: x86_64-unknown-linux-gnu
1626
steps:
17-
- uses: actions/checkout@v2
18-
- uses: actions-rs/toolchain@v1
19-
with:
20-
profile: minimal
21-
toolchain: stable
22-
override: true
23-
- uses: actions-rs/cargo@v1
24-
with:
25-
command: test
26-
args: --no-default-features --features "std u32_backend"
27+
- uses: actions/checkout@v3
28+
- uses: dtolnay/rust-toolchain@stable
29+
with:
30+
target: ${{ matrix.target }}
31+
- run: ${{ matrix.deps }}
32+
- run: cargo test --target ${{ matrix.target }} --all-features
2733

28-
test-u64:
29-
name: Test u64 backend
34+
build-simd:
35+
name: Test simd backend (nightly)
3036
runs-on: ubuntu-latest
3137
steps:
32-
- uses: actions/checkout@v2
33-
- uses: actions-rs/toolchain@v1
34-
with:
35-
profile: minimal
36-
toolchain: stable
37-
override: true
38-
- uses: actions-rs/cargo@v1
39-
with:
40-
command: test
41-
args: --no-default-features --features "std u64_backend"
38+
- uses: actions/checkout@v3
39+
- uses: dtolnay/rust-toolchain@nightly
40+
- env:
41+
RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx2'
42+
run: cargo build --target x86_64-unknown-linux-gnu
43+
- env:
44+
RUSTFLAGS: '--cfg curve25519_dalek_backend="simd" -C target_feature=+avx512ifma'
45+
run: cargo build --target x86_64-unknown-linux-gnu
4246

43-
nightly:
44-
name: Test nightly compiler
47+
msrv:
48+
name: Current MSRV is 1.60.0
4549
runs-on: ubuntu-latest
4650
steps:
47-
- uses: actions/checkout@v2
48-
- uses: actions-rs/toolchain@v1
49-
with:
50-
profile: minimal
51-
toolchain: nightly
52-
override: true
53-
- uses: actions-rs/cargo@v1
54-
with:
55-
command: test
56-
args: --features "nightly"
51+
- uses: actions/checkout@v3
52+
# First delete the checked-in `Cargo.lock`. We're going to regenerate it
53+
- run: rm Cargo.lock
54+
# Now run `cargo +nightly -Z minimal-verisons check` in order to get a
55+
# Cargo.lock with the oldest possible deps
56+
- uses: dtolnay/rust-toolchain@nightly
57+
- run: cargo -Z minimal-versions check --no-default-features --features serde
58+
# Now check that `cargo build` works with respect to the oldest possible
59+
# deps and the stated MSRV
60+
- uses: dtolnay/rust-toolchain@1.60.0
61+
- run: cargo build
62+
63+
# no_std support is pending feature, tracking:
64+
# https://github.com/dalek-cryptography/x25519-dalek/issues/111
65+
# # Test no_std integration with no features
66+
# build-nostd-base:
67+
# name: Build on no_std target (thumbv7em-none-eabi)
68+
# runs-on: ubuntu-latest
69+
# steps:
70+
# - uses: actions/checkout@v3
71+
# - uses: dtolnay/rust-toolchain@master
72+
# with:
73+
# toolchain: stable
74+
# targets: thumbv7em-none-eabi
75+
# - uses: taiki-e/install-action@cargo-hack
76+
# # No default features build
77+
# - run: cargo build --target thumbv7em-none-eabi --release --no-default-features
78+
#
79+
# # Test no_std integration with all no_std features
80+
# build-nostd-features:
81+
# name: Build on no_std target (thumbv7em-none-eabi)
82+
# runs-on: ubuntu-latest
83+
# steps:
84+
# - uses: actions/checkout@v3
85+
# - uses: dtolnay/rust-toolchain@master
86+
# with:
87+
# toolchain: stable
88+
# targets: thumbv7em-none-eabi
89+
# - uses: taiki-e/install-action@cargo-hack
90+
# # No default features build
91+
# - run: cargo hack build --target thumbv7em-none-eabi --release --each-feature --exclude-features default,std
5792

58-
test-defaults-serde:
59-
name: Test default feature selection and serde
93+
bench:
94+
name: Check that benchmarks compile
6095
runs-on: ubuntu-latest
6196
steps:
62-
- uses: actions/checkout@v2
63-
- uses: actions-rs/toolchain@v1
64-
with:
65-
profile: minimal
66-
toolchain: stable
67-
override: true
68-
- uses: actions-rs/cargo@v1
69-
with:
70-
command: test
71-
args: --features "serde"
97+
- uses: actions/checkout@v3
98+
- uses: dtolnay/rust-toolchain@stable
99+
- run: cargo build --benches
72100

73-
msrv:
74-
name: Current MSRV is 1.51
101+
rustfmt:
102+
name: Check formatting
75103
runs-on: ubuntu-latest
76104
steps:
77-
- uses: actions/checkout@v2
78-
- uses: actions-rs/toolchain@v1
79-
with:
80-
profile: minimal
81-
toolchain: 1.51
82-
override: true
83-
- uses: actions-rs/cargo@v1
84-
with:
85-
command: build
105+
- uses: actions/checkout@v3
106+
- uses: dtolnay/rust-toolchain@stable
107+
with:
108+
components: rustfmt
109+
- run: cargo fmt --all -- --check
86110

87-
bench:
88-
name: Check that benchmarks compile
111+
clippy:
112+
name: Check that clippy is happy
113+
runs-on: ubuntu-latest
114+
steps:
115+
- uses: actions/checkout@v3
116+
- uses: dtolnay/rust-toolchain@1.65
117+
with:
118+
components: clippy
119+
- run: cargo clippy
120+
121+
doc:
89122
runs-on: ubuntu-latest
90123
steps:
91-
- uses: actions/checkout@v2
92-
- uses: actions-rs/toolchain@v1
93-
with:
94-
profile: minimal
95-
toolchain: stable
96-
override: true
97-
- uses: actions-rs/cargo@v1
98-
with:
99-
command: bench
100-
# This filter selects no benchmarks, so we don't run any, only build them.
101-
args: "DONTRUNBENCHMARKS"
124+
- uses: actions/checkout@v3
125+
- uses: dtolnay/rust-toolchain@stable
126+
with:
127+
toolchain: stable
128+
- run: cargo doc --all-features

src/x25519.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl ReusableSecret {
125125
SharedSecret(self.0 * their_public.0)
126126
}
127127

128-
/// Generate a non-serializeable x25519 [`ReuseableSecret`] key.
128+
/// Generate a non-serializeable x25519 [`ReusableSecret`] key.
129129
pub fn new<T: RngCore + CryptoRng>(mut csprng: T) -> Self {
130130
let mut bytes = [0u8; 32];
131131

0 commit comments

Comments
 (0)