fixslice32.rs
Contains an unbounded block loopSource references XOR syntax
SHA-256d5bfb6e23ab26b35d1559a13ac2f65b7604a56b2ed63b77f3eda841f02148390
MaleculeH(Db₃)
Evidence
1:3… ! Fixsliced implementations of AES-128, AES-192 and AES-256 (32-bit)
2//! adapted from the C implementation
3//!
4//! All implementations are fully bitsliced and do not rely on any
5//! Loo …
14:11… ally licensed MIT. Relicensed as Apache 2.0+MIT with permission.
15
16#![allow(clippy::unreadable_literal)]
17
18use crate::Block;
19use cipher::{
20 consts::{U16, U24, U32},
21 generic_array::GenericArray,
22};
23use core::convert::TryInto;
24
25/// AES block batch size for this implementation
26pub(crate) const FIXSLICE_BLOCKS: usize = 2;
27
28/// AES-128 round keys
29pub(crate) …
97:30… ..], &key[8..]);
98
99 let mut rcon = 0;
100 let mut rk_off = 8;
101
⋯4 lines
126:18… 0x03030303 & (ui >> 6);
127 tmp[i] =
128 ti ^ (0xfcfcfcfc & (ti << 2)) ^ (0xf0f0f0f0 & (ti << 4)) ^ (0xc0c0c0c0 & (ti << 6));
129 }
130 rkeys[rk_off..(rk_off + 8)].co …
958:18… (state: &mut [u32]) {
959 debug_assert_eq!(state.len(), 8);
960 state[0] ^= 0xffffffff;
961 state[1] ^= 0xffffffff;
962 state[5] ^= 0xffffffff;
963 state[6] ^= 0xffffffff;
964}
965
966/// Computation of the MixColumns transformation in the fixsliced representation, with different
967/// rotations used a …