Update documentation
parent
aa043b38a7
commit
672f5c7f3d
10
scrypt.cpp
10
scrypt.cpp
|
|
@ -183,6 +183,16 @@ void Scrypt::ValidateParameters(size_t derivedLen, word64 cost, word64 blockSize
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://github.com/weidai11/cryptopp/issues/787
|
||||||
|
CRYPTOPP_ASSERT(parallelization <= std::numeric_limits<int>::max());
|
||||||
|
if (parallelization > static_cast<word64>(std::numeric_limits<int>::max()))
|
||||||
|
{
|
||||||
|
std::ostringstream oss;
|
||||||
|
oss << " parallelization " << parallelization << " is larger than ";
|
||||||
|
oss << numeric_limits<int>::max();
|
||||||
|
throw InvalidArgument("Scrypt: " + oss.str());
|
||||||
|
}
|
||||||
|
|
||||||
CRYPTOPP_ASSERT(IsPowerOf2(cost));
|
CRYPTOPP_ASSERT(IsPowerOf2(cost));
|
||||||
if (IsPowerOf2(cost) == false)
|
if (IsPowerOf2(cost) == false)
|
||||||
throw InvalidArgument("Scrypt: cost must be a power of 2");
|
throw InvalidArgument("Scrypt: cost must be a power of 2");
|
||||||
|
|
|
||||||
4
scrypt.h
4
scrypt.h
|
|
@ -76,7 +76,9 @@ public:
|
||||||
/// \details The parameter <tt>blockSize</tt> ("r" in the documents) specifies the block
|
/// \details The parameter <tt>blockSize</tt> ("r" in the documents) specifies the block
|
||||||
/// size.
|
/// size.
|
||||||
/// \details The <tt>parallelization</tt> parameter ("p" in the documents) is a positive
|
/// \details The <tt>parallelization</tt> parameter ("p" in the documents) is a positive
|
||||||
/// integer less than or equal to <tt>((2^32-1) * 32) / (128 * r)</tt>.
|
/// integer less than or equal to <tt>((2^32-1) * 32) / (128 * r)</tt>. Due to Microsoft
|
||||||
|
/// and its OpenMP 2.0 implementation <tt>parallelization</tt> is limited to
|
||||||
|
/// <tt>std::numeric_limits<int>::max()</tt>.
|
||||||
/// \details Scrypt always returns 1 because it only performs 1 iteration. Other
|
/// \details Scrypt always returns 1 because it only performs 1 iteration. Other
|
||||||
/// derivation functions, like PBKDF's, will return more interesting values.
|
/// derivation functions, like PBKDF's, will return more interesting values.
|
||||||
/// \details The Crypto++ implementation of Scrypt is limited by C++ datatypes. For
|
/// \details The Crypto++ implementation of Scrypt is limited by C++ datatypes. For
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue