summaryrefslogtreecommitdiff
path: root/aria.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-11-09 11:56:47 -0500
committerJeffrey Walton <noloader@gmail.com>2018-11-09 11:56:47 -0500
commit656be82a8fd798d5242e553ced508760b215288b (patch)
tree799c2731f23af998231e9794103c6747777f9630 /aria.cpp
parentca9d0f10f6baa115b2b974057af39c175fba2cc7 (diff)
downloadcryptopp-git-656be82a8fd798d5242e553ced508760b215288b.tar.gz
Cleanup ARIA SSE and NEON code
Diffstat (limited to 'aria.cpp')
-rw-r--r--aria.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/aria.cpp b/aria.cpp
index 52cc2eb2..8f3f221a 100644
--- a/aria.cpp
+++ b/aria.cpp
@@ -85,11 +85,11 @@ inline byte ARIA_BRF(const word32 x, const int y) {
#if (CRYPTOPP_ARM_NEON_AVAILABLE)
extern void ARIA_UncheckedSetKey_Schedule_NEON(byte* rk, word32* ws, unsigned int keylen);
-extern void ARIA_ProcessAndXorBlock_Xor_NEON(const byte* xorBlock, byte* outblock);
+extern void ARIA_ProcessAndXorBlock_NEON(const byte* xorBlock, byte* outblock, const byte *rk, word32 *t);
#endif
#if (CRYPTOPP_SSSE3_AVAILABLE)
-extern void ARIA_ProcessAndXorBlock_Xor_SSSE3(const byte* xorBlock, byte* outBlock, const byte *rk, word32 *t);
+extern void ARIA_ProcessAndXorBlock_SSSE3(const byte* xorBlock, byte* outBlock, const byte *rk, word32 *t);
#endif
// n-bit right shift of Y XORed to X
@@ -283,12 +283,19 @@ void ARIA::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, b
#if CRYPTOPP_ENABLE_ARIA_SSSE3_INTRINSICS
if (HasSSSE3())
{
- ARIA_ProcessAndXorBlock_Xor_SSSE3(xorBlock, outBlock, rk, t);
+ ARIA_ProcessAndXorBlock_SSSE3(xorBlock, outBlock, rk, t);
return;
}
else
#endif // CRYPTOPP_ENABLE_ARIA_SSSE3_INTRINSICS
-
+#if (CRYPTOPP_ARM_NEON_AVAILABLE)
+ if (HasNEON())
+ {
+ ARIA_ProcessAndXorBlock_NEON(xorBlock, outBlock, rk, t);
+ return;
+ }
+ else
+#endif // CRYPTOPP_ARM_NEON_AVAILABLE
#if (CRYPTOPP_LITTLE_ENDIAN)
{
outBlock[ 0] = (byte)(X1[ARIA_BRF(t[0],3)] ) ^ rk[ 3];
@@ -329,19 +336,9 @@ void ARIA::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, b
}
#endif // CRYPTOPP_LITTLE_ENDIAN
-#if CRYPTOPP_ARM_NEON_AVAILABLE
- if (HasNEON())
- {
- if (xorBlock != NULLPTR)
- ARIA_ProcessAndXorBlock_Xor_NEON(xorBlock, outBlock);
- }
- else
-#endif // CRYPTOPP_ARM_NEON_AVAILABLE
- {
- if (xorBlock != NULLPTR)
- for (unsigned int n=0; n<ARIA::BLOCKSIZE; ++n)
- outBlock[n] ^= xorBlock[n];
- }
+ if (xorBlock != NULLPTR)
+ for (unsigned int n=0; n<ARIA::BLOCKSIZE; ++n)
+ outBlock[n] ^= xorBlock[n];
}
NAMESPACE_END