Skip to content

Commit 01da298

Browse files
committed
migrate to cipher v0.4
1 parent f253d53 commit 01da298

File tree

181 files changed

+4842
-7139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+4842
-7139
lines changed

.github/workflows/aes.yml

Lines changed: 83 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,25 @@ jobs:
3636
target: ${{ matrix.target }}
3737
profile: minimal
3838
override: true
39-
- run: cargo check --features compact,ctr,force-soft
40-
- run: cargo build --release --target ${{ matrix.target }}
41-
- run: cargo build --release --target ${{ matrix.target }} --features compact
42-
- run: cargo build --release --target ${{ matrix.target }} --features ctr
43-
- run: cargo build --release --target ${{ matrix.target }} --features force-soft
44-
- run: cargo build --release --target ${{ matrix.target }} --features hazmat
45-
- run: cargo build --release --target ${{ matrix.target }} --features compact,ctr,force-soft
39+
- run: cargo check
40+
- run: |
41+
cargo build --target ${{ matrix.target }}
42+
cargo build --target ${{ matrix.target }} --features hazmat
43+
- env:
44+
RUSTFLAGS: "-Dwarnings --cfg aes_force_soft"
45+
run: |
46+
cargo build --target ${{ matrix.target }}
47+
cargo build --target ${{ matrix.target }} --features hazmat
48+
- env:
49+
RUSTFLAGS: "-Dwarnings --cfg aes_compact"
50+
run: |
51+
cargo build --target ${{ matrix.target }}
52+
cargo build --target ${{ matrix.target }} --features hazmat
53+
- env:
54+
RUSTFLAGS: "-Dwarnings --cfg aes_force_soft --cfg aes_compact"
55+
run: |
56+
cargo build --target ${{ matrix.target }}
57+
cargo build --target ${{ matrix.target }} --features hazmat
4658
4759
# Tests for the AES-NI backend
4860
aesni:
@@ -76,12 +88,9 @@ jobs:
7688
profile: minimal
7789
override: true
7890
- run: ${{ matrix.deps }}
79-
- run: cargo test --release --target ${{ matrix.target }}
80-
- run: cargo test --release --target ${{ matrix.target }} --features compact
81-
- run: cargo test --release --target ${{ matrix.target }} --features ctr
82-
- run: cargo test --release --target ${{ matrix.target }} --features force-soft
83-
- run: cargo test --release --target ${{ matrix.target }} --features hazmat
84-
- run: cargo test --release --target ${{ matrix.target }} --all-features
91+
- run: cargo test --target ${{ matrix.target }}
92+
- run: cargo test --target ${{ matrix.target }} --features hazmat
93+
- run: cargo test --target ${{ matrix.target }} --all-features
8594

8695
# Tests for CPU feature autodetection with fallback to portable software implementation
8796
autodetect:
@@ -111,29 +120,29 @@ jobs:
111120
profile: minimal
112121
override: true
113122
- run: ${{ matrix.deps }}
114-
- run: cargo test --release --target ${{ matrix.target }}
115-
- run: cargo test --release --target ${{ matrix.target }} --features compact
116-
- run: cargo test --release --target ${{ matrix.target }} --features ctr
117-
- run: cargo test --release --target ${{ matrix.target }} --features hazmat
118-
- run: cargo test --release --target ${{ matrix.target }} --all-features
123+
- run: cargo test --target ${{ matrix.target }}
124+
- run: cargo test --target ${{ matrix.target }} --features hazmat
125+
- run: cargo test --target ${{ matrix.target }} --all-features
119126

120-
# Tests for the portable software backend (i.e. `force-soft`-only)
127+
# Tests for the portable software backend (i.e. `aes_force_soft`-only)
121128
soft:
122129
runs-on: ubuntu-latest
130+
env:
131+
RUSTFLAGS: "-Dwarnings --cfg aes_force_soft"
123132
strategy:
124133
matrix:
125134
include:
126135
# 32-bit Linux
127136
- target: i686-unknown-linux-gnu
128-
rust: 1.41.0 # MSRV (temporarily lower than with CPU feature auto-detection)
137+
rust: 1.49.0 # MSRV
129138
deps: sudo apt update && sudo apt install gcc-multilib
130139
- target: i686-unknown-linux-gnu
131140
rust: stable
132141
deps: sudo apt update && sudo apt install gcc-multilib
133142

134143
# 64-bit Linux
135144
- target: x86_64-unknown-linux-gnu
136-
rust: 1.41.0 # MSRV (temporarily lower than with CPU feature auto-detection)
145+
rust: 1.49.0 # MSRV
137146
- target: x86_64-unknown-linux-gnu
138147
rust: stable
139148
steps:
@@ -145,28 +154,33 @@ jobs:
145154
profile: minimal
146155
override: true
147156
- run: ${{ matrix.deps }}
148-
- run: cargo test --release --target ${{ matrix.target }} --features force-soft
149-
- run: cargo test --release --target ${{ matrix.target }} --features force-soft,compact
150-
- run: cargo test --release --target ${{ matrix.target }} --features force-soft,ctr
151-
- run: cargo test --release --target ${{ matrix.target }} --features force-soft,compact,ctr
157+
- run: cargo test --target ${{ matrix.target }}
158+
- run: cargo test --target ${{ matrix.target }} --all-features
159+
152160

153161
# Cross-compiled tests
154162
cross:
155163
strategy:
156164
matrix:
165+
# note that on 1.49-1.50 cargo returns an error when `--features` is
166+
# used inside virtual manifest, so we test 1.51 here
157167
include:
158168
# ARM64
159169
- target: aarch64-unknown-linux-gnu
160-
rust: 1.49.0 # MSRV
170+
rust: 1.51.0 # MSRV
161171
- target: aarch64-unknown-linux-gnu
162172
rust: stable
163173

164174
# PPC32
165175
- target: powerpc-unknown-linux-gnu
166-
rust: 1.49.0 # MSRV
176+
rust: 1.51.0 # MSRV
167177
- target: powerpc-unknown-linux-gnu
168178
rust: stable
169179
runs-on: ubuntu-latest
180+
# Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml
181+
defaults:
182+
run:
183+
working-directory: .
170184
steps:
171185
- uses: actions/checkout@v1
172186
- run: ${{ matrix.deps }}
@@ -176,22 +190,45 @@ jobs:
176190
target: ${{ matrix.target }}
177191
profile: minimal
178192
override: true
179-
- run: cargo install cross
180-
- run: cross test --release --target ${{ matrix.target }}
181-
- run: cross test --release --target ${{ matrix.target }} --features compact
182-
- run: cross test --release --target ${{ matrix.target }} --features ctr
183-
- run: cross test --release --target ${{ matrix.target }} --features force-soft
184-
- run: cross test --release --target ${{ matrix.target }} --features hazmat
185-
- run: cross test --release --target ${{ matrix.target }} --features compact,ctr,force-soft,hazmat
193+
- name: Install pre-compiled cross
194+
run: |
195+
export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url')
196+
wget -O /tmp/binaries.tar.gz $URL
197+
tar -C /tmp -xzf /tmp/binaries.tar.gz
198+
mv /tmp/cross ~/.cargo/bin
199+
- run: |
200+
cross test --package aes --target ${{ matrix.target }}
201+
cross test --package aes --target ${{ matrix.target }} --features hazmat
202+
- env:
203+
RUSTFLAGS: "-Dwarnings --cfg aes_force_soft"
204+
run: |
205+
cross test --package aes --target ${{ matrix.target }}
206+
cross test --package aes --target ${{ matrix.target }} --features hazmat
207+
- env:
208+
RUSTFLAGS: "-Dwarnings --cfg aes_compact"
209+
run: |
210+
cross test --package aes --target ${{ matrix.target }}
211+
cross test --package aes --target ${{ matrix.target }} --features hazmat
212+
- env:
213+
RUSTFLAGS: "-Dwarnings --cfg aes_force_soft --cfg aes_compact"
214+
run: |
215+
cross test --package aes --target ${{ matrix.target }}
216+
cross test --package aes --target ${{ matrix.target }} --features hazmat
186217
187218
# ARMv8 cross-compiled tests for AES intrinsics (nightly-only)
188219
armv8:
220+
env:
221+
RUSTFLAGS: "-Dwarnings --cfg aes_armv8"
189222
strategy:
190223
matrix:
191224
include:
192225
- target: aarch64-unknown-linux-gnu
193226
rust: nightly
194227
runs-on: ubuntu-latest
228+
# Cross mounts only current package, i.e. by default it ignores workspace's Cargo.toml
229+
defaults:
230+
run:
231+
working-directory: .
195232
steps:
196233
- uses: actions/checkout@v1
197234
- run: ${{ matrix.deps }}
@@ -201,15 +238,19 @@ jobs:
201238
target: ${{ matrix.target }}
202239
profile: minimal
203240
override: true
204-
- run: cargo install cross
205-
- run: cross test --release --target ${{ matrix.target }} --features armv8
206-
- run: cross test --release --target ${{ matrix.target }} --features armv8,compact
207-
- run: cross test --release --target ${{ matrix.target }} --features armv8,ctr
208-
- run: cross test --release --target ${{ matrix.target }} --features armv8,force-soft
209-
- run: cross test --release --target ${{ matrix.target }} --features armv8,hazmat
210-
- run: cross test --release --target ${{ matrix.target }} --all-features
241+
- name: Install pre-compiled cross
242+
run: |
243+
export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url')
244+
wget -O /tmp/binaries.tar.gz $URL
245+
tar -C /tmp -xzf /tmp/binaries.tar.gz
246+
mv /tmp/cross ~/.cargo/bin
247+
- run: cross test --package aes --target ${{ matrix.target }}
248+
- run: cross test --package aes --target ${{ matrix.target }} --features hazmat
249+
- run: cross test --package aes --target ${{ matrix.target }} --all-features
211250

212251
clippy:
252+
env:
253+
RUSTFLAGS: "-Dwarnings --cfg aes_compact"
213254
runs-on: ubuntu-latest
214255
steps:
215256
- uses: actions/checkout@v1
@@ -219,4 +260,4 @@ jobs:
219260
components: clippy
220261
override: true
221262
profile: minimal
222-
- run: cargo clippy --features compact,ctr,hazmat -- -D warnings
263+
- run: cargo clippy --features hazmat -- -D warnings

.github/workflows/block-modes.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/blowfish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
matrix:
2424
rust:
25-
- 1.41.0 # MSRV
25+
- 1.49.0 # MSRV
2626
- stable
2727
target:
2828
- thumbv7em-none-eabi
@@ -42,7 +42,7 @@ jobs:
4242
strategy:
4343
matrix:
4444
rust:
45-
- 1.41.0 # MSRV
45+
- 1.49.0 # MSRV
4646
- stable
4747
steps:
4848
- uses: actions/checkout@v1

.github/workflows/cast5.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
matrix:
2424
rust:
25-
- 1.41.0 # MSRV
25+
- 1.49.0 # MSRV
2626
- stable
2727
target:
2828
- thumbv7em-none-eabi
@@ -42,7 +42,7 @@ jobs:
4242
strategy:
4343
matrix:
4444
rust:
45-
- 1.41.0 # MSRV
45+
- 1.49.0 # MSRV
4646
- stable
4747
steps:
4848
- uses: actions/checkout@v1

.github/workflows/des.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
matrix:
2424
rust:
25-
- 1.41.0 # MSRV
25+
- 1.49.0 # MSRV
2626
- stable
2727
target:
2828
- thumbv7em-none-eabi
@@ -42,7 +42,7 @@ jobs:
4242
strategy:
4343
matrix:
4444
rust:
45-
- 1.41.0 # MSRV
45+
- 1.49.0 # MSRV
4646
- stable
4747
steps:
4848
- uses: actions/checkout@v1

.github/workflows/gost-modes.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/idea.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
matrix:
2424
rust:
25-
- 1.41.0 # MSRV
25+
- 1.49.0 # MSRV
2626
- stable
2727
target:
2828
- thumbv7em-none-eabi
@@ -42,7 +42,7 @@ jobs:
4242
strategy:
4343
matrix:
4444
rust:
45-
- 1.41.0 # MSRV
45+
- 1.49.0 # MSRV
4646
- stable
4747
steps:
4848
- uses: actions/checkout@v1

0 commit comments

Comments
 (0)