use built-in left rotation for expansion
This commit is contained in:
parent
a4f2fc552c
commit
36ee586323
|
@ -0,0 +1 @@
|
||||||
|
/target
|
|
@ -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];
|
||||||
|
|
Loading…
Reference in New Issue