From 1822ba0d828d2c7bec51313597a9a64a54ccc559 Mon Sep 17 00:00:00 2001 From: lloyd Date: Sat, 18 Jan 2014 19:39:41 +0000 Subject: Fix Skein_512::clear --- src/tests/test_hash.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/tests') diff --git a/src/tests/test_hash.cpp b/src/tests/test_hash.cpp index eaa3ff3b5..cd0fb785b 100644 --- a/src/tests/test_hash.cpp +++ b/src/tests/test_hash.cpp @@ -36,6 +36,20 @@ size_t hash_test(const std::string& algo, auto h = hash->final(); + if(h != hex_decode_locked(out_hex)) + { + std::cout << algo << " " << provider << " got " << hex_encode(h) << " != " << out_hex << "\n"; + ++fails; + } + + // Test to make sure clear() resets what we need it to + hash->update("some discarded input"); + hash->clear(); + + hash->update(hex_decode(in_hex)); + + h = hash->final(); + if(h != hex_decode_locked(out_hex)) { std::cout << algo << " " << provider << " got " << hex_encode(h) << " != " << out_hex << "\n"; -- cgit v1.2.3