summaryrefslogtreecommitdiff
path: root/blake2.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-08-21 12:53:10 -0400
committerJeffrey Walton <noloader@gmail.com>2018-08-21 12:53:10 -0400
commit81f8c48fafdaa4650b40cc3aaf68499e61750661 (patch)
tree1268eafa4d7a18f5c0865d610f0e76b6bd335eda /blake2.cpp
parent6b93c284fe50d3d617228481fb78c2d20f24f6c8 (diff)
downloadcryptopp-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.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/blake2.cpp b/blake2.cpp
index 517849a9..d400af1f 100644
--- a/blake2.cpp
+++ b/blake2.cpp
@@ -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);