diff options
author | weidai <weidai11@users.noreply.github.com> | 2003-03-20 20:39:59 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2003-03-20 20:39:59 +0000 |
commit | 6698a186066d6efb239fcfc13f296794b9d7dda2 (patch) | |
tree | c85dd5aa14780d400b30c133fa3704b044d1bbb2 /pssr.cpp | |
parent | 067b425053134d8d5d44e1ecb8907ea28b985a68 (diff) | |
download | cryptopp-git-6698a186066d6efb239fcfc13f296794b9d7dda2.tar.gz |
fix warnings for VC7 and GCC
Diffstat (limited to 'pssr.cpp')
-rw-r--r-- | pssr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -68,7 +68,7 @@ void PSSR_MEM_Base::ComputeMessageRepresentative(RandomNumberGenerator &rng, memcpy(representative + representativeByteLength - u, hashIdentifier.first, hashIdentifier.second); representative[representativeByteLength - 1] = hashIdentifier.second ? 0xcc : 0xbc; if (representativeBitLength % 8 != 0) - representative[0] = Crop(representative[0], representativeBitLength % 8); + representative[0] = (byte)Crop(representative[0], representativeBitLength % 8); } DecodingResult PSSR_MEM_Base::RecoverMessageFromRepresentative( @@ -94,12 +94,12 @@ DecodingResult PSSR_MEM_Base::RecoverMessageFromRepresentative( GetMGF().GenerateAndMask(hash, representative, representativeByteLength - u - digestSize, h, digestSize); if (representativeBitLength % 8 != 0) - representative[0] = Crop(representative[0], representativeBitLength % 8); + representative[0] = (byte)Crop(representative[0], representativeBitLength % 8); // extract salt and recoverableMessage from DB = 00 ... || 01 || M || salt byte *salt = representative + representativeByteLength - u - digestSize - saltSize; byte *M = std::find_if(representative, salt-1, std::bind2nd(std::not_equal_to<byte>(), 0)); - if (*M == 0x01 && M - representative - (representativeBitLength % 8 != 0) >= MinPadLen(digestSize)) + if (*M == 0x01 && (unsigned int)(M - representative - (representativeBitLength % 8 != 0)) >= MinPadLen(digestSize)) { recoverableMessageLength = salt-M-1; memcpy(recoverableMessage, M+1, recoverableMessageLength); |