diff options
author | Jack Lloyd <[email protected]> | 2016-12-11 15:28:38 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-12-18 16:48:24 -0500 |
commit | f3cb3edb512bdcab498d825886c3366c341b3f78 (patch) | |
tree | 645c73ec295a5a34f25d99903b6d9fa9751e86d3 /src/lib/hash/checksum | |
parent | c1dd21253c1f3188ff45d3ad47698efd08235ae8 (diff) |
Convert to using standard uintN_t integer types
Renames a couple of functions for somewhat better name consistency,
eg make_u32bit becomes make_uint32. The old typedefs remain for now
since probably lots of application code uses them.
Diffstat (limited to 'src/lib/hash/checksum')
-rw-r--r-- | src/lib/hash/checksum/adler32/adler32.cpp | 12 | ||||
-rw-r--r-- | src/lib/hash/checksum/adler32/adler32.h | 6 | ||||
-rw-r--r-- | src/lib/hash/checksum/crc24/crc24.cpp | 8 | ||||
-rw-r--r-- | src/lib/hash/checksum/crc24/crc24.h | 6 | ||||
-rw-r--r-- | src/lib/hash/checksum/crc32/crc32.cpp | 8 | ||||
-rw-r--r-- | src/lib/hash/checksum/crc32/crc32.h | 6 |
6 files changed, 23 insertions, 23 deletions
diff --git a/src/lib/hash/checksum/adler32/adler32.cpp b/src/lib/hash/checksum/adler32/adler32.cpp index 304c664dd..b7f6356c4 100644 --- a/src/lib/hash/checksum/adler32/adler32.cpp +++ b/src/lib/hash/checksum/adler32/adler32.cpp @@ -12,11 +12,11 @@ namespace Botan { namespace { -void adler32_update(const byte input[], size_t length, - u16bit& S1, u16bit& S2) +void adler32_update(const uint8_t input[], size_t length, + uint16_t& S1, uint16_t& S2) { - u32bit S1x = S1; - u32bit S2x = S2; + uint32_t S1x = S1; + uint32_t S2x = S2; while(length >= 16) { @@ -55,7 +55,7 @@ void adler32_update(const byte input[], size_t length, /* * Update an Adler32 Checksum */ -void Adler32::add_data(const byte input[], size_t length) +void Adler32::add_data(const uint8_t input[], size_t length) { const size_t PROCESS_AMOUNT = 5552; @@ -72,7 +72,7 @@ void Adler32::add_data(const byte input[], size_t length) /* * Finalize an Adler32 Checksum */ -void Adler32::final_result(byte output[]) +void Adler32::final_result(uint8_t output[]) { store_be(output, m_S2, m_S1); clear(); diff --git a/src/lib/hash/checksum/adler32/adler32.h b/src/lib/hash/checksum/adler32/adler32.h index 73df6134a..eaf57c656 100644 --- a/src/lib/hash/checksum/adler32/adler32.h +++ b/src/lib/hash/checksum/adler32/adler32.h @@ -27,9 +27,9 @@ class BOTAN_DLL Adler32 final : public HashFunction Adler32() { clear(); } ~Adler32() { clear(); } private: - void add_data(const byte[], size_t) override; - void final_result(byte[]) override; - u16bit m_S1, m_S2; + void add_data(const uint8_t[], size_t) override; + void final_result(uint8_t[]) override; + uint16_t m_S1, m_S2; }; } diff --git a/src/lib/hash/checksum/crc24/crc24.cpp b/src/lib/hash/checksum/crc24/crc24.cpp index 6f1eea453..923433d7e 100644 --- a/src/lib/hash/checksum/crc24/crc24.cpp +++ b/src/lib/hash/checksum/crc24/crc24.cpp @@ -13,9 +13,9 @@ namespace Botan { /* * Update a CRC24 Checksum */ -void CRC24::add_data(const byte input[], size_t length) +void CRC24::add_data(const uint8_t input[], size_t length) { - const u32bit TABLE[256] = { + const uint32_t TABLE[256] = { 0x00000000, 0x00864CFB, 0x008AD50D, 0x000C99F6, 0x0093E6E1, 0x0015AA1A, 0x001933EC, 0x009F7F17, 0x00A18139, 0x0027CDC2, 0x002B5434, 0x00AD18CF, 0x003267D8, 0x00B42B23, 0x00B8B2D5, 0x003EFE2E, 0x00C54E89, 0x00430272, @@ -60,7 +60,7 @@ void CRC24::add_data(const byte input[], size_t length) 0x00FA48FA, 0x007C0401, 0x0042FA2F, 0x00C4B6D4, 0x00C82F22, 0x004E63D9, 0x00D11CCE, 0x00575035, 0x005BC9C3, 0x00DD8538 }; - u32bit tmp = m_crc; + uint32_t tmp = m_crc; while(length >= 16) { tmp = TABLE[((tmp >> 16) ^ input[ 0]) & 0xFF] ^ (tmp << 8); @@ -92,7 +92,7 @@ void CRC24::add_data(const byte input[], size_t length) /* * Finalize a CRC24 Checksum */ -void CRC24::final_result(byte output[]) +void CRC24::final_result(uint8_t output[]) { for(size_t i = 0; i != 3; ++i) output[i] = get_byte(i+1, m_crc); diff --git a/src/lib/hash/checksum/crc24/crc24.h b/src/lib/hash/checksum/crc24/crc24.h index f80ee1c2a..95977bc48 100644 --- a/src/lib/hash/checksum/crc24/crc24.h +++ b/src/lib/hash/checksum/crc24/crc24.h @@ -27,9 +27,9 @@ class BOTAN_DLL CRC24 final : public HashFunction CRC24() { clear(); } ~CRC24() { clear(); } private: - void add_data(const byte[], size_t) override; - void final_result(byte[]) override; - u32bit m_crc; + void add_data(const uint8_t[], size_t) override; + void final_result(uint8_t[]) override; + uint32_t m_crc; }; } diff --git a/src/lib/hash/checksum/crc32/crc32.cpp b/src/lib/hash/checksum/crc32/crc32.cpp index ca8c87c5f..1bbc35ac8 100644 --- a/src/lib/hash/checksum/crc32/crc32.cpp +++ b/src/lib/hash/checksum/crc32/crc32.cpp @@ -13,9 +13,9 @@ namespace Botan { /* * Update a CRC32 Checksum */ -void CRC32::add_data(const byte input[], size_t length) +void CRC32::add_data(const uint8_t input[], size_t length) { - const u32bit TABLE[256] = { + const uint32_t TABLE[256] = { 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, @@ -60,7 +60,7 @@ void CRC32::add_data(const byte input[], size_t length) 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D }; - u32bit tmp = m_crc; + uint32_t tmp = m_crc; while(length >= 16) { tmp = TABLE[(tmp ^ input[ 0]) & 0xFF] ^ (tmp >> 8); @@ -92,7 +92,7 @@ void CRC32::add_data(const byte input[], size_t length) /* * Finalize a CRC32 Checksum */ -void CRC32::final_result(byte output[]) +void CRC32::final_result(uint8_t output[]) { m_crc ^= 0xFFFFFFFF; store_be(m_crc, output); diff --git a/src/lib/hash/checksum/crc32/crc32.h b/src/lib/hash/checksum/crc32/crc32.h index 987f34608..fd9db1b3e 100644 --- a/src/lib/hash/checksum/crc32/crc32.h +++ b/src/lib/hash/checksum/crc32/crc32.h @@ -27,9 +27,9 @@ class BOTAN_DLL CRC32 final : public HashFunction CRC32() { clear(); } ~CRC32() { clear(); } private: - void add_data(const byte[], size_t) override; - void final_result(byte[]) override; - u32bit m_crc; + void add_data(const uint8_t[], size_t) override; + void final_result(uint8_t[]) override; + uint32_t m_crc; }; } |