Skip to content

Commit

Permalink
Unify the aes, aesni, and aes-soft crates (#200)
Browse files Browse the repository at this point in the history
Combines all three crates into a single `aes` crate.

The optional `ctr` feature exposes a consistent set of `Aes*Ctr` types as well.
  • Loading branch information
tarcieri authored Nov 18, 2020
1 parent e1e2f0f commit cd5a34f
Show file tree
Hide file tree
Showing 57 changed files with 268 additions and 1,443 deletions.
100 changes: 0 additions & 100 deletions .github/workflows/aes-soft.yml

This file was deleted.

109 changes: 95 additions & 14 deletions .github/workflows/aes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,106 @@ jobs:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
profile: minimal
override: true
- run: cargo build --release --target ${{ matrix.target }}

# Tests for the portable software backend
soft:
runs-on: ubuntu-latest
strategy:
matrix:
include:
# 32-bit Linux
- target: i686-unknown-linux-gnu
rust: 1.41.0 # MSRV
deps: sudo apt install gcc-multilib
- target: i686-unknown-linux-gnu
rust: stable
deps: sudo apt install gcc-multilib

# 64-bit Linux
- target: x86_64-unknown-linux-gnu
rust: 1.41.0 # MSRV
- target: x86_64-unknown-linux-gnu
rust: stable
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
profile: minimal
override: true
- run: cargo build --no-default-features --release --target ${{ matrix.target }}
test:
- run: ${{ matrix.deps }}
- run: cargo check --target ${{ matrix.target }} --all-features
- run: cargo test --release --target ${{ matrix.target }}
- run: cargo test --release --target ${{ matrix.target }} --features semi_fixslice

# Tests for the AES-NI backend
aesni:
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
RUSTDOCFLAGS: "-Ctarget-feature=+aes,+ssse3"
RUSTFLAGS: "-Dwarnings -Ctarget-feature=+aes,+ssse3"
strategy:
matrix:
rust:
- 1.41.0 # MSRV
- stable
include:
# 32-bit Linux
- target: i686-unknown-linux-gnu
rust: 1.41.0 # MSRV
deps: sudo apt install gcc-multilib
- target: i686-unknown-linux-gnu
rust: stable
deps: sudo apt install gcc-multilib

# 64-bit Linux
- target: x86_64-unknown-linux-gnu
rust: 1.41.0 # MSRV
- target: x86_64-unknown-linux-gnu
rust: stable
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
- run: cargo check --all-features
- run: cargo test --no-default-features
- run: cargo test
- run: cargo test --all-features
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
- run: ${{ matrix.deps }}
- run: cargo check --all-features
- run: cargo test --no-default-features
- run: cargo test
- run: cargo test --all-features

# Cross-compiled tests
cross:
strategy:
matrix:
include:
# ARM64
- target: aarch64-unknown-linux-gnu
rust: 1.41.0 # MSRV
- target: aarch64-unknown-linux-gnu
rust: stable

# PPC32
- target: powerpc-unknown-linux-gnu
rust: 1.41.0 # MSRV
- target: powerpc-unknown-linux-gnu
rust: stable

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: ${{ matrix.deps }}
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
profile: minimal
override: true
- run: cargo install cross
- run: cross test --release --target ${{ matrix.target }}
- run: cross test --release --target ${{ matrix.target }} --features semi_fixslice
37 changes: 0 additions & 37 deletions .github/workflows/aesni.yml

This file was deleted.

27 changes: 10 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[workspace]
members = [
"aes",
"aes/aes-soft",
"aes/aesni",
"blowfish",
"block-modes",
"gost-modes",
Expand Down
20 changes: 13 additions & 7 deletions aes/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[package]
name = "aes"
version = "0.6.0"
description = "Facade for AES (Rijndael) block ciphers implementations"
description = """
Pure Rust implementation of the Advanced Encryption Standard (a.k.a. Rijndael)
including support for AES in counter mode (a.k.a. AES-CTR)
"""
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand All @@ -13,12 +16,15 @@ categories = ["cryptography", "no-std"]

[dependencies]
cipher = "0.2"

[target.'cfg(not(all(target_feature="aes", target_feature = "sse2", any(target_arch = "x86_64", target_arch = "x86"))))'.dependencies]
aes-soft = { version = "0.6", path = "aes-soft" }

[target.'cfg(all(target_feature="aes", target_feature = "sse2", any(target_arch = "x86_64", target_arch = "x86")))'.dependencies]
aesni = { version = "0.10", default-features = false, path = "aesni" }
ctr = { version = "0.6", optional = true }
opaque-debug = "0.3"

[dev-dependencies]
cipher = { version = "0.2", features = ["dev"] }

[features]
semi_fixslice = []

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
Loading

0 comments on commit cd5a34f

Please sign in to comment.