aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2020-05-06 04:32:05 -0400
committerJack Lloyd <[email protected]>2020-05-06 04:32:05 -0400
commit6490b10a7ac691a3455b6c66c3adfe865cfd2f7f (patch)
tree40cbbcba8b0e442c1ed15818a1495fd609e6a634
parente47ddaff1910069c0d3e2ce6dc8276e843dda76a (diff)
Faster InvMixColumn
-rw-r--r--src/lib/block/aes/aes.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/lib/block/aes/aes.cpp b/src/lib/block/aes/aes.cpp
index 93b17e528..1e7103582 100644
--- a/src/lib/block/aes/aes.cpp
+++ b/src/lib/block/aes/aes.cpp
@@ -593,12 +593,7 @@ void inv_mix_columns(uint32_t B[8])
const uint32_t X13 = X9 ^ X4[i];
const uint32_t X14 = X8[i] ^ X4[i] ^ X2[i];
- uint8_t b0 = get_byte(0, X14) ^ get_byte(1, X11) ^ get_byte(2, X13) ^ get_byte(3, X9);
- uint8_t b1 = get_byte(0, X9) ^ get_byte(1, X14) ^ get_byte(2, X11) ^ get_byte(3, X13);
- uint8_t b2 = get_byte(0, X13) ^ get_byte(1, X9) ^ get_byte(2, X14) ^ get_byte(3, X11);
- uint8_t b3 = get_byte(0, X11) ^ get_byte(1, X13) ^ get_byte(2, X9) ^ get_byte(3, X14);
-
- B[i] = make_uint32(b0, b1, b2, b3);
+ B[i] = X14 ^ rotr<8>(X9) ^ rotr<24>(X11) ^ rotr<16>(X13);
}
}