Remove unneeded enum from VectorShiftLeftVectorShiftRight

pull/703/head
Jeffrey Walton 2018-08-08 20:17:14 -04:00
parent 00e7d02a8a
commit 0464641069
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 10 additions and 10 deletions

View File

@ -169,13 +169,13 @@ template <unsigned int C, class T>
inline T VectorShiftLeft(const T& vec) inline T VectorShiftLeft(const T& vec)
{ {
#if CRYPTOPP_BIG_ENDIAN #if CRYPTOPP_BIG_ENDIAN
enum { R=(C)&0xf, S=R }; enum { R=(C)&0xf };
const T zero = {0}; const T zero = {0};
return (T)vec_sld((uint8x16_p)vec, (uint8x16_p)zero, S); return (T)vec_sld((uint8x16_p)vec, (uint8x16_p)zero, R);
#else #else
enum { R=(16-C)&0xf, S=R }; enum { R=(16-C)&0xf };
const T zero = {0}; const T zero = {0};
return (T)vec_sld((uint8x16_p)zero, (uint8x16_p)vec, S); return (T)vec_sld((uint8x16_p)zero, (uint8x16_p)vec, R);
#endif #endif
} }
@ -225,13 +225,13 @@ template <unsigned int C, class T>
inline T VectorShiftRight(const T& vec) inline T VectorShiftRight(const T& vec)
{ {
#if CRYPTOPP_BIG_ENDIAN #if CRYPTOPP_BIG_ENDIAN
enum { R=(16-C)&0xf, S=R }; enum { R=(16-C)&0xf };
const T zero = {0}; const T zero = {0};
return (T)vec_sld((uint8x16_p)zero, (uint8x16_p)vec, S); return (T)vec_sld((uint8x16_p)zero, (uint8x16_p)vec, R);
#else #else
enum { R=(C)&0xf, S=R }; enum { R=(C)&0xf };
const T zero = {0}; const T zero = {0};
return (T)vec_sld((uint8x16_p)vec, (uint8x16_p)zero, S); return (T)vec_sld((uint8x16_p)vec, (uint8x16_p)zero, R);
#endif #endif
} }
@ -500,7 +500,7 @@ inline uint32x4_p VectorLoadBE(const uint8_t src[16])
#if defined(CRYPTOPP_BIG_ENDIAN) #if defined(CRYPTOPP_BIG_ENDIAN)
return (uint32x4_p)VectorLoad(src); return (uint32x4_p)VectorLoad(src);
#else #else
return (uint32x4_p)Reverse(VectorLoad(src)); return (uint32x4_p)Reverse(VectorLoad(src));
#endif #endif
} }
@ -541,7 +541,7 @@ inline void VectorStoreBE(const T& src, uint8_t dest[16])
#if defined(CRYPTOPP_BIG_ENDIAN) #if defined(CRYPTOPP_BIG_ENDIAN)
VectorStore(src, dest); VectorStore(src, dest);
#else #else
VectorStore(Reverse(src), dest); VectorStore(Reverse(src), dest);
#endif #endif
} }