Change next version from 5.7 to 6.0

Crypto++ 5.7 was the increment after the 5.6.5 release. Crypto++ 6.0 accurately reflects compatibility
pull/354/merge
Jeffrey Walton 2017-02-21 12:59:20 -05:00
parent 8c20630c2d
commit 62f92dd592
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
17 changed files with 58 additions and 52 deletions

View File

@ -41,7 +41,7 @@ PROJECT_NAME = Crypto++
# could be handy for archiving the generated documentation or if some version # could be handy for archiving the generated documentation or if some version
# control system is used. # control system is used.
PROJECT_NUMBER = 5.7.0 PROJECT_NUMBER = 6.0.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description # Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a # for a project that appears at the top of each page and should give viewer a

View File

@ -66,7 +66,7 @@
// the version of the library the headers came from. It is not // the version of the library the headers came from. It is not
// necessarily the version of the library built as a shared object if // necessarily the version of the library built as a shared object if
// versions are inadvertently mixed and matched. // versions are inadvertently mixed and matched.
#define CRYPTOPP_VERSION 570 #define CRYPTOPP_VERSION 600
// Define this if you want to set a prefix for TestData/ and TestVectors/ // Define this if you want to set a prefix for TestData/ and TestVectors/
// Be mindful of the trailing slash since its simple concatenation. // Be mindful of the trailing slash since its simple concatenation.

View File

@ -3,7 +3,7 @@
//! \file cryptlib.h //! \file cryptlib.h
//! \brief Abstract base classes that provide a uniform interface to this library. //! \brief Abstract base classes that provide a uniform interface to this library.
/*! \mainpage Crypto++ Library 5.7 API Reference /*! \mainpage Crypto++ Library 6.0 API Reference
<dl> <dl>
<dt>Abstract Base Classes<dd> <dt>Abstract Base Classes<dd>
cryptlib.h cryptlib.h
@ -2944,7 +2944,7 @@ public:
//! } //! }
//! </pre> //! </pre>
//! \sa HeaderVersion(), <A HREF="http://github.com/weidai11/cryptopp/issues/371">GitHub Issue 371</A>. //! \sa HeaderVersion(), <A HREF="http://github.com/weidai11/cryptopp/issues/371">GitHub Issue 371</A>.
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
extern "C" { extern "C" {
int LibraryVersion(); int LibraryVersion();
} // C linkage } // C linkage
@ -2976,7 +2976,7 @@ extern "C" {
//! } //! }
//! </pre> //! </pre>
//! \sa LibraryVersion(), <A HREF="http://github.com/weidai11/cryptopp/issues/371">GitHub Issue 371</A>. //! \sa LibraryVersion(), <A HREF="http://github.com/weidai11/cryptopp/issues/371">GitHub Issue 371</A>.
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
extern "C" { extern "C" {
inline int HeaderVersion() inline int HeaderVersion()
{ {

8
drbg.h
View File

@ -4,7 +4,7 @@
//! \brief Classes for NIST DRBGs from SP 800-90A //! \brief Classes for NIST DRBGs from SP 800-90A
//! \sa <A HREF="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf">Recommendation //! \sa <A HREF="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf">Recommendation
//! for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)</A> //! for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)</A>
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
#ifndef CRYPTOPP_NIST_DRBG_H #ifndef CRYPTOPP_NIST_DRBG_H
#define CRYPTOPP_NIST_DRBG_H #define CRYPTOPP_NIST_DRBG_H
@ -19,7 +19,7 @@ NAMESPACE_BEGIN(CryptoPP)
//! \details NIST_DRBG is the base class interface for NIST DRBGs from SP 800-90A Rev 1 (June 2015) //! \details NIST_DRBG is the base class interface for NIST DRBGs from SP 800-90A Rev 1 (June 2015)
//! \sa <A HREF="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf">Recommendation //! \sa <A HREF="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf">Recommendation
//! for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)</A> //! for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)</A>
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
class NIST_DRBG : public RandomNumberGenerator class NIST_DRBG : public RandomNumberGenerator
{ {
public: public:
@ -152,7 +152,7 @@ protected:
//! before a reseed. However, Hash_DRBG limits it to <tt>INT_MAX</tt> due to the limited data range of an int. //! before a reseed. However, Hash_DRBG limits it to <tt>INT_MAX</tt> due to the limited data range of an int.
//! \sa <A HREF="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf">Recommendation //! \sa <A HREF="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf">Recommendation
//! for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)</A> //! for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)</A>
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
template <typename HASH=SHA256, unsigned int STRENGTH=128/8, unsigned int SEEDLENGTH=440/8> template <typename HASH=SHA256, unsigned int STRENGTH=128/8, unsigned int SEEDLENGTH=440/8>
class Hash_DRBG : public NIST_DRBG, public NotCopyable class Hash_DRBG : public NIST_DRBG, public NotCopyable
{ {
@ -263,7 +263,7 @@ private:
//! before a reseed. However, HMAC_DRBG limits it to <tt>INT_MAX</tt> due to the limited data range of an int. //! before a reseed. However, HMAC_DRBG limits it to <tt>INT_MAX</tt> due to the limited data range of an int.
//! \sa <A HREF="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf">Recommendation //! \sa <A HREF="http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf">Recommendation
//! for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)</A> //! for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)</A>
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
template <typename HASH=SHA256, unsigned int STRENGTH=128/8, unsigned int SEEDLENGTH=440/8> template <typename HASH=SHA256, unsigned int STRENGTH=128/8, unsigned int SEEDLENGTH=440/8>
class HMAC_DRBG : public NIST_DRBG, public NotCopyable class HMAC_DRBG : public NIST_DRBG, public NotCopyable
{ {

View File

@ -349,7 +349,7 @@ public:
//! \tparam EC elliptic curve field //! \tparam EC elliptic curve field
//! \sa <a href="http://tools.ietf.org/rfc/rfc6979.txt">RFC 6979, Deterministic Usage of the //! \sa <a href="http://tools.ietf.org/rfc/rfc6979.txt">RFC 6979, Deterministic Usage of the
//! Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)</a> //! Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)</a>
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
template <class EC, class H> template <class EC, class H>
class DL_Algorithm_ECDSA_RFC6979 : public DL_Algorithm_DSA_RFC6979<typename EC::Point, H> class DL_Algorithm_ECDSA_RFC6979 : public DL_Algorithm_DSA_RFC6979<typename EC::Point, H>
{ {
@ -414,7 +414,7 @@ class DL_PrivateKey_ECGDSA_ISO15946;
//! \brief Elliptic Curve German DSA key for ISO/IEC 15946 //! \brief Elliptic Curve German DSA key for ISO/IEC 15946
//! \tparam EC elliptic curve field //! \tparam EC elliptic curve field
//! \sa ECGDSA_ISO15946 //! \sa ECGDSA_ISO15946
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
template <class EC> template <class EC>
class DL_PrivateKey_ECGDSA_ISO15946 : public DL_PrivateKeyImpl<DL_GroupParameters_EC<EC> > class DL_PrivateKey_ECGDSA_ISO15946 : public DL_PrivateKeyImpl<DL_GroupParameters_EC<EC> >
{ {
@ -497,7 +497,7 @@ public:
//! \brief Elliptic Curve German DSA key for ISO/IEC 15946 //! \brief Elliptic Curve German DSA key for ISO/IEC 15946
//! \tparam EC elliptic curve field //! \tparam EC elliptic curve field
//! \sa ECGDSA_ISO15946 //! \sa ECGDSA_ISO15946
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
template <class EC> template <class EC>
class DL_PublicKey_ECGDSA_ISO15946 : public DL_PublicKeyImpl<DL_GroupParameters_EC<EC> > class DL_PublicKey_ECGDSA_ISO15946 : public DL_PublicKeyImpl<DL_GroupParameters_EC<EC> >
{ {
@ -550,7 +550,7 @@ public:
//! \brief Elliptic Curve German DSA keys for ISO/IEC 15946 //! \brief Elliptic Curve German DSA keys for ISO/IEC 15946
//! \tparam EC elliptic curve field //! \tparam EC elliptic curve field
//! \sa ECGDSA_ISO15946 //! \sa ECGDSA_ISO15946
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
template <class EC> template <class EC>
struct DL_Keys_ECGDSA_ISO15946 struct DL_Keys_ECGDSA_ISO15946
{ {
@ -562,7 +562,7 @@ struct DL_Keys_ECGDSA_ISO15946
//! \brief Elliptic Curve German DSA signature algorithm //! \brief Elliptic Curve German DSA signature algorithm
//! \tparam EC elliptic curve field //! \tparam EC elliptic curve field
//! \sa ECGDSA_ISO15946 //! \sa ECGDSA_ISO15946
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
template <class EC> template <class EC>
class DL_Algorithm_ECGDSA_ISO15946 : public DL_Algorithm_GDSA_ISO15946<typename EC::Point> class DL_Algorithm_ECGDSA_ISO15946 : public DL_Algorithm_GDSA_ISO15946<typename EC::Point>
{ {
@ -576,7 +576,7 @@ public:
//! \tparam H HashTransformation derived class //! \tparam H HashTransformation derived class
//! \sa Erwin Hess, Marcus Schafheutle, and Pascale Serf <A HREF="http://www.teletrust.de/fileadmin/files/oid/ecgdsa_final.pdf">The //! \sa Erwin Hess, Marcus Schafheutle, and Pascale Serf <A HREF="http://www.teletrust.de/fileadmin/files/oid/ecgdsa_final.pdf">The
//! Digital Signature Scheme ECGDSA (October 24, 2006)</A> //! Digital Signature Scheme ECGDSA (October 24, 2006)</A>
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
template <class EC, class H> template <class EC, class H>
struct ECGDSA : public DL_SS< struct ECGDSA : public DL_SS<
DL_Keys_ECGDSA_ISO15946<EC>, DL_Keys_ECGDSA_ISO15946<EC>,

View File

@ -3,7 +3,7 @@
//! \file ecpoint.h //! \file ecpoint.h
//! \brief Classes for Elliptic Curve points //! \brief Classes for Elliptic Curve points
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
#ifndef CRYPTOPP_ECPOINT_H #ifndef CRYPTOPP_ECPOINT_H
#define CRYPTOPP_ECPOINT_H #define CRYPTOPP_ECPOINT_H
@ -88,7 +88,7 @@ CRYPTOPP_DLL_TEMPLATE_CLASS AbstractGroup<EC2NPoint>;
//! \tparam Point ellicptic curve point //! \tparam Point ellicptic curve point
//! \details EncodedPoint is an interface for encoding and decoding elliptic curve points. //! \details EncodedPoint is an interface for encoding and decoding elliptic curve points.
//! The template parameter <tt>Point</tt> should be a class like ECP or EC2N. //! The template parameter <tt>Point</tt> should be a class like ECP or EC2N.
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
template <class Point> template <class Point>
class EncodedPoint class EncodedPoint
{ {

View File

@ -489,7 +489,7 @@ struct BlockPaddingSchemeDef
//! \brief W3C padding added to a block //! \brief W3C padding added to a block
//! \sa <A HREF="http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html">XML //! \sa <A HREF="http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html">XML
//! Encryption Syntax and Processing</A> //! Encryption Syntax and Processing</A>
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
W3C_PADDING, W3C_PADDING,
//! \brief Default padding scheme //! \brief Default padding scheme
//! \since Crypto++ 5.0 //! \since Crypto++ 5.0

View File

@ -232,7 +232,7 @@ public:
//! \tparam H HashTransformation derived class //! \tparam H HashTransformation derived class
//! \sa <a href="http://tools.ietf.org/rfc/rfc6979.txt">RFC 6979, Deterministic Usage of the //! \sa <a href="http://tools.ietf.org/rfc/rfc6979.txt">RFC 6979, Deterministic Usage of the
//! Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)</a> //! Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)</a>
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
template <class T, class H> template <class T, class H>
class DL_Algorithm_DSA_RFC6979 : public DL_Algorithm_GDSA<T>, public DeterministicSignatureAlgorithm class DL_Algorithm_DSA_RFC6979 : public DL_Algorithm_GDSA<T>, public DeterministicSignatureAlgorithm
{ {

View File

@ -383,7 +383,7 @@ public:
//! does not attempt to interpret bits, and the result is always POSITIVE. If needed, //! does not attempt to interpret bits, and the result is always POSITIVE. If needed,
//! the integer should be converted to a 2's compliment representation before performing //! the integer should be converted to a 2's compliment representation before performing
//! the operation. //! the operation.
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
Integer& operator&=(const Integer& t); Integer& operator&=(const Integer& t);
//! \brief Bitwise OR Assignment //! \brief Bitwise OR Assignment
//! \param t the second Integer //! \param t the second Integer
@ -395,7 +395,7 @@ public:
//! does not attempt to interpret bits, and the result is always POSITIVE. If needed, //! does not attempt to interpret bits, and the result is always POSITIVE. If needed,
//! the integer should be converted to a 2's compliment representation before performing //! the integer should be converted to a 2's compliment representation before performing
//! the operation. //! the operation.
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
Integer& operator|=(const Integer& t); Integer& operator|=(const Integer& t);
//! \brief Bitwise XOR Assignment //! \brief Bitwise XOR Assignment
//! \param t the other Integer //! \param t the other Integer
@ -407,7 +407,7 @@ public:
//! does not attempt to interpret bits, and the result is always POSITIVE. If needed, //! does not attempt to interpret bits, and the result is always POSITIVE. If needed,
//! the integer should be converted to a 2's compliment representation before performing //! the integer should be converted to a 2's compliment representation before performing
//! the operation. //! the operation.
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
Integer& operator^=(const Integer& t); Integer& operator^=(const Integer& t);
//! \brief Set this Integer to random integer //! \brief Set this Integer to random integer
@ -524,7 +524,7 @@ public:
//! does not attempt to interpret bits, and the result is always POSITIVE. If needed, //! does not attempt to interpret bits, and the result is always POSITIVE. If needed,
//! the integer should be converted to a 2's compliment representation before performing //! the integer should be converted to a 2's compliment representation before performing
//! the operation. //! the operation.
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
Integer And(const Integer&) const; Integer And(const Integer&) const;
//! \brief Bitwise OR //! \brief Bitwise OR
@ -537,7 +537,7 @@ public:
//! does not attempt to interpret bits, and the result is always POSITIVE. If needed, //! does not attempt to interpret bits, and the result is always POSITIVE. If needed,
//! the integer should be converted to a 2's compliment representation before performing //! the integer should be converted to a 2's compliment representation before performing
//! the operation. //! the operation.
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
Integer Or(const Integer&) const; Integer Or(const Integer&) const;
//! \brief Bitwise XOR //! \brief Bitwise XOR
@ -550,7 +550,7 @@ public:
//! does not attempt to interpret bits, and the result is always POSITIVE. If needed, //! does not attempt to interpret bits, and the result is always POSITIVE. If needed,
//! the integer should be converted to a 2's compliment representation before performing //! the integer should be converted to a 2's compliment representation before performing
//! the operation. //! the operation.
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
Integer Xor(const Integer&) const; Integer Xor(const Integer&) const;
//! \brief Right-shift //! \brief Right-shift
@ -685,7 +685,7 @@ inline CryptoPP::word operator%(const CryptoPP::Integer &a, CryptoPP::word b)
//! does not attempt to interpret bits, and the result is always POSITIVE. If needed, //! does not attempt to interpret bits, and the result is always POSITIVE. If needed,
//! the integer should be converted to a 2's compliment representation before performing //! the integer should be converted to a 2's compliment representation before performing
//! the operation. //! the operation.
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
inline CryptoPP::Integer operator&(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.And(b);} inline CryptoPP::Integer operator&(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.And(b);}
//! \brief Bitwise OR //! \brief Bitwise OR
@ -699,7 +699,7 @@ inline CryptoPP::Integer operator&(const CryptoPP::Integer &a, const CryptoPP::I
//! does not attempt to interpret bits, and the result is always POSITIVE. If needed, //! does not attempt to interpret bits, and the result is always POSITIVE. If needed,
//! the integer should be converted to a 2's compliment representation before performing //! the integer should be converted to a 2's compliment representation before performing
//! the operation. //! the operation.
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
inline CryptoPP::Integer operator|(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Or(b);} inline CryptoPP::Integer operator|(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Or(b);}
//! \brief Bitwise XOR //! \brief Bitwise XOR
@ -713,7 +713,7 @@ inline CryptoPP::Integer operator|(const CryptoPP::Integer &a, const CryptoPP::I
//! does not attempt to interpret bits, and the result is always POSITIVE. If needed, //! does not attempt to interpret bits, and the result is always POSITIVE. If needed,
//! the integer should be converted to a 2's compliment representation before performing //! the integer should be converted to a 2's compliment representation before performing
//! the operation. //! the operation.
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
inline CryptoPP::Integer operator^(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Xor(b);} inline CryptoPP::Integer operator^(const CryptoPP::Integer &a, const CryptoPP::Integer &b) {return a.Xor(b);}
NAMESPACE_END NAMESPACE_END

View File

@ -69,7 +69,7 @@ protected:
//! \class Keccak_224 //! \class Keccak_224
//! \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++ 6.0.0
template<unsigned int T_DigestSize> template<unsigned int T_DigestSize>
class Keccak_Final : public Keccak class Keccak_Final : public Keccak
{ {

View File

@ -39,7 +39,7 @@
//! \sa Daniel J. Bernstein <A HREF="http://cr.yp.to/mac/poly1305-20050329.pdf">The Poly1305-AES //! \sa Daniel J. Bernstein <A HREF="http://cr.yp.to/mac/poly1305-20050329.pdf">The Poly1305-AES
//! Message-Authentication Code (20050329)</A> and Andy Polyakov <A //! Message-Authentication Code (20050329)</A> and Andy Polyakov <A
//! HREF="http://www.openssl.org/blog/blog/2016/02/15/poly1305-revised/">Poly1305 Revised</A> //! HREF="http://www.openssl.org/blog/blog/2016/02/15/poly1305-revised/">Poly1305 Revised</A>
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
#ifndef CRYPTOPP_POLY1305_H #ifndef CRYPTOPP_POLY1305_H
#define CRYPTOPP_POLY1305_H #define CRYPTOPP_POLY1305_H
@ -55,7 +55,7 @@ NAMESPACE_BEGIN(CryptoPP)
//! \class Poly1305_Base //! \class Poly1305_Base
//! \brief Poly1305 message authentication code base class //! \brief Poly1305 message authentication code base class
//! \tparam T class derived from BlockCipherDocumentation with 16-byte key and 16-byte blocksize //! \tparam T class derived from BlockCipherDocumentation with 16-byte key and 16-byte blocksize
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
template <class T> template <class T>
class CRYPTOPP_NO_VTABLE Poly1305_Base : public FixedKeyLength<32, SimpleKeyingInterface::UNIQUE_IV, 16>, public MessageAuthenticationCode class CRYPTOPP_NO_VTABLE Poly1305_Base : public FixedKeyLength<32, SimpleKeyingInterface::UNIQUE_IV, 16>, public MessageAuthenticationCode
{ {
@ -141,7 +141,7 @@ protected:
//! \sa Daniel J. Bernstein <A HREF="http://cr.yp.to/mac/poly1305-20050329.pdf">The Poly1305-AES //! \sa Daniel J. Bernstein <A HREF="http://cr.yp.to/mac/poly1305-20050329.pdf">The Poly1305-AES
//! Message-Authentication Code (20050329)</A> and Andy Polyakov <A //! Message-Authentication Code (20050329)</A> and Andy Polyakov <A
//! HREF="http://www.openssl.org/blog/blog/2016/02/15/poly1305-revised/">Poly1305 Revised</A> //! HREF="http://www.openssl.org/blog/blog/2016/02/15/poly1305-revised/">Poly1305 Revised</A>
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
template <class T> template <class T>
class Poly1305 : public MessageAuthenticationCodeFinal<Poly1305_Base<T> > class Poly1305 : public MessageAuthenticationCodeFinal<Poly1305_Base<T> >
{ {

View File

@ -55,8 +55,16 @@
#if defined(CRYPTOPP_CPUID_AVAILABLE) #if defined(CRYPTOPP_CPUID_AVAILABLE)
# if defined(CRYPTOPP_MSC_VERSION) # if defined(CRYPTOPP_MSC_VERSION)
# define MASM_RDRAND_ASM_AVAILABLE 1 # if (CRYPTOPP_MSC_VERSION >= 1700)
# define MASM_RDSEED_ASM_AVAILABLE 1 # define ALL_RDRAND_INTRIN_AVAILABLE 1
# else
# define MASM_RDRAND_ASM_AVAILABLE 1
# endif
# if (CRYPTOPP_MSC_VERSION >= 1800)
# define ALL_RDSEED_INTRIN_AVAILABLE 1
# else
# define MASM_RDSEED_ASM_AVAILABLE 1
# endif
# elif defined(CRYPTOPP_LLVM_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION) # elif defined(CRYPTOPP_LLVM_CLANG_VERSION) || defined(CRYPTOPP_APPLE_CLANG_VERSION)
# define GCC_RDRAND_ASM_AVAILABLE 1 # define GCC_RDRAND_ASM_AVAILABLE 1
# define GCC_RDSEED_ASM_AVAILABLE 1 # define GCC_RDSEED_ASM_AVAILABLE 1

View File

@ -38,6 +38,8 @@ public:
class RDRAND : public RandomNumberGenerator class RDRAND : public RandomNumberGenerator
{ {
public: public:
virtual ~RDRAND() {}
std::string AlgorithmName() const {return "RDRAND";} std::string AlgorithmName() const {return "RDRAND";}
//! \brief Construct a RDRAND generator //! \brief Construct a RDRAND generator
@ -46,14 +48,10 @@ public:
//! for failed generation attempts. //! for failed generation attempts.
//! \details According to DJ of Intel, the Intel RDRAND circuit does not underflow. //! \details According to DJ of Intel, the Intel RDRAND circuit does not underflow.
//! If it did hypothetically underflow, then it would return 0 for the random value. //! If it did hypothetically underflow, then it would return 0 for the random value.
//! Its not clear what AMD's behavior will be, and what the returned value will be if //! AMD's RDRAND implementation appears to provide the same behavior except the
//! underflow occurs. //! values are not generated consistent with FIPS 140.
//! Also see <A HREF="https://lists.randombit.net/pipermail/cryptography/2016-June/007702.html">RDRAND
//! not really random with Oracle Studio 12.3 + patches</A>
RDRAND(unsigned int retries = 4) : m_retries(retries) {} RDRAND(unsigned int retries = 4) : m_retries(retries) {}
virtual ~RDRAND() {}
//! \brief Retrieve the number of retries used by the generator //! \brief Retrieve the number of retries used by the generator
//! \returns the number of times GenerateBlock() will attempt to recover from a failed generation //! \returns the number of times GenerateBlock() will attempt to recover from a failed generation
unsigned int GetRetries() const unsigned int GetRetries() const
@ -125,6 +123,8 @@ public:
class RDSEED : public RandomNumberGenerator class RDSEED : public RandomNumberGenerator
{ {
public: public:
virtual ~RDSEED() {}
std::string AlgorithmName() const {return "RDSEED";} std::string AlgorithmName() const {return "RDSEED";}
//! \brief Construct a RDSEED generator //! \brief Construct a RDSEED generator
@ -132,12 +132,10 @@ public:
//! \details RDSEED() constructs a generator with a maximum number of retires //! \details RDSEED() constructs a generator with a maximum number of retires
//! for failed generation attempts. //! for failed generation attempts.
//! \details Empirical testing under a 6th generaton i7 (6200U) shows RDSEED fails //! \details Empirical testing under a 6th generaton i7 (6200U) shows RDSEED fails
//! to fulfill requests at about 6 to 8 times the rate of RDRAND. The default //! to fulfill requests at about once every for every 256 bytes requested.
//! retries reflects the difference. //! The default retries reflects the expected ceiling when requesting 10,000 bytes.
RDSEED(unsigned int retries = 64) : m_retries(retries) {} RDSEED(unsigned int retries = 64) : m_retries(retries) {}
virtual ~RDSEED() {}
//! \brief Retrieve the number of retries used by the generator //! \brief Retrieve the number of retries used by the generator
//! \returns the number of times GenerateBlock() will attempt to recover from a failed generation //! \returns the number of times GenerateBlock() will attempt to recover from a failed generation
unsigned int GetRetries() const unsigned int GetRetries() const

View File

@ -603,7 +603,7 @@ public:
//! occur as CPU cycles are spent zeroizing unintialized memory. //! occur as CPU cycles are spent zeroizing unintialized memory.
//! \details If Assign(), New(), Grow(), CleanNew(), CleanGrow() are called, then the //! \details If Assign(), New(), Grow(), CleanNew(), CleanGrow() are called, then the
//! count is reset to its default state, which is the maxmimum number of elements. //! count is reset to its default state, which is the maxmimum number of elements.
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
void SetMark(size_t count) {m_mark = count;} void SetMark(size_t count) {m_mark = count;}
//! \brief Set contents and size from an array //! \brief Set contents and size from an array

8
sha.h
View File

@ -2,7 +2,7 @@
//! \file sha.h //! \file sha.h
//! \brief Classes for SHA-1 and SHA-2 family of message digests //! \brief Classes for SHA-1 and SHA-2 family of message digests
//! \since SHA1 since Crypto++ 1.0, SHA2 since Crypto++ 4.0, Intel SHA extensions since Crypto++ 5.7 //! \since SHA1 since Crypto++ 1.0, SHA2 since Crypto++ 4.0, Intel SHA extensions since Crypto++ 6.0
#ifndef CRYPTOPP_SHA_H #ifndef CRYPTOPP_SHA_H
#define CRYPTOPP_SHA_H #define CRYPTOPP_SHA_H
@ -21,7 +21,7 @@ NAMESPACE_BEGIN(CryptoPP)
//! \class SHA1 //! \class SHA1
//! \brief SHA-1 message digest //! \brief SHA-1 message digest
//! \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-1">SHA-1</a> //! \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-1">SHA-1</a>
//! \since Crypto++ 1.0, Intel SHA extensions since Crypto++ 5.7 //! \since Crypto++ 1.0, Intel SHA extensions since Crypto++ 6.0
class CRYPTOPP_DLL SHA1 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 20, SHA1> class CRYPTOPP_DLL SHA1 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 20, SHA1>
{ {
public: public:
@ -35,7 +35,7 @@ typedef SHA1 SHA; // for backwards compatibility
//! \class SHA256 //! \class SHA256
//! \brief SHA-256 message digest //! \brief SHA-256 message digest
//! \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-256">SHA-256</a> //! \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-256">SHA-256</a>
//! \since Crypto++ 4.0, Intel SHA extensions since Crypto++ 5.7 //! \since Crypto++ 4.0, Intel SHA extensions since Crypto++ 6.0
class CRYPTOPP_DLL SHA256 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA256, 32, true> class CRYPTOPP_DLL SHA256 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA256, 32, true>
{ {
public: public:
@ -50,7 +50,7 @@ public:
//! \class SHA224 //! \class SHA224
//! \brief SHA-224 message digest //! \brief SHA-224 message digest
//! \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-224">SHA-224</a> //! \sa <a href="http://www.weidai.com/scan-mirror/md.html#SHA-224">SHA-224</a>
//! \since Crypto++ 4.0, Intel SHA extensions since Crypto++ 5.7 //! \since Crypto++ 4.0, Intel SHA extensions since Crypto++ 6.0
class CRYPTOPP_DLL SHA224 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA224, 28, true> class CRYPTOPP_DLL SHA224 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA224, 28, true>
{ {
public: public:

2
sha3.h
View File

@ -54,7 +54,7 @@ protected:
//! \class SHA3_224 //! \class SHA3_224
//! \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++ 6.0.0
template<unsigned int T_DigestSize> template<unsigned int T_DigestSize>
class SHA3_Final : public SHA3 class SHA3_Final : public SHA3
{ {

View File

@ -21,7 +21,7 @@
//! hash.Final(...);</pre> //! hash.Final(...);</pre>
//! \sa Jean-Philippe Aumasson and Daniel J. Bernstein <A HREF="http://131002.net/siphash/siphash.pdf">SipHash: //! \sa Jean-Philippe Aumasson and Daniel J. Bernstein <A HREF="http://131002.net/siphash/siphash.pdf">SipHash:
//! a fast short-input PRF</A> //! a fast short-input PRF</A>
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
#ifndef CRYPTOPP_SIPHASH_H #ifndef CRYPTOPP_SIPHASH_H
#define CRYPTOPP_SIPHASH_H #define CRYPTOPP_SIPHASH_H
@ -135,7 +135,7 @@ private:
//! hash.Final(...);</pre> //! hash.Final(...);</pre>
//! \sa Jean-Philippe Aumasson and Daniel J. Bernstein <A HREF="http://131002.net/siphash/siphash.pdf">SipHash: //! \sa Jean-Philippe Aumasson and Daniel J. Bernstein <A HREF="http://131002.net/siphash/siphash.pdf">SipHash:
//! a fast short-input PRF</A> //! a fast short-input PRF</A>
//! \since Crypto++ 5.7 //! \since Crypto++ 6.0
template <unsigned int C=2, unsigned int D=4, bool T_128bit=false> template <unsigned int C=2, unsigned int D=4, bool T_128bit=false>
class SipHash : public SipHash_Base<C, D, T_128bit> class SipHash : public SipHash_Base<C, D, T_128bit>
{ {