summaryrefslogtreecommitdiff
path: root/lsh256.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2021-04-23 09:46:11 -0400
committerJeffrey Walton <noloader@gmail.com>2021-04-23 09:46:11 -0400
commitdd57c4c7f7507ae50803e41afee6a1217324a958 (patch)
tree5ef0195f51a13af27ffb6d88ab91058fde86ac70 /lsh256.cpp
parent25059ee912936a63f9e59294c3bf1ec9e4e43a88 (diff)
downloadcryptopp-git-dd57c4c7f7507ae50803e41afee6a1217324a958.tar.gz
Cut-in LSH512 AVX2 rotate_msg_gamma
Diffstat (limited to 'lsh256.cpp')
-rw-r--r--lsh256.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lsh256.cpp b/lsh256.cpp
index 24d67247..95fe61e1 100644
--- a/lsh256.cpp
+++ b/lsh256.cpp
@@ -16,11 +16,11 @@
// LLVM Clang 7.0 and above resulted in linker errors. Also see
// https://bugs.llvm.org/show_bug.cgi?id=50025.
-// We are hitting some sort of GCC bug in the AVX2 code path. Clang
-// is OK on the AVX2 code path. When we enable AVX2 for rotate_msg_gamma,
-// msg_exp_even and msg_exp_odd, then GCC arrives at the wrong result.
-// Making any one of the functions SSE2 clears the problem. See
-// CRYPTOPP_WORKAROUND_AVX2_BUG below.
+// We are hitting some sort of GCC bug in the LSH256 AVX2 code path.
+// Clang is OK on the AVX2 code path. When we enable AVX2 for
+// rotate_msg_gamma, msg_exp_even and msg_exp_odd, then GCC arrives
+// at the wrong result. Making any one of the functions SSE2 clears
+// the problem. See CRYPTOPP_WORKAROUND_AVX2_BUG below.
// TODO: cut-over to a *_simd.cpp file for proper runtime dispatching.
@@ -963,7 +963,7 @@ inline void get_hash(LSH256_Context* ctx, lsh_u8* pbHashVal)
lsh_uint hash_val_bit_len = LSH_GET_SMALL_HASHBIT(algtype);
// Multiplying by sizeof(lsh_u8) looks odd...
- memcpy(pbHashVal, ctx->cv_l, sizeof(lsh_u8) * hash_val_byte_len);
+ memcpy(pbHashVal, ctx->cv_l, hash_val_byte_len);
if (hash_val_bit_len){
pbHashVal[hash_val_byte_len-1] &= (((lsh_u8)0xff) << hash_val_bit_len);
}