From 96ee81fa3f6d527fd4d158fb835515e7b8ceb019 Mon Sep 17 00:00:00 2001 From: Anthony Donlon <4056887+donlon@users.noreply.github.com> Date: Fri, 1 Sep 2023 01:42:37 +0800 Subject: [PATCH] Fix unstable output of VHashSha256 (#4453) --- src/V3String.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/V3String.cpp b/src/V3String.cpp index 9c1365c60..5ed5279e1 100644 --- a/src/V3String.cpp +++ b/src/V3String.cpp @@ -237,9 +237,8 @@ static void sha256Block(uint32_t* h, const uint32_t* chunk) VL_PURE { // Initialize working variables to current hash value for (unsigned i = 0; i < 8; i++) ah[i] = h[i]; // Compression function main loop + uint32_t w[16] = {}; for (unsigned i = 0; i < 4; ++i) { - uint32_t w[16]; - for (unsigned j = 0; j < 16; ++j) { if (i == 0) { w[j] = *p++;