summaryrefslogtreecommitdiff
path: root/chachapoly.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-10-03 06:49:03 -0400
committerJeffrey Walton <noloader@gmail.com>2019-10-03 06:49:03 -0400
commit6e06c8cbf29ba7085264c69324fb47653c68b175 (patch)
treea46b6f28369b50b5d475dac4e44a94867b93f7aa /chachapoly.cpp
parent2b3349590fa655134ddcb1577d48186613f04029 (diff)
downloadcryptopp-git-6e06c8cbf29ba7085264c69324fb47653c68b175.tar.gz
Clear truncation warnings with early MSVC compilers
Diffstat (limited to 'chachapoly.cpp')
-rw-r--r--chachapoly.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/chachapoly.cpp b/chachapoly.cpp
index 8816935d..93474060 100644
--- a/chachapoly.cpp
+++ b/chachapoly.cpp
@@ -6,6 +6,10 @@
#include "algparam.h"
#include "misc.h"
+#if CRYPTOPP_MSC_VERSION
+# pragma warning(disable: 4244)
+#endif
+
NAMESPACE_BEGIN(CryptoPP)
////////////////////////////// IETF ChaChaTLS //////////////////////////////
@@ -68,7 +72,7 @@ void ChaCha20Poly1305_Base::AuthenticateLastHeaderBlock()
{
// Pad to a multiple of 16 or 0
const byte zero[16] = {0};
- size_t pad = (16 - (m_totalHeaderLength % 16)) % 16;
+ size_t pad = (16U - (m_totalHeaderLength % 16)) % 16;
AccessMAC().Update(zero, pad);
}
@@ -76,7 +80,7 @@ void ChaCha20Poly1305_Base::AuthenticateLastConfidentialBlock()
{
// Pad to a multiple of 16 or 0
const byte zero[16] = {0};
- size_t pad = (16 - (m_totalMessageLength % 16)) % 16;
+ size_t pad = (16U - (m_totalMessageLength % 16)) % 16;
AccessMAC().Update(zero, pad);
}