Skip to content

Commit

Permalink
Merge pull request #118 from RustCrypto/aes-ctr/2018-edition-and-stre…
Browse files Browse the repository at this point in the history
…am-cipher-upgrade

aes-ctr: 2018 edition and `digest` crate upgrade
  • Loading branch information
tarcieri authored May 29, 2020
2 parents abd7f7e + 7f0002c commit a45b2fe
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/aes-ctr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
working-directory: aes-ctr
- run: cargo test --release
working-directory: aes-ctr
- run: cargo test --release
- run: cargo test --release --lib
env:
RUSTFLAGS: "-C target-feature=+aes,+sse2,+ssse3"
working-directory: aes-ctr
20 changes: 5 additions & 15 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ members = [
]

[patch.crates-io]
aesni = { git = "https://github.com/RustCrypto/block-ciphers" }
aes-soft = { git = "https://github.com/RustCrypto/block-ciphers" }
block-cipher = { git = "https://github.com/RustCrypto/traits" }
stream-cipher = { git = "https://github.com/RustCrypto/traits" }
11 changes: 6 additions & 5 deletions aes-ctr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ repository = "https://github.com/RustCrypto/stream-ciphers"
keywords = ["crypto", "stream-cipher", "trait"]
categories = ["cryptography", "no-std"]
readme = "README.md"
edition = "2018"

[dependencies]
stream-cipher = "0.3"
stream-cipher = "= 0.4.0-pre"

[target.'cfg(not(all(target_feature = "aes", target_feature = "sse2", target_feature = "ssse3", any(target_arch = "x86_64", target_arch = "x86"))))'.dependencies]
ctr = "0.3"
aes-soft = "0.3"
ctr = { version = "0.3", path = "../ctr" }
aes-soft = "= 0.4.0-pre"

[target.'cfg(all(target_feature = "aes", target_feature = "sse2", target_feature = "ssse3", any(target_arch = "x86_64", target_arch = "x86")))'.dependencies]
aesni = "0.6"
aesni = "= 0.7.0-pre"

[dev-dependencies]
stream-cipher = { version = "0.3", features = ["dev"] }
stream-cipher = { version = "= 0.4.0-pre", features = ["dev"] }

[badges]
travis-ci = { repository = "RustCrypto/stream-ciphers" }
2 changes: 1 addition & 1 deletion aes-ctr/benches/aes128_ctr.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![feature(test)]
#[macro_use]
extern crate stream_cipher;
extern crate aes_ctr;
use aes_ctr;

bench_sync!(aes_ctr::Aes128Ctr);
2 changes: 1 addition & 1 deletion aes-ctr/benches/aes192_ctr.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![feature(test)]
#[macro_use]
extern crate stream_cipher;
extern crate aes_ctr;
use aes_ctr;

bench_sync!(aes_ctr::Aes192Ctr);
2 changes: 1 addition & 1 deletion aes-ctr/benches/aes256_ctr.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![feature(test)]
#[macro_use]
extern crate stream_cipher;
extern crate aes_ctr;
use aes_ctr;

bench_sync!(aes_ctr::Aes128Ctr);
27 changes: 7 additions & 20 deletions aes-ctr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,44 +38,31 @@
//! ```
#![no_std]
#![deny(missing_docs)]

pub use stream_cipher;

#[cfg(not(all(
target_feature = "aes",
target_feature = "sse2",
target_feature = "ssse3",
any(target_arch = "x86_64", target_arch = "x86"),
)))]
extern crate aes_soft;
#[cfg(not(all(
target_feature = "aes",
target_feature = "sse2",
target_feature = "ssse3",
any(target_arch = "x86_64", target_arch = "x86"),
)))]
extern crate ctr;
pub extern crate stream_cipher;
mod soft;

#[cfg(not(all(
target_feature = "aes",
target_feature = "sse2",
target_feature = "ssse3",
any(target_arch = "x86_64", target_arch = "x86"),
)))]
mod dummy;

#[cfg(all(
target_feature = "aes",
target_feature = "sse2",
target_feature = "ssse3",
any(target_arch = "x86_64", target_arch = "x86"),
))]
extern crate aesni;
use soft as aes;

#[cfg(all(
target_feature = "aes",
target_feature = "sse2",
target_feature = "ssse3",
any(target_arch = "x86_64", target_arch = "x86"),
))]
use aesni as dummy;
use aesni as aes;

pub use dummy::{Aes128Ctr, Aes192Ctr, Aes256Ctr};
pub use crate::aes::{Aes128Ctr, Aes192Ctr, Aes256Ctr};
File renamed without changes.
2 changes: 1 addition & 1 deletion aes-ctr/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![no_std]
extern crate aes_ctr;

#[macro_use]
extern crate stream_cipher;

Expand Down

0 comments on commit a45b2fe

Please sign in to comment.