From 643348f7590bcd041f13282d70f6d656df492c7f Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 22 Apr 2021 13:07:54 -0400 Subject: [PATCH] Update LSH --- lsh256.cpp | 2 +- lsh512.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lsh256.cpp b/lsh256.cpp index 4335b29e..0d296c1a 100644 --- a/lsh256.cpp +++ b/lsh256.cpp @@ -871,8 +871,8 @@ inline void zero_submsgs(LSH256_Context* ctx) #if defined(CRYPTOPP_LSH256_AVX_AVAILABLE) _mm256_storeu_si256(M256_CAST(sub_msgs+ 0), _mm256_setzero_si256()); _mm256_storeu_si256(M256_CAST(sub_msgs+ 8), _mm256_setzero_si256()); - _mm256_storeu_si256(M256_CAST(sub_msgs+12), _mm256_setzero_si256()); _mm256_storeu_si256(M256_CAST(sub_msgs+16), _mm256_setzero_si256()); + _mm256_storeu_si256(M256_CAST(sub_msgs+24), _mm256_setzero_si256()); #elif defined(CRYPTOPP_LSH256_SSE2_AVAILABLE) _mm_storeu_si128(M128_CAST(sub_msgs+ 0), _mm_setzero_si128()); diff --git a/lsh512.cpp b/lsh512.cpp index 4c563e51..2cec0bc7 100644 --- a/lsh512.cpp +++ b/lsh512.cpp @@ -145,7 +145,7 @@ const unsigned int LSH512_HASH_VAL_MAX_BYTE_LEN = 64; // const unsigned int MSG_BLK_WORD_LEN = 32; const unsigned int CV_WORD_LEN = 16; -// const unsigned int CONST_WORD_LEN = 8; +const unsigned int CONST_WORD_LEN = 8; const unsigned int HASH_VAL_MAX_WORD_LEN = 8; const unsigned int NUM_STEPS = 28; @@ -244,7 +244,7 @@ MAYBE_CONSTEXPR lsh_uint g_gamma512[8] = { 0, 16, 32, 48, 8, 24, 40, 56 }; * LSH: step constants * -------------------------------------------------------- */ -MAYBE_CONSTEXPR lsh_u64 g_StepConstants[16 * NUM_STEPS] = { +MAYBE_CONSTEXPR lsh_u64 g_StepConstants[CONST_WORD_LEN * NUM_STEPS] = { W64LIT(0x97884283c938982a), W64LIT(0xba1fca93533e2355), W64LIT(0xc519a2e87aeb1c03), W64LIT(0x9a0fc95462af17b1), W64LIT(0xfc3dda8ab019a82b), W64LIT(0x02825d079a895407), W64LIT(0x79f2d0a7ee06a6f7), W64LIT(0xd76d15eed9fdf5fe), W64LIT(0x1fcac64d01d0c2c1), W64LIT(0xd9ea5de69161790f), W64LIT(0xdebc8b6366071fc8), W64LIT(0xa9d91db711c6c94b),