diff options
author | lloyd <[email protected]> | 2011-04-18 18:35:38 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-04-18 18:35:38 +0000 |
commit | c4bedb32c0547e8f6b67ece566050073726120f5 (patch) | |
tree | 17183000888bda5156637360d10d9901ced3565b /src/hash | |
parent | 06a32c91e639cc2b0c636553a8aa395aa90d4d37 (diff) |
Maintainer mode warning cleanups, mostly for C style casts which I
added to the flags here.
Diffstat (limited to 'src/hash')
-rw-r--r-- | src/hash/sha2_32/sha2_32.cpp | 4 | ||||
-rw-r--r-- | src/hash/sha2_64/sha2_64.cpp | 4 | ||||
-rw-r--r-- | src/hash/skein/skein_512.cpp | 12 |
3 files changed, 16 insertions, 4 deletions
diff --git a/src/hash/sha2_32/sha2_32.cpp b/src/hash/sha2_32/sha2_32.cpp index 475ec8aee..6dd780e64 100644 --- a/src/hash/sha2_32/sha2_32.cpp +++ b/src/hash/sha2_32/sha2_32.cpp @@ -12,6 +12,8 @@ namespace Botan { +namespace { + namespace SHA2_32 { /* @@ -154,6 +156,8 @@ void compress(MemoryRegion<u32bit>& digest, } +} + /* * SHA-224 compression function */ diff --git a/src/hash/sha2_64/sha2_64.cpp b/src/hash/sha2_64/sha2_64.cpp index b58e042d3..3026c3a39 100644 --- a/src/hash/sha2_64/sha2_64.cpp +++ b/src/hash/sha2_64/sha2_64.cpp @@ -11,6 +11,8 @@ namespace Botan { +namespace { + namespace SHA2_64 { /* @@ -169,6 +171,8 @@ void compress(MemoryRegion<u64bit>& digest, } +} + /* * SHA-384 compression function */ diff --git a/src/hash/skein/skein_512.cpp b/src/hash/skein/skein_512.cpp index 3ed3e32a7..f85968e84 100644 --- a/src/hash/skein/skein_512.cpp +++ b/src/hash/skein/skein_512.cpp @@ -43,7 +43,7 @@ void ubi_512(MemoryRegion<u64bit>& H, if(to_proc % 8) { for(size_t j = 0; j != to_proc % 8; ++j) - M[to_proc/8] |= ((u64bit)msg[8*(to_proc/8)+j] << (8*j)); + M[to_proc/8] |= static_cast<u64bit>(msg[8*(to_proc/8)+j]) << (8*j); } H[8] = H[0] ^ H[1] ^ H[2] ^ H[3] ^ @@ -117,7 +117,8 @@ void ubi_512(MemoryRegion<u64bit>& H, H[6] = X6 ^ M[6]; H[7] = X7 ^ M[7]; - T[1] &= ~((u64bit)1 << 62); // clear first flag if set + // clear first flag if set + T[1] &= ~(static_cast<u64bit>(1) << 62); msg_len -= to_proc; msg += to_proc; @@ -128,7 +129,10 @@ void reset_tweak(MemoryRegion<u64bit>& T, type_code type, bool final) { T[0] = 0; - T[1] = ((u64bit)type << 56) | ((u64bit)1 << 62) | ((u64bit)final << 63); + + T[1] = (static_cast<u64bit>(type) << 56) | + (static_cast<u64bit>(1) << 62) | + (static_cast<u64bit>(final) << 63); } void initial_block(MemoryRegion<u64bit>& H, @@ -227,7 +231,7 @@ void Skein_512::add_data(const byte input[], size_t length) void Skein_512::final_result(byte out[]) { - T[1] |= ((u64bit)1 << 63); // final block flag + T[1] |= (static_cast<u64bit>(1) << 63); // final block flag for(size_t i = buf_pos; i != buffer.size(); ++i) buffer[i] = 0; |