diff --git a/asn.cpp b/asn.cpp index 99ddf415..bf30667b 100644 --- a/asn.cpp +++ b/asn.cpp @@ -114,7 +114,7 @@ size_t DEREncodeOctetString(BufferedTransformation &bt, const byte *str, size_t size_t DEREncodeOctetString(BufferedTransformation &bt, const SecByteBlock &str) { - return DEREncodeOctetString(bt, str.begin(), str.size()); + return DEREncodeOctetString(bt, ConstBytePtr(str), BytePtrSize(str)); } size_t BERDecodeOctetString(BufferedTransformation &bt, SecByteBlock &str) @@ -161,7 +161,7 @@ size_t DEREncodeTextString(BufferedTransformation &bt, const byte* str, size_t s size_t DEREncodeTextString(BufferedTransformation &bt, const SecByteBlock &str, byte asnTag) { - return DEREncodeTextString(bt, str, str.size(), asnTag); + return DEREncodeTextString(bt, ConstBytePtr(str), BytePtrSize(str), asnTag); } size_t DEREncodeTextString(BufferedTransformation &bt, const std::string &str, byte asnTag) @@ -211,7 +211,7 @@ size_t DEREncodeDate(BufferedTransformation &bt, const SecByteBlock &str, byte a { bt.Put(asnTag); size_t lengthBytes = DERLengthEncode(bt, str.size()); - bt.Put(str, str.size()); + bt.Put(ConstBytePtr(str), BytePtrSize(str)); return 1+lengthBytes+str.size(); } diff --git a/donna_32.cpp b/donna_32.cpp index cfbc6575..334d4a24 100644 --- a/donna_32.cpp +++ b/donna_32.cpp @@ -34,6 +34,10 @@ # pragma GCC diagnostic ignored "-Wunused-function" #endif +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4244) +#endif + // Squash MS LNK4221 and libtool warnings extern const char DONNA32_FNAME[] = __FILE__; diff --git a/donna_64.cpp b/donna_64.cpp index fe785291..ef07a5ab 100644 --- a/donna_64.cpp +++ b/donna_64.cpp @@ -34,6 +34,10 @@ # pragma GCC diagnostic ignored "-Wunused-function" #endif +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4244) +#endif + // Squash MS LNK4221 and libtool warnings extern const char DONNA64_FNAME[] = __FILE__; diff --git a/donna_sse.cpp b/donna_sse.cpp index a5cb3f0c..2da9a6f7 100644 --- a/donna_sse.cpp +++ b/donna_sse.cpp @@ -27,6 +27,10 @@ # pragma GCC diagnostic ignored "-Wunused-function" #endif +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4244) +#endif + // Squash MS LNK4221 and libtool warnings extern const char DONNA_SSE_FNAME[] = __FILE__; diff --git a/misc.cpp b/misc.cpp index 64252311..26bfbc6e 100644 --- a/misc.cpp +++ b/misc.cpp @@ -17,6 +17,7 @@ #include "words.h" #include "stdcpp.h" #include "integer.h" +#include "secblock.h" NAMESPACE_BEGIN(CryptoPP) diff --git a/rdrand.cpp b/rdrand.cpp index dd998cd1..5e90c897 100644 --- a/rdrand.cpp +++ b/rdrand.cpp @@ -24,6 +24,10 @@ ///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4702) +#endif + #if defined(CRYPTOPP_RDRAND_AVAILABLE) # if defined(CRYPTOPP_MSC_VERSION) # define MASM_RDRAND_ASM_AVAILABLE 1 diff --git a/sm4.cpp b/sm4.cpp index 2c92883e..ad7f3222 100644 --- a/sm4.cpp +++ b/sm4.cpp @@ -11,6 +11,10 @@ #include "misc.h" #include "cpu.h" +#if CRYPTOPP_MSC_VERSION +# pragma warning(disable: 4307) +#endif + ANONYMOUS_NAMESPACE_BEGIN using CryptoPP::byte;