diff --git a/adv-simd.h b/adv-simd.h index 46458fa2..61c3465a 100644 --- a/adv-simd.h +++ b/adv-simd.h @@ -1811,7 +1811,7 @@ inline size_t AdvancedProcessBlocks64_6x2_ALTIVEC(F2 func2, F6 func6, const uint32x4_p s_one = {1,0,0,0}; const uint32x4_p s_two = {2,0,2,0}; #else - enum {LowOffset=0, HighOffset=8}; + enum {LowOffset=8, HighOffset=0}; const uint32x4_p s_one = {0,0,0,1}; const uint32x4_p s_two = {0,2,0,2}; #endif diff --git a/speck-simd.cpp b/speck-simd.cpp index 03145de0..f1fca163 100644 --- a/speck-simd.cpp +++ b/speck-simd.cpp @@ -897,8 +897,8 @@ void SPECK64_Enc_Block(uint32x4_p &block0, uint32x4_p &block1, } #if defined(CRYPTOPP_BIG_ENDIAN) - const uint8x16_p m3 = {19,18,17,16, 3,2,1,0, 23,22,21,20, 7,6,5,4}; - const uint8x16_p m4 = {27,26,25,24, 11,10,9,8, 31,30,29,28, 15,14,13,12}; + const uint8x16_p m3 = {11,10,9,8, 27,26,25,24, 15,14,13,12, 31,30,29,28}; + const uint8x16_p m4 = {3,2,1,0, 19,18,17,16, 7,6,5,4, 23,22,21,20}; #else const uint8x16_p m3 = {3,2,1,0, 19,18,17,16, 7,6,5,4, 23,22,21,20}; const uint8x16_p m4 = {11,10,9,8, 27,26,25,24, 15,14,13,12, 31,30,29,28}; @@ -937,8 +937,8 @@ void SPECK64_Dec_Block(uint32x4_p &block0, uint32x4_p &block1, } #if defined(CRYPTOPP_BIG_ENDIAN) - const uint8x16_p m3 = {19,18,17,16, 3,2,1,0, 23,22,21,20, 7,6,5,4}; - const uint8x16_p m4 = {27,26,25,24, 11,10,9,8, 31,30,29,28, 15,14,13,12}; + const uint8x16_p m3 = {11,10,9,8, 27,26,25,24, 15,14,13,12, 31,30,29,28}; + const uint8x16_p m4 = {3,2,1,0, 19,18,17,16, 7,6,5,4, 23,22,21,20}; #else const uint8x16_p m3 = {3,2,1,0, 19,18,17,16, 7,6,5,4, 23,22,21,20}; const uint8x16_p m4 = {11,10,9,8, 27,26,25,24, 15,14,13,12, 31,30,29,28}; @@ -995,8 +995,8 @@ void SPECK64_Enc_6_Blocks(uint32x4_p &block0, uint32x4_p &block1, } #if defined(CRYPTOPP_BIG_ENDIAN) - const uint8x16_p m3 = {19,18,17,16, 3,2,1,0, 23,22,21,20, 7,6,5,4}; - const uint8x16_p m4 = {27,26,25,24, 11,10,9,8, 31,30,29,28, 15,14,13,12}; + const uint8x16_p m3 = {11,10,9,8, 27,26,25,24, 15,14,13,12, 31,30,29,28}; + const uint8x16_p m4 = {3,2,1,0, 19,18,17,16, 7,6,5,4, 23,22,21,20}; #else const uint8x16_p m3 = {3,2,1,0, 19,18,17,16, 7,6,5,4, 23,22,21,20}; const uint8x16_p m4 = {11,10,9,8, 27,26,25,24, 15,14,13,12, 31,30,29,28}; @@ -1057,8 +1057,8 @@ void SPECK64_Dec_6_Blocks(uint32x4_p &block0, uint32x4_p &block1, } #if defined(CRYPTOPP_BIG_ENDIAN) - const uint8x16_p m3 = {19,18,17,16, 3,2,1,0, 23,22,21,20, 7,6,5,4}; - const uint8x16_p m4 = {27,26,25,24, 11,10,9,8, 31,30,29,28, 15,14,13,12}; + const uint8x16_p m3 = {11,10,9,8, 27,26,25,24, 15,14,13,12, 31,30,29,28}; + const uint8x16_p m4 = {3,2,1,0, 19,18,17,16, 7,6,5,4, 23,22,21,20}; #else const uint8x16_p m3 = {3,2,1,0, 19,18,17,16, 7,6,5,4, 23,22,21,20}; const uint8x16_p m4 = {11,10,9,8, 27,26,25,24, 15,14,13,12, 31,30,29,28};