From e43c0eee74d6e50d53aca8f95ac8638f975a792d Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 21 Sep 2017 19:17:42 -0400 Subject: [PATCH] Fold ConditionalByteReverse for non-Power8 paths --- rijndael-simd.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rijndael-simd.cpp b/rijndael-simd.cpp index 6fba8aac..3c61f99a 100644 --- a/rijndael-simd.cpp +++ b/rijndael-simd.cpp @@ -1160,9 +1160,7 @@ void Rijndael_UncheckedSetKey_POWER8(const byte* userKey, size_t keyLen, word32* } rk = rk_saved; - ConditionalByteReverse(BIG_ENDIAN_ORDER, rk, rk, 16); - ConditionalByteReverse(BIG_ENDIAN_ORDER, rk + rounds*4, rk + rounds*4, 16); - ConditionalByteReverse(BIG_ENDIAN_ORDER, rk+4, rk+4, (rounds-1)*16); + ConditionalByteReverse(BIG_ENDIAN_ORDER, rk, rk, (rounds+1)*16); #if defined(IS_LITTLE_ENDIAN) // VSX registers are big-endian. The entire subkey table must be byte