From fd5007c126829324ddbaa3bfabc8250704f07b91 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Thu, 31 Mar 2016 16:19:29 -0600 Subject: [PATCH] Create new hasher for sha256() utility. --- src/zerocash/utils/util.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/zerocash/utils/util.cpp b/src/zerocash/utils/util.cpp index 2f571df5..1c303ea7 100644 --- a/src/zerocash/utils/util.cpp +++ b/src/zerocash/utils/util.cpp @@ -209,8 +209,11 @@ void sha256(const unsigned char* input, unsigned char* hash, int len) { } void sha256(CSHA256& hasher, const unsigned char* input, unsigned char* hash, int len) { - hasher.Write(input, len); - hasher.FinalizeNoPadding(hash); + // Ignore the one that's passed in; this optimization is useless + // for all of our code, and this code is all being removed anyway. + CSHA256 new_hasher; + new_hasher.Write(input, len); + new_hasher.FinalizeNoPadding(hash); } void hashVector(CSHA256& hasher, const std::vector input, std::vector& output) {