summaryrefslogtreecommitdiff
path: root/pssr.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-03-20 20:39:59 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-03-20 20:39:59 +0000
commitec56662ba7b4cfaf1335a88854127fac06f376aa (patch)
treec85dd5aa14780d400b30c133fa3704b044d1bbb2 /pssr.cpp
parent4feec7c333fd1ec92d1dd8c7f741249e3919ec5e (diff)
downloadcryptopp-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.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/pssr.cpp b/pssr.cpp
index 020cb98..5dc959a 100644
--- a/pssr.cpp
+++ b/pssr.cpp
@@ -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);