Fix .Net 2002 compile

This testing occurs on Windows XP. We are still rockin it
master
Jeffrey Walton 2019-08-27 14:44:27 -04:00
parent b067d16e88
commit 033f204a86
8 changed files with 14 additions and 18 deletions

View File

@ -264,13 +264,13 @@ clean ::
$(RM) /F /Q pch.obj $(LIB_OBJS) $(ASM_OBJS) $(TEST_OBJS) *.pdb 2>nul $(RM) /F /Q pch.obj $(LIB_OBJS) $(ASM_OBJS) $(TEST_OBJS) *.pdb 2>nul
distclean :: clean distclean :: clean
!IF EXIST ($(USERNAME).sdf) !IF EXIST ("$(USERNAME).sdf")
attrib -r -a -s -h $(USERNAME).sdf 2>nul attrib -r -a -s -h "$(USERNAME).sdf" 2>nul
$(RM) /F /Q $(USERNAME).sdf 2>nul $(RM) /F /Q "$(USERNAME).sdf" 2>nul
!ENDIF !ENDIF
!IF EXIST ($(USERNAME).suo) !IF EXIST ("$(USERNAME).suo")
attrib -r -a -s -h $(USERNAME).suo 2>nul attrib -r -a -s -h $(USERNAME).suo" 2>nul
$(RM) /F /Q $(USERNAME).suo 2>nul $(RM) /F /Q $(USERNAME).suo" 2>nul
!ENDIF !ENDIF
!IF EXIST (Win32\) !IF EXIST (Win32\)
$(RMDIR) Win32\ /q /s 2>nul $(RMDIR) Win32\ /q /s 2>nul

View File

@ -29,7 +29,6 @@
NAMESPACE_BEGIN(CryptoPP) NAMESPACE_BEGIN(CryptoPP)
CRYPTOPP_COMPILE_ASSERT(SIZE_MAX > 0);
CRYPTOPP_COMPILE_ASSERT(sizeof(byte) == 1); CRYPTOPP_COMPILE_ASSERT(sizeof(byte) == 1);
CRYPTOPP_COMPILE_ASSERT(sizeof(word16) == 2); CRYPTOPP_COMPILE_ASSERT(sizeof(word16) == 2);
CRYPTOPP_COMPILE_ASSERT(sizeof(word32) == 4); CRYPTOPP_COMPILE_ASSERT(sizeof(word32) == 4);

View File

@ -1059,13 +1059,13 @@ int curve25519_mult_SSE2(byte sharedKey[32], const byte secretKey[32], const byt
packed32bignum25519 qx, qz, pqz, pqx; packed32bignum25519 qx, qz, pqz, pqx;
packed64bignum25519 nq, sq, sqscalar, prime, primex, primez, nqpq; packed64bignum25519 nq, sq, sqscalar, prime, primex, primez, nqpq;
bignum25519mulprecomp preq; bignum25519mulprecomp preq;
size_t i=0, bit=0, lastbit=0; size_t bit=0, lastbit=0;
curve25519_expand(nqpqx, othersKey); curve25519_expand(nqpqx, othersKey);
curve25519_mul_precompute(&preq, nqpqx); curve25519_mul_precompute(&preq, nqpqx);
/* do bits 254..3 */ /* do bits 254..3 */
for (i = 254, lastbit=0; i >= 3; i--) { for (size_t i = 254, lastbit=0; i >= 3; i--) {
bit = (e[i/8] >> (i & 7)) & 1; bit = (e[i/8] >> (i & 7)) & 1;
curve25519_swap_conditional(nqx, nqpqx, (word32)(bit ^ lastbit)); curve25519_swap_conditional(nqx, nqpqx, (word32)(bit ^ lastbit));
curve25519_swap_conditional(nqz, nqpqz, (word32)(bit ^ lastbit)); curve25519_swap_conditional(nqz, nqpqz, (word32)(bit ^ lastbit));
@ -1098,7 +1098,7 @@ int curve25519_mult_SSE2(byte sharedKey[32], const byte secretKey[32], const byt
curve25519_swap_conditional(nqz, nqpqz, (word32)bit); curve25519_swap_conditional(nqz, nqpqz, (word32)bit);
/* do bits 2..0 */ /* do bits 2..0 */
for (i = 0; i < 3; i++) { for (size_t i = 0; i < 3; i++) {
curve25519_compute_nq(nq, nqx, nqz); curve25519_compute_nq(nq, nqx, nqz);
curve25519_square_packed64(sq, nq); /* sq = nq^2 */ curve25519_square_packed64(sq, nq); /* sq = nq^2 */
curve25519_121665_packed64(sqscalar, sq); /* sqscalar = sq * [121666,121665] */ curve25519_121665_packed64(sqscalar, sq); /* sqscalar = sq * [121666,121665] */

View File

@ -94,8 +94,6 @@ private:
#if !defined(__BORLANDC__) #if !defined(__BORLANDC__)
// ensure there was no underflow in the math // ensure there was no underflow in the math
CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200); CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200);
// this is a general expectation by HMAC
CRYPTOPP_COMPILE_ASSERT((int)BLOCKSIZE > (int)DIGESTSIZE);
#endif #endif
}; };

View File

@ -24,6 +24,9 @@
#ifdef CRYPTOPP_WIN32_AVAILABLE #ifdef CRYPTOPP_WIN32_AVAILABLE
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#ifndef ERROR_INCORRECT_SIZE
# define ERROR_INCORRECT_SIZE 0x000005B6
#endif
#if defined(USE_MS_CRYPTOAPI) #if defined(USE_MS_CRYPTOAPI)
#include <wincrypt.h> #include <wincrypt.h>
#ifndef CRYPT_NEWKEYSET #ifndef CRYPT_NEWKEYSET
@ -44,7 +47,7 @@
# define STATUS_INVALID_HANDLE 0xC0000008 # define STATUS_INVALID_HANDLE 0xC0000008
#endif #endif
#endif #endif
#endif #endif // Win32
#ifdef CRYPTOPP_UNIX_AVAILABLE #ifdef CRYPTOPP_UNIX_AVAILABLE
#include <errno.h> #include <errno.h>

2
sha3.h
View File

@ -82,8 +82,6 @@ private:
#if !defined(__BORLANDC__) #if !defined(__BORLANDC__)
// ensure there was no underflow in the math // ensure there was no underflow in the math
CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200); CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200);
// this is a general expectation by HMAC
CRYPTOPP_COMPILE_ASSERT((int)BLOCKSIZE > (int)DIGESTSIZE);
#endif #endif
}; };

View File

@ -93,8 +93,6 @@ private:
#if !defined(__BORLANDC__) #if !defined(__BORLANDC__)
// ensure there was no underflow in the math // ensure there was no underflow in the math
CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200); CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200);
// this is a general expectation by HMAC
CRYPTOPP_COMPILE_ASSERT((int)BLOCKSIZE > (int)DIGESTSIZE);
#endif #endif
}; };

View File

@ -507,7 +507,7 @@ void SetArgvPathHint(const char* argv0, std::string& pathHint)
#if defined(AT_EXECFN) #if defined(AT_EXECFN)
if (getauxval(AT_EXECFN)) if (getauxval(AT_EXECFN))
pathHint = getauxval(AT_EXECFN); pathHint = getauxval(AT_EXECFN);
#elif defined(_MSC_VER) #elif defined(_MSC_VER) && (_MSC_VER > 1310)
char* pgmptr = NULLPTR; char* pgmptr = NULLPTR;
errno_t err = _get_pgmptr(&pgmptr); errno_t err = _get_pgmptr(&pgmptr);
if (err == 0 && pgmptr != NULLPTR) if (err == 0 && pgmptr != NULLPTR)