Fix unstable output of VHashSha256 (#4453)

This commit is contained in:
Anthony Donlon 2023-09-01 01:42:37 +08:00 committed by GitHub
parent 3d2399ea0f
commit 96ee81fa3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -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++;