summaryrefslogtreecommitdiff
path: root/examples/hashsmt/sha1.hpp
diff options
context:
space:
mode:
authorDejan Jovanovic <dejan.jovanovic@gmail.com>2014-05-07 23:26:42 -0700
committerDejan Jovanovic <dejan.jovanovic@gmail.com>2014-05-07 23:26:42 -0700
commitfdbc8e0582dfe1addb229d406201a2ec1d513959 (patch)
treeed2c0e8782a88386d1977f53b8b3cbd26ed5d3a4 /examples/hashsmt/sha1.hpp
parent021be18a8d84179966703f07f8f98d2c9193e248 (diff)
Adding encoding of sha1 collision for the hashing example
Diffstat (limited to 'examples/hashsmt/sha1.hpp')
-rw-r--r--examples/hashsmt/sha1.hpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/hashsmt/sha1.hpp b/examples/hashsmt/sha1.hpp
index 0d4bbbf33..f033822c2 100644
--- a/examples/hashsmt/sha1.hpp
+++ b/examples/hashsmt/sha1.hpp
@@ -58,7 +58,7 @@ class sha1
public:
typedef cvc4_uint32(&digest_type)[5];
public:
- sha1();
+ sha1(unsigned rounds = 80);
void reset();
@@ -78,9 +78,12 @@ private:
std::size_t block_byte_index_;
std::size_t byte_count_;
+
+ unsigned rounds_;
};
-inline sha1::sha1()
+inline sha1::sha1(unsigned rounds)
+: rounds_(rounds)
{
reset();
}
@@ -141,7 +144,7 @@ inline void sha1::process_block()
cvc4_uint32 d = h_[3];
cvc4_uint32 e = h_[4];
- for (std::size_t i=0; i<80; ++i) {
+ for (std::size_t i=0; i<rounds_; ++i) {
cvc4_uint32 f;
cvc4_uint32 k;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback