use built-in left rotation for expansion

This commit is contained in:
mos 2024-12-20 13:15:45 +01:00
parent a4f2fc552c
commit 36ee586323
2 changed files with 2 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

View File

@ -56,7 +56,7 @@ impl AesCipher {
for i in (nwords..4 * (rounds + 1)).step_by(nwords) { for i in (nwords..4 * (rounds + 1)).step_by(nwords) {
exp[i] = exp[i - 1]; exp[i] = exp[i - 1];
exp[i] = rotl!(exp[i], 1); exp[i] = exp[i].rotate_left(1);
exp[i] = Self::sub_sbox(exp[i], &SBOX); exp[i] = Self::sub_sbox(exp[i], &SBOX);
exp[i] ^= (RCON[i / nwords - 1] as u32) << 24; exp[i] ^= (RCON[i / nwords - 1] as u32) << 24;
exp[i] ^= exp[i - nwords]; exp[i] ^= exp[i - nwords];