Skip to content

Commit 4417227

Browse files
committed
aes: move Block8 to the hazmat module
1 parent b13fe20 commit 4417227

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

aes/src/armv8/hazmat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! implementations in this crate, but instead provides raw AES-NI accelerated
55
//! access to the AES round function gated under the `hazmat` crate feature.
66
7-
use crate::{Block, Block8};
7+
use crate::hazmat::{Block, Block8};
88
use core::arch::aarch64::*;
99

1010
/// AES cipher (encrypt) round function.

aes/src/hazmat.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
//! We do NOT recommend using it to implement any algorithm which has not
1212
//! received extensive peer review by cryptographers.
1313
14-
use crate::{soft::fixslice::hazmat as soft, Block, Block8};
14+
use crate::soft::fixslice::hazmat as soft;
15+
16+
pub use crate::Block;
17+
/// Eight 128-bit AES blocks
18+
pub type Block8 = cipher::array::Array<Block, cipher::consts::U8>;
1519

1620
#[cfg(all(target_arch = "aarch64", not(aes_force_soft)))]
1721
use crate::armv8::hazmat as intrinsics;

aes/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,11 @@ cfg_if! {
145145
pub use cipher;
146146
use cipher::{
147147
array::Array,
148-
consts::{U16, U8},
148+
consts::U16,
149149
};
150150

151151
/// 128-bit AES block
152152
pub type Block = Array<u8, U16>;
153-
/// Eight 128-bit AES blocks
154-
pub type Block8 = Array<Block, U8>;
155153

156154
#[cfg(test)]
157155
mod tests {

aes/src/ni/hazmat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! access to the AES round function gated under the `hazmat` crate feature.
66
77
use super::arch::*;
8-
use crate::{Block, Block8};
8+
use crate::hazmat::{Block, Block8};
99
use cipher::array::{Array, ArraySize};
1010

1111
#[target_feature(enable = "sse2")]

aes/src/soft/fixslice32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ pub(crate) mod hazmat {
13771377
bitslice, inv_bitslice, inv_mix_columns_0, inv_shift_rows_1, inv_sub_bytes, mix_columns_0,
13781378
shift_rows_1, sub_bytes, sub_bytes_nots, State,
13791379
};
1380-
use crate::{Block, Block8};
1380+
use crate::hazmat::{Block, Block8};
13811381

13821382
/// XOR the `src` block into the `dst` block in-place.
13831383
fn xor_in_place(dst: &mut Block, src: &Block) {

aes/src/soft/fixslice64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,7 @@ pub(crate) mod hazmat {
14321432
bitslice, inv_bitslice, inv_mix_columns_0, inv_shift_rows_1, inv_sub_bytes, mix_columns_0,
14331433
shift_rows_1, sub_bytes, sub_bytes_nots, State,
14341434
};
1435-
use crate::{Block, Block8};
1435+
use crate::hazmat::{Block, Block8};
14361436

14371437
/// XOR the `src` block into the `dst` block in-place.
14381438
fn xor_in_place(dst: &mut Block, src: &Block) {

aes/tests/hazmat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// TODO(tarcieri): support for using the hazmat functions with the `soft` backend
44
#![cfg(feature = "hazmat")]
55

6-
use aes::{Block, Block8};
6+
use aes::hazmat::{Block, Block8};
77
use hex_literal::hex;
88

99
/// Round function tests vectors.

0 commit comments

Comments
 (0)