diff options
author | lloyd <[email protected]> | 2014-01-18 19:39:41 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-01-18 19:39:41 +0000 |
commit | 1822ba0d828d2c7bec51313597a9a64a54ccc559 (patch) | |
tree | aa6470016e5c5f5c8684a2c7fd0f06b37186c15b /src/tests | |
parent | b96ad4c05c0a8f835b54ef4e2cff849c749409b0 (diff) |
Fix Skein_512::clear
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/test_hash.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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 @@ -41,6 +41,20 @@ size_t hash_test(const std::string& algo, 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"; + ++fails; + } } return fails; |