aboutsummaryrefslogtreecommitdiffstats
path: root/src/checksum/crc24
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/checksum/crc24
parent97e8d6086171772cd5e45bcf2f5b1ea1e38e6bf5 (diff)
Use size_t for BufferedComputation::add_data
Diffstat (limited to 'src/checksum/crc24')
-rw-r--r--src/checksum/crc24/crc24.cpp12
-rw-r--r--src/checksum/crc24/crc24.h2
2 files changed, 8 insertions, 6 deletions
diff --git a/src/checksum/crc24/crc24.cpp b/src/checksum/crc24/crc24.cpp
index 5441020f5..d641047a2 100644
--- a/src/checksum/crc24/crc24.cpp
+++ b/src/checksum/crc24/crc24.cpp
@@ -13,7 +13,7 @@ namespace Botan {
/*
* Update a CRC24 Checksum
*/
-void CRC24::add_data(const byte input[], u32bit length)
+void CRC24::add_data(const byte input[], size_t length)
{
const u32bit TABLE[256] = {
0x00000000, 0x00864CFB, 0x008AD50D, 0x000C99F6, 0x0093E6E1, 0x0015AA1A,
@@ -82,8 +82,10 @@ void CRC24::add_data(const byte input[], u32bit length)
input += 16;
length -= 16;
}
- for(u32bit j = 0; j != length; ++j)
- tmp = TABLE[((tmp >> 16) ^ input[j]) & 0xFF] ^ (tmp << 8);
+
+ for(size_t i = 0; i != length; ++i)
+ tmp = TABLE[((tmp >> 16) ^ input[i]) & 0xFF] ^ (tmp << 8);
+
crc = tmp;
}
@@ -92,8 +94,8 @@ void CRC24::add_data(const byte input[], u32bit length)
*/
void CRC24::final_result(byte output[])
{
- for(u32bit j = 0; j != 3; ++j)
- output[j] = get_byte(j+1, crc);
+ for(size_t i = 0; i != 3; ++i)
+ output[i] = get_byte(i+1, crc);
clear();
}
diff --git a/src/checksum/crc24/crc24.h b/src/checksum/crc24/crc24.h
index 2fc5af2ff..f9786dfa4 100644
--- a/src/checksum/crc24/crc24.h
+++ b/src/checksum/crc24/crc24.h
@@ -24,7 +24,7 @@ class BOTAN_DLL CRC24 : public HashFunction
CRC24() : HashFunction(3) { clear(); }
~CRC24() { clear(); }
private:
- void add_data(const byte[], u32bit);
+ void add_data(const byte[], size_t);
void final_result(byte[]);
u32bit crc;
};