summaryrefslogtreecommitdiff
path: root/chacha_simd.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2020-04-05 09:51:34 -0400
committerJeffrey Walton <noloader@gmail.com>2020-04-05 09:51:34 -0400
commit57ba87bdc9666034dce1a460ecc7b8d00aa1b380 (patch)
tree777f8fb6c3400a9d2de2ca70250784bd98ecb92d /chacha_simd.cpp
parent5017d9c91c853a508f25123a277dd65d60edcf3b (diff)
downloadcryptopp-git-57ba87bdc9666034dce1a460ecc7b8d00aa1b380.tar.gz
Add 64-bit overload for VecLoadAligned
Diffstat (limited to 'chacha_simd.cpp')
-rw-r--r--chacha_simd.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/chacha_simd.cpp b/chacha_simd.cpp
index dabdbe1e..6f15473c 100644
--- a/chacha_simd.cpp
+++ b/chacha_simd.cpp
@@ -223,6 +223,7 @@ inline __m128i RotateLeft<16>(const __m128i val)
using CryptoPP::uint8x16_p;
using CryptoPP::uint32x4_p;
using CryptoPP::VecLoad;
+using CryptoPP::VecLoadAligned;
using CryptoPP::VecStore;
using CryptoPP::VecPermute;
@@ -834,10 +835,10 @@ void ChaCha_OperateKeystream_SSE2(const word32 *state, const byte* input, byte *
// time to better support distros.
inline void ChaCha_OperateKeystream_CORE(const word32 *state, const byte* input, byte *output, unsigned int rounds)
{
- const uint32x4_p state0 = VecLoad(state + 0*4);
- const uint32x4_p state1 = VecLoad(state + 1*4);
- const uint32x4_p state2 = VecLoad(state + 2*4);
- const uint32x4_p state3 = VecLoad(state + 3*4);
+ const uint32x4_p state0 = VecLoadAligned(state + 0*4);
+ const uint32x4_p state1 = VecLoadAligned(state + 1*4);
+ const uint32x4_p state2 = VecLoadAligned(state + 2*4);
+ const uint32x4_p state3 = VecLoadAligned(state + 3*4);
const uint32x4_p CTRS[3] = {
{1,0,0,0}, {2,0,0,0}, {3,0,0,0}