summaryrefslogtreecommitdiff
path: root/oaep.cpp
diff options
context:
space:
mode:
authorKirit Sælensminde <k@kirit.com>2018-01-12 20:38:56 +0700
committerJeffrey Walton <noloader@gmail.com>2018-01-12 08:38:56 -0500
commit59b94d2bbf43440790abd64d953a3c7f576c4ce3 (patch)
tree4a75ac0e14ea7d1d3a199bd863af0cfff7e909c9 /oaep.cpp
parentc6289edd44815a0d42823e8c0f283fc25d7506de (diff)
downloadcryptopp-git-59b94d2bbf43440790abd64d953a3c7f576c4ce3.tar.gz
C++17 compatible lambda expressions to replace `bind2nd` (#559)
* Conditionally use a lambda rather than the older `bind2nd` style. * Duplicate the if statements. * Centralise the conditional compilation to an implementation of find_if_not. * Refactoring of name and code placement after review. * Use `FindIfNot` where appropriate. * Remove whitespace.
Diffstat (limited to 'oaep.cpp')
-rw-r--r--oaep.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/oaep.cpp b/oaep.cpp
index 08d75a99..fb9e31a0 100644
--- a/oaep.cpp
+++ b/oaep.cpp
@@ -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 = (FindIfNot(maskedDB+hLen, M, byte(0)) != M) || invalid;
invalid = !pHash->VerifyDigest(maskedDB, encodingParameters.begin(), encodingParameters.size()) || invalid;
if (invalid)