aboutsummaryrefslogtreecommitdiffstats
path: root/src/hash/bmw
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/bmw
parent97e8d6086171772cd5e45bcf2f5b1ea1e38e6bf5 (diff)
Use size_t for BufferedComputation::add_data
Diffstat (limited to 'src/hash/bmw')
-rw-r--r--src/hash/bmw/bmw_512.cpp14
-rw-r--r--src/hash/bmw/bmw_512.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/hash/bmw/bmw_512.cpp b/src/hash/bmw/bmw_512.cpp
index cfa0eee2c..a69d23bff 100644
--- a/src/hash/bmw/bmw_512.cpp
+++ b/src/hash/bmw/bmw_512.cpp
@@ -43,9 +43,9 @@ inline u64bit S4(u64bit X)
*/
void BMW_512_compress(u64bit H[16], const u64bit M[16], u64bit Q[32])
{
- const u32bit EXPAND_1_ROUNDS = 2;
+ const size_t EXPAND_1_ROUNDS = 2;
- for(u32bit i = 0; i != 16; ++i)
+ for(size_t i = 0; i != 16; ++i)
Q[i] = H[i] ^ M[i];
Q[16] = Q[ 5] - Q[ 7] + Q[10] + Q[13] + Q[14];
@@ -82,7 +82,7 @@ void BMW_512_compress(u64bit H[16], const u64bit M[16], u64bit Q[32])
Q[14] = S4(Q[30]) + H[15];
Q[15] = S0(Q[31]) + H[ 0];
- for(u32bit i = 16; i != 16 + EXPAND_1_ROUNDS; ++i)
+ for(size_t i = 16; i != 16 + EXPAND_1_ROUNDS; ++i)
{
Q[i] = S1(Q[i-16]) + S2(Q[i-15]) + S3(Q[i-14]) + S0(Q[i-13]) +
S1(Q[i-12]) + S2(Q[i-11]) + S3(Q[i-10]) + S0(Q[i- 9]) +
@@ -94,7 +94,7 @@ void BMW_512_compress(u64bit H[16], const u64bit M[16], u64bit Q[32])
(0x0555555555555555 * i)) ^ H[(i-16+7)%16]);
}
- for(u32bit i = 16 + EXPAND_1_ROUNDS; i != 32; ++i)
+ for(size_t i = 16 + EXPAND_1_ROUNDS; i != 32; ++i)
{
Q[i] = Q[i-16] + rotate_left(Q[i-15], 5) +
Q[i-14] + rotate_left(Q[i-13], 11) +
@@ -139,9 +139,9 @@ void BMW_512_compress(u64bit H[16], const u64bit M[16], u64bit Q[32])
}
-void BMW_512::compress_n(const byte input[], u32bit blocks)
+void BMW_512::compress_n(const byte input[], size_t blocks)
{
- for(u32bit i = 0; i != blocks; ++i)
+ for(size_t i = 0; i != blocks; ++i)
{
load_le(&M[0], input, M.size());
@@ -168,7 +168,7 @@ void BMW_512::copy_out(byte output[])
BMW_512_compress(final, &H[0], &Q[0]);
- for(u32bit i = 0; i != OUTPUT_LENGTH; i += 8)
+ for(size_t i = 0; i != OUTPUT_LENGTH; i += 8)
store_le(final[8 + i/8], output + i);
}
diff --git a/src/hash/bmw/bmw_512.h b/src/hash/bmw/bmw_512.h
index b1eaa6874..aa527c142 100644
--- a/src/hash/bmw/bmw_512.h
+++ b/src/hash/bmw/bmw_512.h
@@ -25,7 +25,7 @@ class BOTAN_DLL BMW_512 : public MDx_HashFunction
BMW_512() : MDx_HashFunction(64, 128, false, true), H(16), M(16), Q(32)
{ clear(); }
private:
- void compress_n(const byte input[], u32bit blocks);
+ void compress_n(const byte input[], size_t blocks);
void copy_out(byte output[]);
SecureVector<u64bit> H, M, Q;