Clear truncation warnings with early MSVC compilers

This commit is contained in:
Jeffrey Walton 2019-10-03 06:49:03 -04:00
parent 2b3349590f
commit 6e06c8cbf2

View File

@ -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);
}