Fix compile under Visual Studio 2003

pull/326/head
Jeffrey Walton 2016-10-01 04:42:42 -04:00
parent 9b64112a11
commit 395b163450
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
3 changed files with 9 additions and 7 deletions

View File

@ -70,11 +70,11 @@ protected:
//! \tparam DigestSize controls the digest size as a template parameter instead of a per-class constant //! \tparam DigestSize controls the digest size as a template parameter instead of a per-class constant
//! \brief Keccak-X message digest, template for more fine-grained typedefs //! \brief Keccak-X message digest, template for more fine-grained typedefs
//! \since Crypto++ 5.7.0 //! \since Crypto++ 5.7.0
template<unsigned int digestSize> template<unsigned int T_DigestSize>
class Keccak_Final : public Keccak class Keccak_Final : public Keccak
{ {
public: public:
CRYPTOPP_CONSTANT(DIGESTSIZE = digestSize) CRYPTOPP_CONSTANT(DIGESTSIZE = T_DigestSize)
CRYPTOPP_CONSTANT(BLOCKSIZE = 200 - 2 * DIGESTSIZE) CRYPTOPP_CONSTANT(BLOCKSIZE = 200 - 2 * DIGESTSIZE)
//! \brief Construct a Keccak-X message digest //! \brief Construct a Keccak-X message digest
@ -83,7 +83,7 @@ public:
unsigned int BlockSize() const { return BLOCKSIZE; } unsigned int BlockSize() const { return BLOCKSIZE; }
private: private:
CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200); // ensure there was no underflow in the math CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200); // ensure there was no underflow in the math
CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE > DIGESTSIZE); // this is a general expectation by HMAC CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE > T_DigestSize); // this is a general expectation by HMAC
}; };
//! \class Keccak_224 //! \class Keccak_224

6
sha3.h
View File

@ -55,11 +55,11 @@ protected:
//! \tparam DigestSize controls the digest size as a template parameter instead of a per-class constant //! \tparam DigestSize controls the digest size as a template parameter instead of a per-class constant
//! \brief SHA3-X message digest, template for more fine-grained typedefs //! \brief SHA3-X message digest, template for more fine-grained typedefs
//! \since Crypto++ 5.7.0 //! \since Crypto++ 5.7.0
template<unsigned int digestSize> template<unsigned int T_DigestSize>
class SHA3_Final : public SHA3 class SHA3_Final : public SHA3
{ {
public: public:
CRYPTOPP_CONSTANT(DIGESTSIZE = digestSize) CRYPTOPP_CONSTANT(DIGESTSIZE = T_DigestSize)
CRYPTOPP_CONSTANT(BLOCKSIZE = 200 - 2 * DIGESTSIZE) CRYPTOPP_CONSTANT(BLOCKSIZE = 200 - 2 * DIGESTSIZE)
//! \brief Construct a SHA3-X message digest //! \brief Construct a SHA3-X message digest
@ -68,7 +68,7 @@ public:
unsigned int BlockSize() const { return BLOCKSIZE; } unsigned int BlockSize() const { return BLOCKSIZE; }
private: private:
CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200); // ensure there was no underflow in the math CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE < 200); // ensure there was no underflow in the math
CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE > DIGESTSIZE); // this is a general expectation by HMAC CRYPTOPP_COMPILE_ASSERT(BLOCKSIZE > T_DigestSize); // this is a general expectation by HMAC
}; };
//! \class SHA3_224 //! \class SHA3_224

View File

@ -46,8 +46,10 @@ namespace std {
#include <climits> #include <climits>
// uintptr_t and ptrdiff_t // uintptr_t and ptrdiff_t
#if (__cplusplus < 201103L) #if (__cplusplus < 201103L) && (!defined(_MSC_VER) || (_MSC_VER >= 1400))
# include <stdint.h> # include <stdint.h>
#elif defined(_MSC_VER) && (_MSC_VER < 1400)
# include <stddef.h>
#endif #endif
#ifdef CRYPTOPP_INCLUDE_VECTOR_CC #ifdef CRYPTOPP_INCLUDE_VECTOR_CC