Skip to content

Commit 2d71c31

Browse files
committed
[WIP] Unify the aes, aesni, and aes-soft crates
Combines all three crates into a single `aes` crate. The optional `ctr` feature exposes a consistent set of `Aes*Ctr` types as well.
1 parent e1e2f0f commit 2d71c31

Some content is hidden

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

55 files changed

+241
-1368
lines changed

.github/workflows/aes-soft.yml

-100
This file was deleted.

.github/workflows/aes.yml

+96-14
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,107 @@ jobs:
3131
- uses: actions/checkout@v1
3232
- uses: actions-rs/toolchain@v1
3333
with:
34+
toolchain: ${{ matrix.rust }}
35+
target: ${{ matrix.target }}
3436
profile: minimal
37+
override: true
38+
- run: cargo build --release --target ${{ matrix.target }}
39+
40+
# Tests for the portable software backend
41+
soft:
42+
runs-on: ubuntu-latest
43+
strategy:
44+
matrix:
45+
include:
46+
# 32-bit Linux
47+
- target: i686-unknown-linux-gnu
48+
rust: 1.41.0 # MSRV
49+
deps: sudo apt install gcc-multilib
50+
- target: i686-unknown-linux-gnu
51+
rust: stable
52+
deps: sudo apt install gcc-multilib
53+
54+
# 64-bit Linux
55+
- target: x86_64-unknown-linux-gnu
56+
rust: 1.41.0 # MSRV
57+
- target: x86_64-unknown-linux-gnu
58+
rust: stable
59+
steps:
60+
- uses: actions/checkout@v1
61+
- uses: actions-rs/toolchain@v1
62+
with:
3563
toolchain: ${{ matrix.rust }}
3664
target: ${{ matrix.target }}
65+
profile: minimal
3766
override: true
38-
- run: cargo build --no-default-features --release --target ${{ matrix.target }}
39-
test:
67+
- run: ${{ matrix.deps }}
68+
- run: cargo check --target ${{ matrix.target }} --all-features
69+
- run: cargo test --release --target ${{ matrix.target }}
70+
- run: cargo test --release --target ${{ matrix.target }} --features semi_fixslice
71+
72+
# Tests for the AES-NI backend
73+
aesni:
4074
runs-on: ubuntu-latest
75+
env:
76+
CARGO_INCREMENTAL: 0
77+
RUSTDOCFLAGS: "-Ctarget-feature=+aes,+ssse3"
78+
RUSTFLAGS: "-Dwarnings -Ctarget-feature=+aes,+ssse3"
4179
strategy:
4280
matrix:
43-
rust:
44-
- 1.41.0 # MSRV
45-
- stable
81+
include:
82+
# 32-bit Linux
83+
- target: i686-unknown-linux-gnu
84+
rust: 1.41.0 # MSRV
85+
deps: sudo apt install gcc-multilib
86+
- target: i686-unknown-linux-gnu
87+
rust: stable
88+
deps: sudo apt install gcc-multilib
89+
90+
# 64-bit Linux
91+
- target: x86_64-unknown-linux-gnu
92+
rust: 1.41.0 # MSRV
93+
- target: x86_64-unknown-linux-gnu
94+
rust: stable
4695
steps:
47-
- uses: actions/checkout@v1
48-
- uses: actions-rs/toolchain@v1
49-
with:
50-
profile: minimal
51-
toolchain: ${{ matrix.rust }}
52-
- run: cargo check --all-features
53-
- run: cargo test --no-default-features
54-
- run: cargo test
55-
- run: cargo test --all-features
96+
- uses: actions/checkout@v1
97+
- uses: actions-rs/toolchain@v1
98+
with:
99+
profile: minimal
100+
toolchain: ${{ matrix.rust }}
101+
- run: ${{ matrix.deps }}
102+
- run: "echo $RUSTDOCFLAGS"
103+
- run: cargo check --all-features
104+
- run: cargo test --no-default-features
105+
- run: cargo test
106+
- run: cargo test --all-features
107+
108+
# Cross-compiled tests
109+
cross:
110+
strategy:
111+
matrix:
112+
include:
113+
# ARM64
114+
- target: aarch64-unknown-linux-gnu
115+
rust: 1.41.0 # MSRV
116+
- target: aarch64-unknown-linux-gnu
117+
rust: stable
118+
119+
# PPC32
120+
- target: powerpc-unknown-linux-gnu
121+
rust: 1.41.0 # MSRV
122+
- target: powerpc-unknown-linux-gnu
123+
rust: stable
124+
125+
runs-on: ubuntu-latest
126+
steps:
127+
- uses: actions/checkout@v1
128+
- run: ${{ matrix.deps }}
129+
- uses: actions-rs/toolchain@v1
130+
with:
131+
toolchain: ${{ matrix.rust }}
132+
target: ${{ matrix.target }}
133+
profile: minimal
134+
override: true
135+
- run: cargo install cross
136+
- run: cross test --release --target ${{ matrix.target }}
137+
- run: cross test --release --target ${{ matrix.target }} --features semi_fixslice

.github/workflows/aesni.yml

-37
This file was deleted.

Cargo.lock

+11-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[workspace]
22
members = [
33
"aes",
4-
"aes/aes-soft",
5-
"aes/aesni",
64
"blowfish",
75
"block-modes",
86
"gost-modes",

aes/Cargo.toml

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
[package]
22
name = "aes"
3-
version = "0.6.0"
4-
description = "Facade for AES (Rijndael) block ciphers implementations"
3+
version = "0.7.0-pre"
4+
description = """
5+
Pure Rust implementation of the Advanced Encryption Standard (a.k.a. Rijndael)
6+
including support for AES in counter mode (a.k.a. AES-CTR)
7+
"""
58
authors = ["RustCrypto Developers"]
69
license = "MIT OR Apache-2.0"
710
readme = "README.md"
@@ -13,12 +16,15 @@ categories = ["cryptography", "no-std"]
1316

1417
[dependencies]
1518
cipher = "0.2"
16-
17-
[target.'cfg(not(all(target_feature="aes", target_feature = "sse2", any(target_arch = "x86_64", target_arch = "x86"))))'.dependencies]
18-
aes-soft = { version = "0.6", path = "aes-soft" }
19-
20-
[target.'cfg(all(target_feature="aes", target_feature = "sse2", any(target_arch = "x86_64", target_arch = "x86")))'.dependencies]
21-
aesni = { version = "0.10", default-features = false, path = "aesni" }
19+
ctr = { version = "0.6", optional = true }
20+
opaque-debug = "0.3"
2221

2322
[dev-dependencies]
2423
cipher = { version = "0.2", features = ["dev"] }
24+
25+
[features]
26+
semi_fixslice = []
27+
28+
[package.metadata.docs.rs]
29+
all-features = true
30+
rustdoc-args = ["--cfg", "docsrs"]

0 commit comments

Comments
 (0)