@@ -200,7 +200,7 @@ void Scrypt::ValidateParameters(size_t derivedLen, word64 cost, word64 blockSize
200
200
throw InvalidArgument (" Scrypt: parallelization cannot be 0" );
201
201
202
202
// Optimizer should remove this on 32-bit platforms
203
- if (std::numeric_limits<size_t >::max () > std::numeric_limits<word32>::max ())
203
+ if (( std::numeric_limits<size_t >::max) () > ( std::numeric_limits<word32>::max) ())
204
204
{
205
205
const word64 maxLen = ((static_cast <word64>(1 ) << 32 ) - 1 ) * 32 ;
206
206
if (derivedLen > maxLen) {
@@ -211,12 +211,12 @@ void Scrypt::ValidateParameters(size_t derivedLen, word64 cost, word64 blockSize
211
211
}
212
212
213
213
// https://github.com/weidai11/cryptopp/issues/787
214
- CRYPTOPP_ASSERT (parallelization <= static_cast <word64>(std::numeric_limits<int >::max ()));
215
- if (parallelization > static_cast <word64>(std::numeric_limits<int >::max ()))
214
+ CRYPTOPP_ASSERT (parallelization <= static_cast <word64>(( std::numeric_limits<int >::max) ()));
215
+ if (parallelization > static_cast <word64>(( std::numeric_limits<int >::max) ()))
216
216
{
217
217
std::ostringstream oss;
218
218
oss << " parallelization " << parallelization << " is larger than " ;
219
- oss << std::numeric_limits<int >::max ();
219
+ oss << ( std::numeric_limits<int >::max) ();
220
220
throw InvalidArgument (" Scrypt: " + oss.str ());
221
221
}
222
222
@@ -297,7 +297,7 @@ size_t Scrypt::DeriveKey(byte*derived, size_t derivedLen, const byte*secret, siz
297
297
// Visual Studio and OpenMP 2.0 fixup. We must use int, not size_t.
298
298
int maxParallel=0 ;
299
299
if (!SafeConvert (parallel, maxParallel))
300
- maxParallel = std::numeric_limits<int >::max ();
300
+ maxParallel = ( std::numeric_limits<int >::max) ();
301
301
302
302
#ifdef _OPENMP
303
303
int threads = STDMIN (omp_get_max_threads (), maxParallel);
0 commit comments