aboutsummaryrefslogtreecommitdiffstats
path: root/src/hash/gost_3411
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/gost_3411
parent97e8d6086171772cd5e45bcf2f5b1ea1e38e6bf5 (diff)
Use size_t for BufferedComputation::add_data
Diffstat (limited to 'src/hash/gost_3411')
-rw-r--r--src/hash/gost_3411/gost_3411.cpp14
-rw-r--r--src/hash/gost_3411/gost_3411.h4
2 files changed, 9 insertions, 9 deletions
diff --git a/src/hash/gost_3411/gost_3411.cpp b/src/hash/gost_3411/gost_3411.cpp
index b460de29c..dbd6335bd 100644
--- a/src/hash/gost_3411/gost_3411.cpp
+++ b/src/hash/gost_3411/gost_3411.cpp
@@ -38,7 +38,7 @@ void GOST_34_11::clear()
/**
* Hash additional inputs
*/
-void GOST_34_11::add_data(const byte input[], u32bit length)
+void GOST_34_11::add_data(const byte input[], size_t length)
{
count += length;
@@ -55,8 +55,8 @@ void GOST_34_11::add_data(const byte input[], u32bit length)
}
}
- const u32bit full_blocks = length / HASH_BLOCK_SIZE;
- const u32bit remaining = length % HASH_BLOCK_SIZE;
+ const size_t full_blocks = length / HASH_BLOCK_SIZE;
+ const size_t remaining = length % HASH_BLOCK_SIZE;
if(full_blocks)
compress_n(input, full_blocks);
@@ -68,11 +68,11 @@ void GOST_34_11::add_data(const byte input[], u32bit length)
/**
* The GOST 34.11 compression function
*/
-void GOST_34_11::compress_n(const byte input[], u32bit blocks)
+void GOST_34_11::compress_n(const byte input[], size_t blocks)
{
- for(u32bit i = 0; i != blocks; ++i)
+ for(size_t i = 0; i != blocks; ++i)
{
- for(u32bit j = 0, carry = 0; j != 32; ++j)
+ for(size_t j = 0, carry = 0; j != 32; ++j)
{
u16bit s = sum[j] + input[32*i+j] + carry;
carry = get_byte(0, s);
@@ -85,7 +85,7 @@ void GOST_34_11::compress_n(const byte input[], u32bit blocks)
load_be(U, &hash[0], 4);
load_be(V, input + 32*i, 4);
- for(u32bit j = 0; j != 4; ++j)
+ for(size_t j = 0; j != 4; ++j)
{
byte key[32] = { 0 };
diff --git a/src/hash/gost_3411/gost_3411.h b/src/hash/gost_3411/gost_3411.h
index 5d26e8557..693b900d2 100644
--- a/src/hash/gost_3411/gost_3411.h
+++ b/src/hash/gost_3411/gost_3411.h
@@ -25,9 +25,9 @@ class BOTAN_DLL GOST_34_11 : public HashFunction
GOST_34_11();
private:
- void compress_n(const byte input[], u32bit blocks);
+ void compress_n(const byte input[], size_t blocks);
- void add_data(const byte[], u32bit);
+ void add_data(const byte[], size_t);
void final_result(byte[]);
GOST_28147_89 cipher;