aboutsummaryrefslogtreecommitdiffstats
path: root/src/hash/tiger
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-12 23:29:55 +0000
committerlloyd <[email protected]>2010-10-12 23:29:55 +0000
commit2af9ba577730f071eef44b3ba492c3bfad0a8ec6 (patch)
tree92a4c4e973756225d42bb99a99110b2669be7299 /src/hash/tiger
parent97e8d6086171772cd5e45bcf2f5b1ea1e38e6bf5 (diff)
Use size_t for BufferedComputation::add_data
Diffstat (limited to 'src/hash/tiger')
-rw-r--r--src/hash/tiger/tiger.cpp12
-rw-r--r--src/hash/tiger/tiger.h6
2 files changed, 9 insertions, 9 deletions
diff --git a/src/hash/tiger/tiger.cpp b/src/hash/tiger/tiger.cpp
index 9d3e2cbe4..fa5effd80 100644
--- a/src/hash/tiger/tiger.cpp
+++ b/src/hash/tiger/tiger.cpp
@@ -43,11 +43,11 @@ inline void mix(MemoryRegion<u64bit>& X)
/*
* Tiger Compression Function
*/
-void Tiger::compress_n(const byte input[], u32bit blocks)
+void Tiger::compress_n(const byte input[], size_t blocks)
{
u64bit A = digest[0], B = digest[1], C = digest[2];
- for(u32bit i = 0; i != blocks; ++i)
+ for(size_t i = 0; i != blocks; ++i)
{
load_le(&X[0], input, X.size());
@@ -55,7 +55,7 @@ void Tiger::compress_n(const byte input[], u32bit blocks)
pass(C, A, B, X, 7); mix(X);
pass(B, C, A, X, 9);
- for(u32bit j = 3; j != PASS; ++j)
+ for(size_t j = 3; j != PASS; ++j)
{
mix(X);
pass(A, B, C, X, 9);
@@ -75,8 +75,8 @@ void Tiger::compress_n(const byte input[], u32bit blocks)
*/
void Tiger::copy_out(byte output[])
{
- for(u32bit j = 0; j != OUTPUT_LENGTH; ++j)
- output[j] = get_byte(7 - (j % 8), digest[j/8]);
+ for(size_t i = 0; i != OUTPUT_LENGTH; ++i)
+ output[i] = get_byte(7 - (i % 8), digest[i/8]);
}
/*
@@ -166,7 +166,7 @@ std::string Tiger::name() const
/*
* Tiger Constructor
*/
-Tiger::Tiger(u32bit hashlen, u32bit pass) :
+Tiger::Tiger(size_t hashlen, size_t pass) :
MDx_HashFunction(hashlen, 64, false, false),
X(8),
digest(3),
diff --git a/src/hash/tiger/tiger.h b/src/hash/tiger/tiger.h
index 4b8a99344..7305ddb46 100644
--- a/src/hash/tiger/tiger.h
+++ b/src/hash/tiger/tiger.h
@@ -30,9 +30,9 @@ class BOTAN_DLL Tiger : public MDx_HashFunction
* @param out_size specifies the output length; can be 16, 20, or 24
* @param passes to make in the algorithm
*/
- Tiger(u32bit out_size = 24, u32bit passes = 3);
+ Tiger(size_t out_size = 24, size_t passes = 3);
private:
- void compress_n(const byte[], u32bit block);
+ void compress_n(const byte[], size_t block);
void copy_out(byte[]);
static void pass(u64bit& A, u64bit& B, u64bit& C,
@@ -45,7 +45,7 @@ class BOTAN_DLL Tiger : public MDx_HashFunction
static const u64bit SBOX4[256];
SecureVector<u64bit> X, digest;
- const u32bit PASS;
+ const size_t PASS;
};
}