diff options
author | lloyd <[email protected]> | 2010-12-13 22:06:59 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-12-13 22:06:59 +0000 |
commit | aa8a0c19ec2156864d16bfe4b82fce4f2203c08d (patch) | |
tree | c6de672209e59214c91f29a702339c35d518c459 /src/hash | |
parent | d73929a5ec894625e7e4cb82c1a22bea4a0e7a26 (diff) |
Avoid more VC warnings
Diffstat (limited to 'src/hash')
-rw-r--r-- | src/hash/gost_3411/gost_3411.cpp | 2 | ||||
-rw-r--r-- | src/hash/keccak/keccak.cpp | 7 | ||||
-rw-r--r-- | src/hash/md2/md2.cpp | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/hash/gost_3411/gost_3411.cpp b/src/hash/gost_3411/gost_3411.cpp index 075f26889..c0f39da47 100644 --- a/src/hash/gost_3411/gost_3411.cpp +++ b/src/hash/gost_3411/gost_3411.cpp @@ -71,7 +71,7 @@ void GOST_34_11::compress_n(const byte input[], size_t blocks) { for(size_t i = 0; i != blocks; ++i) { - for(size_t j = 0, carry = 0; j != 32; ++j) + for(u16bit j = 0, carry = 0; j != 32; ++j) { u16bit s = sum[j] + input[32*i+j] + carry; carry = get_byte(0, s); diff --git a/src/hash/keccak/keccak.cpp b/src/hash/keccak/keccak.cpp index 37fdc0d86..841c8875d 100644 --- a/src/hash/keccak/keccak.cpp +++ b/src/hash/keccak/keccak.cpp @@ -104,7 +104,7 @@ void keccak_f_1600(u64bit A[25]) Keccak_1600::Keccak_1600(size_t output_bits) : output_bits(output_bits), bitrate(1600 - 2*output_bits), - diversifier(output_bits / 8), + diversifier(static_cast<byte>(output_bits / 8)), S(25), S_pos(0) { @@ -179,7 +179,10 @@ void Keccak_1600::add_data(const byte input[], size_t length) void Keccak_1600::final_result(byte output[]) { - const byte padding[4] = { 0x01, diversifier, bitrate / 8, 0x01 }; + const byte padding[4] = { 0x01, + diversifier, + static_cast<byte>(bitrate / 8), + 0x01 }; add_data(padding, sizeof(padding)); diff --git a/src/hash/md2/md2.cpp b/src/hash/md2/md2.cpp index 195c0843e..761528dc6 100644 --- a/src/hash/md2/md2.cpp +++ b/src/hash/md2/md2.cpp @@ -52,7 +52,8 @@ void MD2::hash(const byte input[]) T = X[k+4] ^= SBOX[T]; T = X[k+5] ^= SBOX[T]; T = X[k+6] ^= SBOX[T]; T = X[k+7] ^= SBOX[T]; } - T += i; + + T += static_cast<byte>(i); } T = checksum[15]; |