aboutsummaryrefslogtreecommitdiffstats
path: root/src/hash/tiger
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-29 13:51:27 +0000
committerlloyd <[email protected]>2010-10-29 13:51:27 +0000
commit633175a57a03ed9bf5a5e3577bfc26068c62b688 (patch)
tree086eb3a931d39fb35f8a3896a25a5cb38736a696 /src/hash/tiger
parentdf0dfeb904485bacb8034d0468b4498130939acc (diff)
Remove BufferedComputation::OUTPUT_LENGTH
Diffstat (limited to 'src/hash/tiger')
-rw-r--r--src/hash/tiger/tiger.cpp16
-rw-r--r--src/hash/tiger/tiger.h8
2 files changed, 14 insertions, 10 deletions
diff --git a/src/hash/tiger/tiger.cpp b/src/hash/tiger/tiger.cpp
index 7f95267aa..6f40f84c8 100644
--- a/src/hash/tiger/tiger.cpp
+++ b/src/hash/tiger/tiger.cpp
@@ -55,7 +55,7 @@ void Tiger::compress_n(const byte input[], size_t blocks)
pass(C, A, B, X, 7); mix(X);
pass(B, C, A, X, 9);
- for(size_t j = 3; j != PASS; ++j)
+ for(size_t j = 3; j != passes; ++j)
{
mix(X);
pass(A, B, C, X, 9);
@@ -160,24 +160,26 @@ void Tiger::clear()
*/
std::string Tiger::name() const
{
- return "Tiger(" + to_string(output_length()) + "," + to_string(PASS) + ")";
+ return "Tiger(" + to_string(output_length()) + "," + to_string(passes) + ")";
}
/*
* Tiger Constructor
*/
-Tiger::Tiger(size_t hashlen, size_t pass) :
- MDx_HashFunction(hashlen, 64, false, false),
+Tiger::Tiger(size_t hash_len, size_t passes) :
+ MDx_HashFunction(64, false, false),
X(8),
digest(3),
- PASS(pass)
+ hash_len(hash_len),
+ passes(passes)
{
if(output_length() != 16 && output_length() != 20 && output_length() != 24)
throw Invalid_Argument("Tiger: Illegal hash output size: " +
to_string(output_length()));
- if(PASS < 3)
+
+ if(passes < 3)
throw Invalid_Argument("Tiger: Invalid number of passes: "
- + to_string(PASS));
+ + to_string(passes));
clear();
}
diff --git a/src/hash/tiger/tiger.h b/src/hash/tiger/tiger.h
index 7d753c237..09c9947fb 100644
--- a/src/hash/tiger/tiger.h
+++ b/src/hash/tiger/tiger.h
@@ -18,14 +18,16 @@ namespace Botan {
class BOTAN_DLL Tiger : public MDx_HashFunction
{
public:
- void clear();
std::string name() const;
+ size_t output_length() const { return hash_len; }
HashFunction* clone() const
{
- return new Tiger(output_length(), PASS);
+ return new Tiger(output_length(), passes);
}
+ void clear();
+
/**
* @param out_size specifies the output length; can be 16, 20, or 24
* @param passes to make in the algorithm
@@ -45,7 +47,7 @@ class BOTAN_DLL Tiger : public MDx_HashFunction
static const u64bit SBOX4[256];
SecureVector<u64bit> X, digest;
- const size_t PASS;
+ const size_t hash_len, passes;
};
}