Skip to main content

aes/backends/fixslice/
mod.rs

1//! Fixsliced implementations of AES-128, AES-192 and AES-256 (64-bit)
2//! adapted from the C implementation.
3//!
4//! All implementations are fully bitsliced and do not rely on any
5//! Look-Up Table (LUT).
6//!
7//! See the paper at <https://eprint.iacr.org/2020/1123.pdf> for more details.
8//!
9//! # Author (original C code)
10//!
11//! Alexandre Adomnicai, Nanyang Technological University, Singapore
12//! <[email protected]>
13//!
14//! Originally licensed MIT. Relicensed as Apache 2.0+MIT with permission.
15
16use cipher::array::Array;
17
18pub(super) mod aes128;
19pub(super) mod aes192;
20pub(super) mod aes256;
21#[cfg(feature = "hazmat")]
22pub(crate) mod hazmat;
23
24mod mix_columns;
25mod sbox;
26mod utils;
27mod word;
28
29use word::Word;
30
31type State<W> = [W; 8];
32
33cpubits::cpubits! {
34    16 | 32 => {
35        pub(super) type NativeWord = u32;
36    }
37    64 => {
38        pub(super) type NativeWord = u64;
39    }
40}
41
42pub(super) type NativeBatchSize = <NativeWord as Word>::Blocks;
43pub(super) type BatchBlocks<W> = Array<crate::Block, <W as Word>::Blocks>;