diff options
author | Jeffrey Walton <noloader@gmail.com> | 2018-08-21 12:53:10 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-08-21 12:53:10 -0400 |
commit | 81f8c48fafdaa4650b40cc3aaf68499e61750661 (patch) | |
tree | 1268eafa4d7a18f5c0865d610f0e76b6bd335eda /blake2.cpp | |
parent | 6b93c284fe50d3d617228481fb78c2d20f24f6c8 (diff) | |
download | cryptopp-git-81f8c48fafdaa4650b40cc3aaf68499e61750661.tar.gz |
Avoid std::call_once (GH #707)
This commit also favors init priorities over C++ dynamic initialization. After the std::call_once problems on Sparc and PowerPC I'm worried about problems with Dynamic Initialization and Destruction with Concurrency.
We also do away with supressing warnings and use CRYPTOPP_UNUSED instead.
Diffstat (limited to 'blake2.cpp')
-rw-r--r-- | blake2.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -235,7 +235,7 @@ void BLAKE2_Base<word32, false>::UncheckedSetKey(const byte *key, unsigned int l AlignedSecByteBlock temp(BLOCKSIZE);
memcpy_s(temp, BLOCKSIZE, key, length);
- size_t rem = SaturatingSubtract(BLOCKSIZE, length);
+ size_t rem = SaturatingSubtract((unsigned int)BLOCKSIZE, length);
if (rem)
std::memset(temp+length, 0x00, rem);
@@ -291,7 +291,7 @@ void BLAKE2_Base<word64, true>::UncheckedSetKey(const byte *key, unsigned int le AlignedSecByteBlock temp(BLOCKSIZE);
memcpy_s(temp, BLOCKSIZE, key, length);
- size_t rem = SaturatingSubtract(BLOCKSIZE, length);
+ size_t rem = SaturatingSubtract((unsigned int)BLOCKSIZE, length);
if (rem)
std::memset(temp+length, 0x00, rem);
|