Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace block-cipher/stream-cipher with cipher crate #167

Merged
merged 1 commit into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 42 additions & 54 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions aes/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aes"
version = "0.5.1"
version = "0.6.0-pre"
description = "Facade for AES (Rijndael) block ciphers implementations"
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
Expand All @@ -12,13 +12,13 @@ keywords = ["crypto", "aes", "rijndael", "block-cipher"]
categories = ["cryptography", "no-std"]

[dependencies]
block-cipher = "0.8"
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.5", path = "aes-soft" }
aes-soft = { version = "=0.6.0-pre", path = "aes-soft" }

[target.'cfg(all(target_feature="aes", target_feature = "sse2", any(target_arch = "x86_64", target_arch = "x86")))'.dependencies]
aesni = { version = "0.9", default-features = false, path = "aesni" }
aesni = { version = "0.10.0-pre", default-features = false, path = "aesni" }

[dev-dependencies]
block-cipher = { version = "0.8", features = ["dev"] }
cipher = { version = "0.2", features = ["dev"] }
6 changes: 3 additions & 3 deletions aes/aes-soft/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aes-soft"
version = "0.5.0"
version = "0.6.0-pre"
description = "AES (Rijndael) block ciphers bit-sliced implementation"
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
Expand All @@ -11,9 +11,9 @@ keywords = ["crypto", "aes", "rijndael", "block-cipher"]
categories = ["cryptography", "no-std"]

[dependencies]
block-cipher = "0.8"
cipher = "0.2"
opaque-debug = "0.3"
byteorder = { version = "1", default-features = false }

[dev-dependencies]
block-cipher = { version = "0.8", features = ["dev"] }
cipher = { version = "0.2", features = ["dev"] }
2 changes: 1 addition & 1 deletion aes/aes-soft/benches/aes128.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![feature(test)]
extern crate test;

use aes_soft::block_cipher::{BlockCipher, NewBlockCipher};
use aes_soft::cipher::{BlockCipher, NewBlockCipher};
use aes_soft::Aes128;

#[bench]
Expand Down
2 changes: 1 addition & 1 deletion aes/aes-soft/benches/aes192.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![feature(test)]
extern crate test;

use aes_soft::block_cipher::{BlockCipher, NewBlockCipher};
use aes_soft::cipher::{BlockCipher, NewBlockCipher};
use aes_soft::Aes192;

#[bench]
Expand Down
2 changes: 1 addition & 1 deletion aes/aes-soft/benches/aes256.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![feature(test)]
extern crate test;

use aes_soft::block_cipher::{BlockCipher, NewBlockCipher};
use aes_soft::cipher::{BlockCipher, NewBlockCipher};
use aes_soft::Aes256;

#[bench]
Expand Down
2 changes: 1 addition & 1 deletion aes/aes-soft/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
clippy::unreadable_literal
)]

use block_cipher::generic_array::{ArrayLength, GenericArray};
use cipher::generic_array::{ArrayLength, GenericArray};

use crate::bitslice::{bit_slice_4x1_with_u16, un_bit_slice_4x1_with_u16, AesOps};
use crate::consts::RCON;
Expand Down
24 changes: 14 additions & 10 deletions aes/aes-soft/src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
pub use block_cipher::{BlockCipher, NewBlockCipher};
pub use cipher::{BlockCipher, NewBlockCipher};

use block_cipher::consts::{U11, U13, U15, U16, U24, U32, U8};
use block_cipher::generic_array::GenericArray;
use cipher::{
consts::{U11, U13, U15, U16, U24, U32, U8},
generic_array::GenericArray,
};

use crate::bitslice::{
bit_slice_1x128_with_u32x4, bit_slice_1x16_with_u16, bit_slice_4x4_with_u16,
bit_slice_fill_4x4_with_u32x4, decrypt_core, encrypt_core, un_bit_slice_1x128_with_u32x4,
un_bit_slice_1x16_with_u16, Bs8State,
use crate::{
bitslice::{
bit_slice_1x128_with_u32x4, bit_slice_1x16_with_u16, bit_slice_4x4_with_u16,
bit_slice_fill_4x4_with_u32x4, decrypt_core, encrypt_core, un_bit_slice_1x128_with_u32x4,
un_bit_slice_1x16_with_u16, Bs8State,
},
consts::U32X4_0,
expand::expand_key,
simd::u32x4,
};
use crate::consts::U32X4_0;
use crate::expand::expand_key;
use crate::simd::u32x4;

pub type Block128 = GenericArray<u8, U16>;
pub type Block128x8 = GenericArray<GenericArray<u8, U16>, U8>;
Expand Down
6 changes: 3 additions & 3 deletions aes/aes-soft/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//!
//! # Usage example
//! ```
//! use aes_soft::block_cipher::generic_array::GenericArray;
//! use aes_soft::block_cipher::{BlockCipher, NewBlockCipher};
//! use aes_soft::cipher::generic_array::GenericArray;
//! use aes_soft::cipher::{BlockCipher, NewBlockCipher};
//! use aes_soft::Aes128;
//!
//! let key = GenericArray::from_slice(&[0u8; 16]);
Expand Down Expand Up @@ -41,7 +41,7 @@
#![deny(unsafe_code)]
#![warn(missing_docs, rust_2018_idioms)]

pub use block_cipher;
pub use cipher;

mod bitslice;
mod consts;
Expand Down
6 changes: 3 additions & 3 deletions aes/aes-soft/tests/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Test vectors are from NESSIE:
//! https://www.cosic.esat.kuleuven.be/nessie/testvectors/

block_cipher::new_test!(aes128_test, "aes128", aes_soft::Aes128);
block_cipher::new_test!(aes192_test, "aes192", aes_soft::Aes192);
block_cipher::new_test!(aes256_test, "aes256", aes_soft::Aes256);
cipher::new_test!(aes128_test, "aes128", aes_soft::Aes128);
cipher::new_test!(aes192_test, "aes192", aes_soft::Aes192);
cipher::new_test!(aes256_test, "aes256", aes_soft::Aes256);
10 changes: 4 additions & 6 deletions aes/aesni/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aesni"
version = "0.9.0"
version = "0.10.0-pre"
description = "AES (Rijndael) block ciphers implementation using AES-NI"
authors = ["RustCrypto Developers"]
license = "MIT OR Apache-2.0"
Expand All @@ -11,17 +11,15 @@ keywords = ["crypto", "aes", "rijndael", "block-cipher"]
categories = ["cryptography", "no-std"]

[dependencies]
block-cipher = "0.8"
cipher = "0.2"
opaque-debug = "0.3"
stream-cipher = { version = "0.7", optional = true, features = ["block-cipher"] }

[dev-dependencies]
block-cipher = { version = "0.8", features = ["dev"] }
stream-cipher = { version = "0.7", features = ["dev"] }
cipher = { version = "0.2", features = ["dev"] }

[features]
default = ["ctr"]
ctr = ["stream-cipher"]
ctr = []
nocheck = []

[package.metadata.docs.rs]
Expand Down
Loading