Fix compilation with MSVC and /std:c++latest

pull/397/head
RaptorFactor 2017-03-25 23:06:36 -07:00
parent d865cf9e62
commit 59a45c52dc
5 changed files with 7 additions and 7 deletions

View File

@ -738,7 +738,7 @@ void StreamTransformationFilter::LastPut(const byte *inString, size_t length)
if (m_padding == PKCS_PADDING)
{
byte pad = space[s-1];
if (pad < 1 || pad > s || std::find_if(space+s-pad, space+s, std::bind2nd(std::not_equal_to<byte>(), pad)) != space+s)
if (pad < 1 || pad > s || std::find_if(space+s-pad, space+s, std::bind(std::not_equal_to<byte>(), std::placeholders::_1, pad)) != space+s)
throw InvalidCiphertext("StreamTransformationFilter: invalid PKCS #7 block padding found");
length = s-pad;
}

View File

@ -389,7 +389,7 @@ size_t PaddingRemover::Put2(const byte *begin, size_t length, int messageEnd, bo
if (m_possiblePadding)
{
size_t len = std::find_if(begin, end, std::bind2nd(std::not_equal_to<byte>(), byte(0))) - begin;
size_t len = std::find_if(begin, end, std::bind(std::not_equal_to<byte>(), std::placeholders::_1, byte(0))) - begin;
m_zeroCount += len;
begin += len;
if (begin == end)
@ -402,7 +402,7 @@ size_t PaddingRemover::Put2(const byte *begin, size_t length, int messageEnd, bo
m_possiblePadding = false;
}
const byte *x = std::find_if(RevIt(end), RevIt(begin), std::bind2nd(std::not_equal_to<byte>(), byte(0))).base();
const byte *x = std::find_if(RevIt(end), RevIt(begin), std::bind(std::not_equal_to<byte>(), std::placeholders::_1, byte(0))).base();
if (x != begin && *(x-1) == 1)
{
AttachedTransformation()->Put(begin, x-begin-1);

View File

@ -82,7 +82,7 @@ DecodingResult OAEP_Base::Unpad(const byte *oaepBlock, size_t oaepBlockLen, byte
// DB = pHash' || 00 ... || 01 || M
byte *M = std::find(maskedDB+hLen, maskedDB+dbLen, 0x01);
invalid = (M == maskedDB+dbLen) || invalid;
invalid = (std::find_if(maskedDB+hLen, M, std::bind2nd(std::not_equal_to<byte>(), byte(0))) != M) || invalid;
invalid = (std::find_if(maskedDB+hLen, M, std::bind(std::not_equal_to<byte>(), std::placeholders::_1, byte(0))) != M) || invalid;
invalid = !pHash->VerifyDigest(maskedDB, encodingParameters.begin(), encodingParameters.size()) || invalid;
if (invalid)

View File

@ -125,7 +125,7 @@ DecodingResult PSSR_MEM_Base::RecoverMessageFromRepresentative(
// 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>(), byte(0)));
byte *M = std::find_if(representative, salt-1, std::bind(std::not_equal_to<byte>(), std::placeholders::_1, byte(0)));
recoverableMessageLength = salt-M-1;
if (*M == 0x01 &&
(size_t)(M - representative - (representativeBitLength % 8 != 0)) >= MinPadLen(digestSize) &&

View File

@ -676,11 +676,11 @@ void Deflator::EncodeBlock(bool eof, unsigned int blockType)
m_literalCounts[256] = 1;
HuffmanEncoder::GenerateCodeLengths(literalCodeLengths, 15, m_literalCounts, 286);
m_dynamicLiteralEncoder.Initialize(literalCodeLengths, 286);
unsigned int hlit = (unsigned int)(std::find_if(RevIt(literalCodeLengths.end()), RevIt(literalCodeLengths.begin()+257), std::bind2nd(std::not_equal_to<unsigned int>(), 0)).base() - (literalCodeLengths.begin()+257));
unsigned int hlit = (unsigned int)(std::find_if(RevIt(literalCodeLengths.end()), RevIt(literalCodeLengths.begin()+257), std::bind(std::not_equal_to<unsigned int>(), std::placeholders::_1, 0)).base() - (literalCodeLengths.begin()+257));
HuffmanEncoder::GenerateCodeLengths(distanceCodeLengths, 15, m_distanceCounts, 30);
m_dynamicDistanceEncoder.Initialize(distanceCodeLengths, 30);
unsigned int hdist = (unsigned int)(std::find_if(RevIt(distanceCodeLengths.end()), RevIt(distanceCodeLengths.begin()+1), std::bind2nd(std::not_equal_to<unsigned int>(), 0)).base() - (distanceCodeLengths.begin()+1));
unsigned int hdist = (unsigned int)(std::find_if(RevIt(distanceCodeLengths.end()), RevIt(distanceCodeLengths.begin()+1), std::bind(std::not_equal_to<unsigned int>(), std::placeholders::_1, 0)).base() - (distanceCodeLengths.begin()+1));
SecBlockWithHint<unsigned int, 286+30> combinedLengths(hlit+257+hdist+1);
memcpy(combinedLengths, literalCodeLengths, (hlit+257)*sizeof(unsigned int));