From 09c8ae2835352e739f9fa4ec51eb3a8100499ed0 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 23 Jun 2018 12:58:55 -0400 Subject: [PATCH] Use inline for LEA_Encryption and LEA_Decryption --- adv-simd.h | 7 +++---- lea-simd.cpp | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/adv-simd.h b/adv-simd.h index 1cbd67ae..24e01e20 100644 --- a/adv-simd.h +++ b/adv-simd.h @@ -43,10 +43,9 @@ # include #endif -#if (CRYPTOPP_SSSE3_AVAILABLE) -# include -# include -# include +#if (CRYPTOPP_SSE2_INTRIN_AVAILABLE) +# include +# include #endif #if defined(CRYPTOPP_ALTIVEC_AVAILABLE) diff --git a/lea-simd.cpp b/lea-simd.cpp index ac43bdf7..a43b719a 100644 --- a/lea-simd.cpp +++ b/lea-simd.cpp @@ -255,7 +255,7 @@ inline uint32x4_t RepackNEON(const uint32x4_t& v) return UnpackNEON(v); } -void LEA_Encryption(uint32x4_t temp[4], const word32 *subkeys, unsigned int rounds) +inline void LEA_Encryption(uint32x4_t temp[4], const word32 *subkeys, unsigned int rounds) { temp[3] = RotateRight<3>(Add(Xor(temp[2], LoadKey<4>(subkeys)), Xor(temp[3], LoadKey<5>(subkeys)))); temp[2] = RotateRight<5>(Add(Xor(temp[1], LoadKey<2>(subkeys)), Xor(temp[2], LoadKey<3>(subkeys)))); @@ -368,7 +368,7 @@ void LEA_Encryption(uint32x4_t temp[4], const word32 *subkeys, unsigned int roun } } -void LEA_Decryption(uint32x4_t temp[4], const word32 *subkeys, unsigned int rounds) +inline void LEA_Decryption(uint32x4_t temp[4], const word32 *subkeys, unsigned int rounds) { if(rounds > 28) {