diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2003-03-20 20:39:59 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2003-03-20 20:39:59 +0000 |
commit | ec56662ba7b4cfaf1335a88854127fac06f376aa (patch) | |
tree | c85dd5aa14780d400b30c133fa3704b044d1bbb2 /pssr.cpp | |
parent | 4feec7c333fd1ec92d1dd8c7f741249e3919ec5e (diff) | |
download | cryptopp-ec56662ba7b4cfaf1335a88854127fac06f376aa.tar.gz |
fix warnings for VC7 and GCC
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@43 57ff6487-cd31-0410-9ec3-f628ee90f5f0
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); |