void BERDecodeUnsigned(BufferedTransformation &in, T &w, byte asnTag = INTEGER,
T minValue = 0, T maxValue = T(0xffffffff))
@@ -534,25 +534,25 @@ void BERDecodeUnsigned(BufferedTransformation &in, T &w, byte asnTag = INTEGER,
}
#ifdef CRYPTOPP_DOXYGEN_PROCESSING
-//! \brief Compare two OIDs for equality
-//! \param lhs the first OID
-//! \param rhs the second OID
-//! \returns true if the OIDs are equal, false otherwise
+/// \brief Compare two OIDs for equality
+/// \param lhs the first OID
+/// \param rhs the second OID
+/// \returns true if the OIDs are equal, false otherwise
inline bool operator==(const OID &lhs, const OID &rhs);
-//! \brief Compare two OIDs for inequality
-//! \param lhs the first OID
-//! \param rhs the second OID
-//! \returns true if the OIDs are not equal, false otherwise
+/// \brief Compare two OIDs for inequality
+/// \param lhs the first OID
+/// \param rhs the second OID
+/// \returns true if the OIDs are not equal, false otherwise
inline bool operator!=(const OID &lhs, const OID &rhs);
-//! \brief Compare two OIDs for ordering
-//! \param lhs the first OID
-//! \param rhs the second OID
-//! \returns true if the first OID is less than the second OID, false otherwise
-//! \details operator<() calls std::lexicographical_compare() on each element in the array of values.
+/// \brief Compare two OIDs for ordering
+/// \param lhs the first OID
+/// \param rhs the second OID
+/// \returns true if the first OID is less than the second OID, false otherwise
+/// \details operator<() calls std::lexicographical_compare() on each element in the array of values.
inline bool operator<(const OID &lhs, const OID &rhs);
-//! \brief Append a value to an OID
-//! \param lhs the OID
-//! \param rhs the value to append
+/// \brief Append a value to an OID
+/// \param lhs the OID
+/// \param rhs the value to append
inline OID operator+(const OID &lhs, unsigned long rhs);
#else
inline bool operator==(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
diff --git a/authenc.h b/authenc.h
index 95ad590f..6ff87cf2 100644
--- a/authenc.h
+++ b/authenc.h
@@ -1,21 +1,21 @@
// authenc.h - originally written and placed in the public domain by Wei Dai
-//! \file
-//! \brief Classes for authenticated encryption modes of operation
-//! \details Authenticated encryption (AE) schemes combine confidentiality and authenticity
-//! into a single mode of operation They gained traction in the early 2000's because manually
-//! combining them was error prone for the typical developer. Around that time, the desire to
-//! authenticate but not ecrypt additional data (AAD) was also identified. When both features
-//! are available from a scheme, the system is referred to as an AEAD scheme.
-//! \details Crypto++ provides four authenticated encryption modes of operation - CCM, EAX, GCM
-//! and OCB mode. All modes derive from AuthenticatedSymmetricCipherBase() and the
-//! motivation for the API, like calling AAD a "header", can be found in Bellare,
-//! Rogaway and Wagner's The EAX
-//! Mode of Operation. The EAX paper suggested a basic API to help standardize AEAD
-//! schemes in software and promote adoption of the modes.
-//! \sa Authenticated
-//! Encryption on the Crypto++ wiki.
-//! \since Crypto++ 5.6.0
+/// \file
+/// \brief Classes for authenticated encryption modes of operation
+/// \details Authenticated encryption (AE) schemes combine confidentiality and authenticity
+/// into a single mode of operation They gained traction in the early 2000's because manually
+/// combining them was error prone for the typical developer. Around that time, the desire to
+/// authenticate but not ecrypt additional data (AAD) was also identified. When both features
+/// are available from a scheme, the system is referred to as an AEAD scheme.
+/// \details Crypto++ provides four authenticated encryption modes of operation - CCM, EAX, GCM
+/// and OCB mode. All modes derive from AuthenticatedSymmetricCipherBase() and the
+/// motivation for the API, like calling AAD a "header", can be found in Bellare,
+/// Rogaway and Wagner's The EAX
+/// Mode of Operation. The EAX paper suggested a basic API to help standardize AEAD
+/// schemes in software and promote adoption of the modes.
+/// \sa Authenticated
+/// Encryption on the Crypto++ wiki.
+/// \since Crypto++ 5.6.0
#ifndef CRYPTOPP_AUTHENC_H
#define CRYPTOPP_AUTHENC_H
@@ -25,19 +25,19 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class AuthenticatedSymmetricCipherBase
-//! \brief Base class for authenticated encryption modes of operation
-//! \details AuthenticatedSymmetricCipherBase() serves as a base implementation for one direction
-//! (encryption or decryption) of a stream cipher or block cipher mode with authentication.
-//! \details Crypto++ provides four authenticated encryption modes of operation - CCM, EAX, GCM
-//! and OCB mode. All modes derive from AuthenticatedSymmetricCipherBase() and the
-//! motivation for the API, like calling AAD a "header", can be found in Bellare,
-//! Rogaway and Wagner's The EAX
-//! Mode of Operation. The EAX paper suggested a basic API to help standardize AEAD
-//! schemes in software and promote adoption of the modes.
-//! \sa Authenticated
-//! Encryption on the Crypto++ wiki.
-//! \since Crypto++ 5.6.0
+/// \class AuthenticatedSymmetricCipherBase
+/// \brief Base class for authenticated encryption modes of operation
+/// \details AuthenticatedSymmetricCipherBase() serves as a base implementation for one direction
+/// (encryption or decryption) of a stream cipher or block cipher mode with authentication.
+/// \details Crypto++ provides four authenticated encryption modes of operation - CCM, EAX, GCM
+/// and OCB mode. All modes derive from AuthenticatedSymmetricCipherBase() and the
+/// motivation for the API, like calling AAD a "header", can be found in Bellare,
+/// Rogaway and Wagner's The EAX
+/// Mode of Operation. The EAX paper suggested a basic API to help standardize AEAD
+/// schemes in software and promote adoption of the modes.
+/// \sa Authenticated
+/// Encryption on the Crypto++ wiki.
+/// \since Crypto++ 5.6.0
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedSymmetricCipherBase : public AuthenticatedSymmetricCipher
{
public:
diff --git a/base32.h b/base32.h
index 7818a220..f3318495 100644
--- a/base32.h
+++ b/base32.h
@@ -1,8 +1,8 @@
// base32.h - written and placed in the public domain by Frank Palazzolo, based on hex.cpp by Wei Dai
// extended hex alphabet added by JW in November, 2017.
-//! \file base32.h
-//! \brief Classes for Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
+/// \file base32.h
+/// \brief Classes for Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
#ifndef CRYPTOPP_BASE32_H
#define CRYPTOPP_BASE32_H
@@ -12,148 +12,148 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class Base32Encoder
-//! \brief Base32 encodes data using DUDE encoding
-//! \details Converts data to base32 using DUDE encoding. The default code is based on Differential Unicode Domain Encoding (DUDE) (draft-ietf-idn-dude-02.txt).
-//! \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
+/// \class Base32Encoder
+/// \brief Base32 encodes data using DUDE encoding
+/// \details Converts data to base32 using DUDE encoding. The default code is based on Differential Unicode Domain Encoding (DUDE) (draft-ietf-idn-dude-02.txt).
+/// \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
class Base32Encoder : public SimpleProxyFilter
{
public:
- //! \brief Construct a Base32Encoder
- //! \param attachment a BufferedTrasformation to attach to this object
- //! \param uppercase a flag indicating uppercase output
- //! \param groupSize the size of the grouping
- //! \param separator the separator to use between groups
- //! \param terminator the terminator appeand after processing
- //! \details Base32Encoder() constructs a default encoder. The constructor lacks fields for padding and
- //! line breaks. You must use IsolatedInitialize() to change the default padding character or suppress it.
- //! \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
+ /// \brief Construct a Base32Encoder
+ /// \param attachment a BufferedTrasformation to attach to this object
+ /// \param uppercase a flag indicating uppercase output
+ /// \param groupSize the size of the grouping
+ /// \param separator the separator to use between groups
+ /// \param terminator the terminator appeand after processing
+ /// \details Base32Encoder() constructs a default encoder. The constructor lacks fields for padding and
+ /// line breaks. You must use IsolatedInitialize() to change the default padding character or suppress it.
+ /// \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
Base32Encoder(BufferedTransformation *attachment = NULLPTR, bool uppercase = true, int groupSize = 0, const std::string &separator = ":", const std::string &terminator = "")
: SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
{
IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), groupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator)));
}
- //! \brief Initialize or reinitialize this object, without signal propagation
- //! \param parameters a set of NameValuePairs used to initialize this object
- //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
- //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
- //! transformations. If initialization should be propagated, then use the Initialize() function.
- //! \details The following code modifies the padding and line break parameters for an encoder:
- //!
- //! Base32Encoder encoder;
- //! AlgorithmParameters params = MakeParameters(Pad(), false)(InsertLineBreaks(), false);
- //! encoder.IsolatedInitialize(params);
- //! \details You can change the encoding to RFC 4648, Base
- //! 32 Encoding with Extended Hex Alphabet by performing the following:
- //!
- //! Base32Encoder encoder;
- //! const byte ALPHABET[] = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
- //! AlgorithmParameters params = MakeParameters(Name::EncodingLookupArray(),(const byte *)ALPHABET);
- //! encoder.IsolatedInitialize(params);
- //! \details If you change the encoding alphabet, then you will need to change the decoding alphabet \a and
- //! the decoder's lookup table.
- //! \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
+ /// \brief Initialize or reinitialize this object, without signal propagation
+ /// \param parameters a set of NameValuePairs used to initialize this object
+ /// \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
+ /// number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
+ /// transformations. If initialization should be propagated, then use the Initialize() function.
+ /// \details The following code modifies the padding and line break parameters for an encoder:
+ ///
+ /// Base32Encoder encoder;
+ /// AlgorithmParameters params = MakeParameters(Pad(), false)(InsertLineBreaks(), false);
+ /// encoder.IsolatedInitialize(params);
+ /// \details You can change the encoding to RFC 4648, Base
+ /// 32 Encoding with Extended Hex Alphabet by performing the following:
+ ///
+ /// Base32Encoder encoder;
+ /// const byte ALPHABET[] = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
+ /// AlgorithmParameters params = MakeParameters(Name::EncodingLookupArray(),(const byte *)ALPHABET);
+ /// encoder.IsolatedInitialize(params);
+ /// \details If you change the encoding alphabet, then you will need to change the decoding alphabet \a and
+ /// the decoder's lookup table.
+ /// \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
void IsolatedInitialize(const NameValuePairs ¶meters);
};
-//! \class Base32Decoder
-//! \brief Base32 decodes data using DUDE encoding
-//! \details Converts data from base32 using DUDE encoding. The default code is based on Differential Unicode Domain Encoding (DUDE) (draft-ietf-idn-dude-02.txt).
-//! \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
+/// \class Base32Decoder
+/// \brief Base32 decodes data using DUDE encoding
+/// \details Converts data from base32 using DUDE encoding. The default code is based on Differential Unicode Domain Encoding (DUDE) (draft-ietf-idn-dude-02.txt).
+/// \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
class Base32Decoder : public BaseN_Decoder
{
public:
- //! \brief Construct a Base32Decoder
- //! \param attachment a BufferedTrasformation to attach to this object
- //! \sa IsolatedInitialize() for an example of modifying a Base32Decoder after construction.
+ /// \brief Construct a Base32Decoder
+ /// \param attachment a BufferedTrasformation to attach to this object
+ /// \sa IsolatedInitialize() for an example of modifying a Base32Decoder after construction.
Base32Decoder(BufferedTransformation *attachment = NULLPTR)
: BaseN_Decoder(GetDefaultDecodingLookupArray(), 5, attachment) {}
- //! \brief Initialize or reinitialize this object, without signal propagation
- //! \param parameters a set of NameValuePairs used to initialize this object
- //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
- //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
- //! transformations. If initialization should be propagated, then use the Initialize() function.
- //! \details You can change the encoding to RFC 4648, Base
- //! 32 Encoding with Extended Hex Alphabet by performing the following:
- //!
- //! int lookup[256];
- //! const byte ALPHABET[] = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
- //! Base32Decoder::InitializeDecodingLookupArray(lookup, ALPHABET, 32, true /*insensitive*/);
- //!
- //! Base32Decoder decoder;
- //! AlgorithmParameters params = MakeParameters(Name::DecodingLookupArray(),(const int *)lookup);
- //! decoder.IsolatedInitialize(params);
- //! \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
+ /// \brief Initialize or reinitialize this object, without signal propagation
+ /// \param parameters a set of NameValuePairs used to initialize this object
+ /// \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
+ /// number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
+ /// transformations. If initialization should be propagated, then use the Initialize() function.
+ /// \details You can change the encoding to RFC 4648, Base
+ /// 32 Encoding with Extended Hex Alphabet by performing the following:
+ ///
+ /// int lookup[256];
+ /// const byte ALPHABET[] = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
+ /// Base32Decoder::InitializeDecodingLookupArray(lookup, ALPHABET, 32, true /*insensitive*/);
+ ///
+ /// Base32Decoder decoder;
+ /// AlgorithmParameters params = MakeParameters(Name::DecodingLookupArray(),(const int *)lookup);
+ /// decoder.IsolatedInitialize(params);
+ /// \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
void IsolatedInitialize(const NameValuePairs ¶meters);
private:
- //! \brief Provides the default decoding lookup table
- //! \return default decoding lookup table
+ /// \brief Provides the default decoding lookup table
+ /// \return default decoding lookup table
static const int * CRYPTOPP_API GetDefaultDecodingLookupArray();
};
-//! \class Base32HexEncoder
-//! \brief Base32 encodes data using extended hex
-//! \details Converts data to base32 using extended hex alphabet. The alphabet is different than Base32Encoder.
-//! \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder, RFC 4648, Base 32 Encoding with Extended Hex Alphabet.
-//! \since Crypto++ 6.0
+/// \class Base32HexEncoder
+/// \brief Base32 encodes data using extended hex
+/// \details Converts data to base32 using extended hex alphabet. The alphabet is different than Base32Encoder.
+/// \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder, RFC 4648, Base 32 Encoding with Extended Hex Alphabet.
+/// \since Crypto++ 6.0
class Base32HexEncoder : public SimpleProxyFilter
{
public:
- //! \brief Construct a Base32HexEncoder
- //! \param attachment a BufferedTrasformation to attach to this object
- //! \param uppercase a flag indicating uppercase output
- //! \param groupSize the size of the grouping
- //! \param separator the separator to use between groups
- //! \param terminator the terminator appeand after processing
- //! \details Base32HexEncoder() constructs a default encoder. The constructor lacks fields for padding and
- //! line breaks. You must use IsolatedInitialize() to change the default padding character or suppress it.
- //! \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
+ /// \brief Construct a Base32HexEncoder
+ /// \param attachment a BufferedTrasformation to attach to this object
+ /// \param uppercase a flag indicating uppercase output
+ /// \param groupSize the size of the grouping
+ /// \param separator the separator to use between groups
+ /// \param terminator the terminator appeand after processing
+ /// \details Base32HexEncoder() constructs a default encoder. The constructor lacks fields for padding and
+ /// line breaks. You must use IsolatedInitialize() to change the default padding character or suppress it.
+ /// \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
Base32HexEncoder(BufferedTransformation *attachment = NULLPTR, bool uppercase = true, int groupSize = 0, const std::string &separator = ":", const std::string &terminator = "")
: SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
{
IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), groupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator)));
}
- //! \brief Initialize or reinitialize this object, without signal propagation
- //! \param parameters a set of NameValuePairs used to initialize this object
- //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
- //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
- //! transformations. If initialization should be propagated, then use the Initialize() function.
- //! \details The following code modifies the padding and line break parameters for an encoder:
- //!
- //! Base32HexEncoder encoder;
- //! AlgorithmParameters params = MakeParameters(Pad(), false)(InsertLineBreaks(), false);
- //! encoder.IsolatedInitialize(params);
+ /// \brief Initialize or reinitialize this object, without signal propagation
+ /// \param parameters a set of NameValuePairs used to initialize this object
+ /// \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
+ /// number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
+ /// transformations. If initialization should be propagated, then use the Initialize() function.
+ /// \details The following code modifies the padding and line break parameters for an encoder:
+ ///
+ /// Base32HexEncoder encoder;
+ /// AlgorithmParameters params = MakeParameters(Pad(), false)(InsertLineBreaks(), false);
+ /// encoder.IsolatedInitialize(params);
void IsolatedInitialize(const NameValuePairs ¶meters);
};
-//! \class Base32HexDecoder
-//! \brief Base32 decodes data using extended hex
-//! \details Converts data from base32 using extended hex alphabet. The alphabet is different than Base32Decoder.
-//! \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder, RFC 4648, Base 32 Encoding with Extended Hex Alphabet.
-//! \since Crypto++ 6.0
+/// \class Base32HexDecoder
+/// \brief Base32 decodes data using extended hex
+/// \details Converts data from base32 using extended hex alphabet. The alphabet is different than Base32Decoder.
+/// \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder, RFC 4648, Base 32 Encoding with Extended Hex Alphabet.
+/// \since Crypto++ 6.0
class Base32HexDecoder : public BaseN_Decoder
{
public:
- //! \brief Construct a Base32HexDecoder
- //! \param attachment a BufferedTrasformation to attach to this object
- //! \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
+ /// \brief Construct a Base32HexDecoder
+ /// \param attachment a BufferedTrasformation to attach to this object
+ /// \sa Base32Encoder, Base32Decoder, Base32HexEncoder and Base32HexDecoder
Base32HexDecoder(BufferedTransformation *attachment = NULLPTR)
: BaseN_Decoder(GetDefaultDecodingLookupArray(), 5, attachment) {}
- //! \brief Initialize or reinitialize this object, without signal propagation
- //! \param parameters a set of NameValuePairs used to initialize this object
- //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
- //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
- //! transformations. If initialization should be propagated, then use the Initialize() function.
+ /// \brief Initialize or reinitialize this object, without signal propagation
+ /// \param parameters a set of NameValuePairs used to initialize this object
+ /// \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
+ /// number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
+ /// transformations. If initialization should be propagated, then use the Initialize() function.
void IsolatedInitialize(const NameValuePairs ¶meters);
private:
- //! \brief Provides the default decoding lookup table
- //! \return default decoding lookup table
+ /// \brief Provides the default decoding lookup table
+ /// \return default decoding lookup table
static const int * CRYPTOPP_API GetDefaultDecodingLookupArray();
};
diff --git a/base64.h b/base64.h
index 5213f89e..0fdcd21f 100644
--- a/base64.h
+++ b/base64.h
@@ -1,7 +1,7 @@
// base64.h - originally written and placed in the public domain by Wei Dai
-//! \file base64.h
-//! \brief Classes for the Base64Encoder, Base64Decoder, Base64URLEncoder and Base64URLDecoder
+/// \file base64.h
+/// \brief Classes for the Base64Encoder, Base64Decoder, Base64URLEncoder and Base64URLDecoder
#ifndef CRYPTOPP_BASE64_H
#define CRYPTOPP_BASE64_H
@@ -11,104 +11,104 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class Base64Encoder
-//! \brief Base64 encodes data
-//! \details Base64 encodes data per RFC 4648, Base 64 Encoding.
+/// \class Base64Encoder
+/// \brief Base64 encodes data
+/// \details Base64 encodes data per RFC 4648, Base 64 Encoding.
class Base64Encoder : public SimpleProxyFilter
{
public:
- //! \brief Construct a Base64Encoder
- //! \param attachment a BufferedTrasformation to attach to this object
- //! \param insertLineBreaks a BufferedTrasformation to attach to this object
- //! \param maxLineLength the length of a line if line breaks are used
- //! \details Base64Encoder constructs a default encoder. The constructor lacks a parameter for padding, and you must
- //! use IsolatedInitialize() to modify the Base64Encoder after construction.
- //! \sa IsolatedInitialize() for an example of modifying an encoder after construction.
+ /// \brief Construct a Base64Encoder
+ /// \param attachment a BufferedTrasformation to attach to this object
+ /// \param insertLineBreaks a BufferedTrasformation to attach to this object
+ /// \param maxLineLength the length of a line if line breaks are used
+ /// \details Base64Encoder constructs a default encoder. The constructor lacks a parameter for padding, and you must
+ /// use IsolatedInitialize() to modify the Base64Encoder after construction.
+ /// \sa IsolatedInitialize() for an example of modifying an encoder after construction.
Base64Encoder(BufferedTransformation *attachment = NULLPTR, bool insertLineBreaks = true, int maxLineLength = 72)
: SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
{
IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), insertLineBreaks)(Name::MaxLineLength(), maxLineLength));
}
- //! \brief Initialize or reinitialize this object, without signal propagation
- //! \param parameters a set of NameValuePairs used to initialize this object
- //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
- //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
- //! transformations. If initialization should be propagated, then use the Initialize() function.
- //! \details The following code modifies the padding and line break parameters for an encoder:
- //!
- //! Base64Encoder encoder;
- //! AlgorithmParameters params = MakeParameters(Pad(), false)(InsertLineBreaks(), false);
- //! encoder.IsolatedInitialize(params);
- //! \details You can change the encoding to RFC 4648 web safe alphabet by performing the following:
- //!
- //! Base64Encoder encoder;
- //! const byte ALPHABET[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
- //! AlgorithmParameters params = MakeParameters(Name::EncodingLookupArray(),(const byte *)ALPHABET);
- //! encoder.IsolatedInitialize(params);
- //! \details If you change the encoding alphabet, then you will need to change the decoding alphabet \a and
- //! the decoder's lookup table.
- //! \sa Base64URLEncoder for an encoder that provides the web safe alphabet, and Base64Decoder::IsolatedInitialize()
- //! for an example of modifying a decoder's lookup table after construction.
+ /// \brief Initialize or reinitialize this object, without signal propagation
+ /// \param parameters a set of NameValuePairs used to initialize this object
+ /// \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
+ /// number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
+ /// transformations. If initialization should be propagated, then use the Initialize() function.
+ /// \details The following code modifies the padding and line break parameters for an encoder:
+ ///
+ /// Base64Encoder encoder;
+ /// AlgorithmParameters params = MakeParameters(Pad(), false)(InsertLineBreaks(), false);
+ /// encoder.IsolatedInitialize(params);
+ /// \details You can change the encoding to RFC 4648 web safe alphabet by performing the following:
+ ///
+ /// Base64Encoder encoder;
+ /// const byte ALPHABET[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
+ /// AlgorithmParameters params = MakeParameters(Name::EncodingLookupArray(),(const byte *)ALPHABET);
+ /// encoder.IsolatedInitialize(params);
+ /// \details If you change the encoding alphabet, then you will need to change the decoding alphabet \a and
+ /// the decoder's lookup table.
+ /// \sa Base64URLEncoder for an encoder that provides the web safe alphabet, and Base64Decoder::IsolatedInitialize()
+ /// for an example of modifying a decoder's lookup table after construction.
void IsolatedInitialize(const NameValuePairs ¶meters);
};
-//! \class Base64Decoder
-//! \brief Base64 decodes data
-//! \details Base64 encodes data per RFC 4648, Base 64 Encoding.
+/// \class Base64Decoder
+/// \brief Base64 decodes data
+/// \details Base64 encodes data per RFC 4648, Base 64 Encoding.
class Base64Decoder : public BaseN_Decoder
{
public:
- //! \brief Construct a Base64Decoder
- //! \param attachment a BufferedTrasformation to attach to this object
- //! \sa IsolatedInitialize() for an example of modifying an encoder after construction.
+ /// \brief Construct a Base64Decoder
+ /// \param attachment a BufferedTrasformation to attach to this object
+ /// \sa IsolatedInitialize() for an example of modifying an encoder after construction.
Base64Decoder(BufferedTransformation *attachment = NULLPTR)
: BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}
- //! \brief Initialize or reinitialize this object, without signal propagation
- //! \param parameters a set of NameValuePairs used to initialize this object
- //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
- //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
- //! transformations. If initialization should be propagated, then use the Initialize() function.
- //! \details The default decoding alpahbet is RFC 4868. You can change the to RFC 4868 web safe alphabet
- //! by performing the following:
- //!
- //! int lookup[256];
- //! const byte ALPHABET[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
- //! Base64Decoder::InitializeDecodingLookupArray(lookup, ALPHABET, 64, false);
- //!
- //! Base64Decoder decoder;
- //! AlgorithmParameters params = MakeParameters(Name::DecodingLookupArray(),(const int *)lookup);
- //! decoder.IsolatedInitialize(params);
- //! \sa Base64URLDecoder for a decoder that provides the web safe alphabet, and Base64Encoder::IsolatedInitialize()
- //! for an example of modifying an encoder's alphabet after construction.
+ /// \brief Initialize or reinitialize this object, without signal propagation
+ /// \param parameters a set of NameValuePairs used to initialize this object
+ /// \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
+ /// number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
+ /// transformations. If initialization should be propagated, then use the Initialize() function.
+ /// \details The default decoding alpahbet is RFC 4868. You can change the to RFC 4868 web safe alphabet
+ /// by performing the following:
+ ///
+ /// int lookup[256];
+ /// const byte ALPHABET[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
+ /// Base64Decoder::InitializeDecodingLookupArray(lookup, ALPHABET, 64, false);
+ ///
+ /// Base64Decoder decoder;
+ /// AlgorithmParameters params = MakeParameters(Name::DecodingLookupArray(),(const int *)lookup);
+ /// decoder.IsolatedInitialize(params);
+ /// \sa Base64URLDecoder for a decoder that provides the web safe alphabet, and Base64Encoder::IsolatedInitialize()
+ /// for an example of modifying an encoder's alphabet after construction.
void IsolatedInitialize(const NameValuePairs ¶meters);
private:
- //! \brief Provides the default decoding lookup table
- //! \return default decoding lookup table
+ /// \brief Provides the default decoding lookup table
+ /// \return default decoding lookup table
static const int * CRYPTOPP_API GetDecodingLookupArray();
};
-//! \class Base64URLEncoder
-//! \brief Base64 encodes data using a web safe alphabet
-//! \details Base64 encodes data per RFC 4648, Base 64 Encoding
-//! with URL and Filename Safe Alphabet.
+/// \class Base64URLEncoder
+/// \brief Base64 encodes data using a web safe alphabet
+/// \details Base64 encodes data per RFC 4648, Base 64 Encoding
+/// with URL and Filename Safe Alphabet.
class Base64URLEncoder : public SimpleProxyFilter
{
public:
- //! \brief Construct a Base64URLEncoder
- //! \param attachment a BufferedTrasformation to attach to this object
- //! \param insertLineBreaks a BufferedTrasformation to attach to this object
- //! \param maxLineLength the length of a line if line breaks are used
- //! \details Base64URLEncoder() constructs a default encoder using a web safe alphabet. The constructor ignores
- //! insertLineBreaks and maxLineLength because the web and URL safe specifications don't use them. They are
- //! present in the constructor for API compatibility with Base64Encoder so it is a drop-in replacement. The
- //! constructor also disables padding on the encoder for the same reason.
- //! \details If you need line breaks or padding, then you must use IsolatedInitialize() to set them
- //! after constructing a Base64URLEncoder.
- //! \sa Base64Encoder for an encoder that provides a classic alphabet, and Base64URLEncoder::IsolatedInitialize
- //! for an example of modifying an encoder after construction.
+ /// \brief Construct a Base64URLEncoder
+ /// \param attachment a BufferedTrasformation to attach to this object
+ /// \param insertLineBreaks a BufferedTrasformation to attach to this object
+ /// \param maxLineLength the length of a line if line breaks are used
+ /// \details Base64URLEncoder() constructs a default encoder using a web safe alphabet. The constructor ignores
+ /// insertLineBreaks and maxLineLength because the web and URL safe specifications don't use them. They are
+ /// present in the constructor for API compatibility with Base64Encoder so it is a drop-in replacement. The
+ /// constructor also disables padding on the encoder for the same reason.
+ /// \details If you need line breaks or padding, then you must use IsolatedInitialize() to set them
+ /// after constructing a Base64URLEncoder.
+ /// \sa Base64Encoder for an encoder that provides a classic alphabet, and Base64URLEncoder::IsolatedInitialize
+ /// for an example of modifying an encoder after construction.
Base64URLEncoder(BufferedTransformation *attachment = NULLPTR, bool insertLineBreaks = false, int maxLineLength = -1)
: SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
{
@@ -116,44 +116,44 @@ public:
IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), false)(Name::MaxLineLength(), -1)(Name::Pad(),false));
}
- //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
- //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
- //! transformations. If initialization should be propagated, then use the Initialize() function.
- //! \details The following code modifies the padding and line break parameters for an encoder:
- //!
- //! Base64URLEncoder encoder;
- //! AlgorithmParameters params = MakeParameters(Name::Pad(), true)(Name::InsertLineBreaks(), true);
- //! encoder.IsolatedInitialize(params);
- //! \sa Base64Encoder for an encoder that provides a classic alphabet.
+ /// \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
+ /// number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
+ /// transformations. If initialization should be propagated, then use the Initialize() function.
+ /// \details The following code modifies the padding and line break parameters for an encoder:
+ ///
+ /// Base64URLEncoder encoder;
+ /// AlgorithmParameters params = MakeParameters(Name::Pad(), true)(Name::InsertLineBreaks(), true);
+ /// encoder.IsolatedInitialize(params);
+ /// \sa Base64Encoder for an encoder that provides a classic alphabet.
void IsolatedInitialize(const NameValuePairs ¶meters);
};
-//! \class Base64URLDecoder
-//! \brief Base64 decodes data using a web safe alphabet
-//! \details Base64 encodes data per RFC 4648, Base 64 Encoding
-//! with URL and Filename Safe Alphabet.
+/// \class Base64URLDecoder
+/// \brief Base64 decodes data using a web safe alphabet
+/// \details Base64 encodes data per RFC 4648, Base 64 Encoding
+/// with URL and Filename Safe Alphabet.
class Base64URLDecoder : public BaseN_Decoder
{
public:
- //! \brief Construct a Base64URLDecoder
- //! \param attachment a BufferedTrasformation to attach to this object
- //! \details Base64URLDecoder() constructs a default decoder using a web safe alphabet.
- //! \sa Base64Decoder for a decoder that provides a classic alphabet.
+ /// \brief Construct a Base64URLDecoder
+ /// \param attachment a BufferedTrasformation to attach to this object
+ /// \details Base64URLDecoder() constructs a default decoder using a web safe alphabet.
+ /// \sa Base64Decoder for a decoder that provides a classic alphabet.
Base64URLDecoder(BufferedTransformation *attachment = NULLPTR)
: BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}
- //! \brief Initialize or reinitialize this object, without signal propagation
- //! \param parameters a set of NameValuePairs used to initialize this object
- //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
- //! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on
- //! attached transformations. If initialization should be propagated, then use the Initialize() function.
- //! \sa Base64Decoder for a decoder that provides a classic alphabet, and Base64URLEncoder::IsolatedInitialize
- //! for an example of modifying an encoder after construction.
+ /// \brief Initialize or reinitialize this object, without signal propagation
+ /// \param parameters a set of NameValuePairs used to initialize this object
+ /// \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
+ /// number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on
+ /// attached transformations. If initialization should be propagated, then use the Initialize() function.
+ /// \sa Base64Decoder for a decoder that provides a classic alphabet, and Base64URLEncoder::IsolatedInitialize
+ /// for an example of modifying an encoder after construction.
void IsolatedInitialize(const NameValuePairs ¶meters);
private:
- //! \brief Provides the default decoding lookup table
- //! \return default decoding lookup table
+ /// \brief Provides the default decoding lookup table
+ /// \return default decoding lookup table
static const int * CRYPTOPP_API GetDecodingLookupArray();
};
diff --git a/basecode.h b/basecode.h
index a522d6db..1eaaae6e 100644
--- a/basecode.h
+++ b/basecode.h
@@ -1,7 +1,7 @@
// basecode.h - originally written and placed in the public domain by Wei Dai
-//! \file
-//! \brief Base classes for working with encoders and decoders.
+/// \file
+/// \brief Base classes for working with encoders and decoders.
#ifndef CRYPTOPP_BASECODE_H
#define CRYPTOPP_BASECODE_H
@@ -13,25 +13,25 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class BaseN_Encoder
-//! \brief Encoder for bases that are a power of 2
+/// \class BaseN_Encoder
+/// \brief Encoder for bases that are a power of 2
class CRYPTOPP_DLL BaseN_Encoder : public Unflushable
{
public:
- //! \brief Construct a BaseN_Encoder
- //! \param attachment a BufferedTransformation to attach to this object
+ /// \brief Construct a BaseN_Encoder
+ /// \param attachment a BufferedTransformation to attach to this object
BaseN_Encoder(BufferedTransformation *attachment=NULLPTR)
: m_alphabet(NULLPTR), m_padding(0), m_bitsPerChar(0)
, m_outputBlockSize(0), m_bytePos(0), m_bitPos(0)
{Detach(attachment);}
- //! \brief Construct a BaseN_Encoder
- //! \param alphabet table of ASCII characters to use as the alphabet
- //! \param log2base the log2base
- //! \param attachment a BufferedTransformation to attach to this object
- //! \param padding the character to use as padding
- //! \pre log2base must be between 1 and 7 inclusive
- //! \throws InvalidArgument if log2base is not between 1 and 7
+ /// \brief Construct a BaseN_Encoder
+ /// \param alphabet table of ASCII characters to use as the alphabet
+ /// \param log2base the log2base
+ /// \param attachment a BufferedTransformation to attach to this object
+ /// \param padding the character to use as padding
+ /// \pre log2base must be between 1 and 7 inclusive
+ /// \throws InvalidArgument if log2base is not between 1 and 7
BaseN_Encoder(const byte *alphabet, int log2base, BufferedTransformation *attachment=NULLPTR, int padding=-1)
: m_alphabet(NULLPTR), m_padding(0), m_bitsPerChar(0)
, m_outputBlockSize(0), m_bytePos(0), m_bitPos(0)
@@ -53,28 +53,28 @@ private:
SecByteBlock m_outBuf;
};
-//! \class BaseN_Decoder
-//! \brief Decoder for bases that are a power of 2
+/// \class BaseN_Decoder
+/// \brief Decoder for bases that are a power of 2
class CRYPTOPP_DLL BaseN_Decoder : public Unflushable
{
public:
- //! \brief Construct a BaseN_Decoder
- //! \param attachment a BufferedTransformation to attach to this object
- //! \details padding is set to -1, which means use default padding. If not
- //! required, then the value must be set via IsolatedInitialize().
+ /// \brief Construct a BaseN_Decoder
+ /// \param attachment a BufferedTransformation to attach to this object
+ /// \details padding is set to -1, which means use default padding. If not
+ /// required, then the value must be set via IsolatedInitialize().
BaseN_Decoder(BufferedTransformation *attachment=NULLPTR)
: m_lookup(NULLPTR), m_padding(0), m_bitsPerChar(0)
, m_outputBlockSize(0), m_bytePos(0), m_bitPos(0)
{Detach(attachment);}
- //! \brief Construct a BaseN_Decoder
- //! \param lookup table of values
- //! \param log2base the log2base
- //! \param attachment a BufferedTransformation to attach to this object
- //! \details log2base is the exponent (like 5 in 25), and not
- //! the number of elements (like 32).
- //! \details padding is set to -1, which means use default padding. If not
- //! required, then the value must be set via IsolatedInitialize().
+ /// \brief Construct a BaseN_Decoder
+ /// \param lookup table of values
+ /// \param log2base the log2base
+ /// \param attachment a BufferedTransformation to attach to this object
+ /// \details log2base is the exponent (like 5 in 25), and not
+ /// the number of elements (like 32).
+ /// \details padding is set to -1, which means use default padding. If not
+ /// required, then the value must be set via IsolatedInitialize().
BaseN_Decoder(const int *lookup, int log2base, BufferedTransformation *attachment=NULLPTR)
: m_lookup(NULLPTR), m_padding(0), m_bitsPerChar(0)
, m_outputBlockSize(0), m_bytePos(0), m_bitPos(0)
@@ -86,16 +86,16 @@ public:
void IsolatedInitialize(const NameValuePairs ¶meters);
size_t Put2(const byte *begin, size_t length, int messageEnd, bool blocking);
- //! \brief Initializes BaseN lookup array
- //! \param lookup table of values
- //! \param alphabet table of ASCII characters
- //! \param base the base for the encoder
- //! \param caseInsensitive flag indicating whether the alphabet is case sensitivie
- //! \pre COUNTOF(lookup) == 256
- //! \pre COUNTOF(alphabet) == base
- //! \details Internally, the function sets the first 256 elements in the lookup table to
- //! their value from the alphabet array or -1. base is the number of element (like 32),
- //! and not an exponent (like 5 in 25)
+ /// \brief Initializes BaseN lookup array
+ /// \param lookup table of values
+ /// \param alphabet table of ASCII characters
+ /// \param base the base for the encoder
+ /// \param caseInsensitive flag indicating whether the alphabet is case sensitivie
+ /// \pre COUNTOF(lookup) == 256
+ /// \pre COUNTOF(alphabet) == base
+ /// \details Internally, the function sets the first 256 elements in the lookup table to
+ /// their value from the alphabet array or -1. base is the number of element (like 32),
+ /// and not an exponent (like 5 in 25)
static void CRYPTOPP_API InitializeDecodingLookupArray(int *lookup, const byte *alphabet, unsigned int base, bool caseInsensitive);
private:
@@ -105,21 +105,21 @@ private:
SecByteBlock m_outBuf;
};
-//! \class Grouper
-//! \brief Filter that breaks input stream into groups of fixed size
+/// \class Grouper
+/// \brief Filter that breaks input stream into groups of fixed size
class CRYPTOPP_DLL Grouper : public Bufferless
{
public:
- //! \brief Construct a Grouper
- //! \param attachment a BufferedTransformation to attach to this object
+ /// \brief Construct a Grouper
+ /// \param attachment a BufferedTransformation to attach to this object
Grouper(BufferedTransformation *attachment=NULLPTR)
: m_groupSize(0), m_counter(0) {Detach(attachment);}
- //! \brief Construct a Grouper
- //! \param groupSize the size of the grouping
- //! \param separator the separator to use between groups
- //! \param terminator the terminator appeand after processing
- //! \param attachment a BufferedTransformation to attach to this object
+ /// \brief Construct a Grouper
+ /// \param groupSize the size of the grouping
+ /// \param separator the separator to use between groups
+ /// \param terminator the terminator appeand after processing
+ /// \param attachment a BufferedTransformation to attach to this object
Grouper(int groupSize, const std::string &separator, const std::string &terminator, BufferedTransformation *attachment=NULLPTR)
: m_groupSize(0), m_counter(0)
{
diff --git a/blake2.h b/blake2.h
index b3402001..2e575f93 100644
--- a/blake2.h
+++ b/blake2.h
@@ -2,17 +2,17 @@
// Wilcox-O'Hearn. Based on Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
// reference BLAKE2 implementation at http://github.com/BLAKE2/BLAKE2.
-//! \file blake2.h
-//! \brief Classes for BLAKE2b and BLAKE2s message digests and keyed message digests
-//! \details This implementation follows Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
-//! BLAKE2: simpler, smaller, fast as MD5 (2013.01.29).
-//! Static algorithm name return either "BLAKE2b" or "BLAKE2s". An object algorithm name follows
-//! the naming described in RFC 7693, The
-//! BLAKE2 Cryptographic Hash and Message Authentication Code (MAC).
-//! \details The library provides specialized SSE2, SSE4 and NEON version of the BLAKE2 compression
-//! function. For best results under ARM NEON, specify both an architecture and cpu. For example:
-//! CXXFLAGS="-DNDEBUG -march=armv8-a+crc -mcpu=cortex-a53 ..."
-//! \since Crypto++ 5.6.4
+/// \file blake2.h
+/// \brief Classes for BLAKE2b and BLAKE2s message digests and keyed message digests
+/// \details This implementation follows Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
+/// BLAKE2: simpler, smaller, fast as MD5 (2013.01.29).
+/// Static algorithm name return either "BLAKE2b" or "BLAKE2s". An object algorithm name follows
+/// the naming described in RFC 7693, The
+/// BLAKE2 Cryptographic Hash and Message Authentication Code (MAC).
+/// \details The library provides specialized SSE2, SSE4 and NEON version of the BLAKE2 compression
+/// function. For best results under ARM NEON, specify both an architecture and cpu. For example:
+/// CXXFLAGS="-DNDEBUG -march=armv8-a+crc -mcpu=cortex-a53 ..."
+/// \since Crypto++ 5.6.4
#ifndef CRYPTOPP_BLAKE2_H
#define CRYPTOPP_BLAKE2_H
@@ -23,10 +23,10 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class BLAKE2_Info
-//! \brief BLAKE2 hash information
-//! \tparam T_64bit flag indicating 64-bit
-//! \since Crypto++ 5.6.4
+/// \class BLAKE2_Info
+/// \brief BLAKE2 hash information
+/// \tparam T_64bit flag indicating 64-bit
+/// \since Crypto++ 5.6.4
template
struct BLAKE2_Info : public VariableKeyLength<(T_64bit ? 64 : 32),0,(T_64bit ? 64 : 32),1,SimpleKeyingInterface::NOT_RESYNCHRONIZABLE>
{
@@ -43,18 +43,18 @@ struct BLAKE2_Info : public VariableKeyLength<(T_64bit ? 64 : 32),0,(T_64bit ? 6
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return (T_64bit ? "BLAKE2b" : "BLAKE2s");}
};
-//! \class BLAKE2_ParameterBlock
-//! \brief BLAKE2 parameter block
-//! \tparam T_64bit flag indicating 64-bit
-//! \details BLAKE2b uses BLAKE2_ParameterBlock, while BLAKE2s
-//! uses BLAKE2_ParameterBlock.
-//! \since Crypto++ 5.6.4
+/// \class BLAKE2_ParameterBlock
+/// \brief BLAKE2 parameter block
+/// \tparam T_64bit flag indicating 64-bit
+/// \details BLAKE2b uses BLAKE2_ParameterBlock, while BLAKE2s
+/// uses BLAKE2_ParameterBlock.
+/// \since Crypto++ 5.6.4
template
struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock
{
};
-//! \brief BLAKE2b parameter block specialization
+/// \brief BLAKE2b parameter block specialization
template<>
struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock
{
@@ -89,7 +89,7 @@ struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock
byte personalization[PERSONALIZATIONSIZE];
};
-//! \brief BLAKE2s parameter block specialization
+/// \brief BLAKE2s parameter block specialization
template<>
struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock
{
@@ -124,13 +124,13 @@ struct CRYPTOPP_NO_VTABLE BLAKE2_ParameterBlock
byte personalization[PERSONALIZATIONSIZE];
};
-//! \class BLAKE2_State
-//! \brief BLAKE2 state information
-//! \tparam W word type
-//! \tparam T_64bit flag indicating 64-bit
-//! \details BLAKE2b uses BLAKE2_State, while BLAKE2s
-//! uses BLAKE2_State.
-//! \since Crypto++ 5.6.4
+/// \class BLAKE2_State
+/// \brief BLAKE2 state information
+/// \tparam W word type
+/// \tparam T_64bit flag indicating 64-bit
+/// \details BLAKE2b uses BLAKE2_State, while BLAKE2s
+/// uses BLAKE2_State.
+/// \since Crypto++ 5.6.4
template
struct CRYPTOPP_NO_VTABLE BLAKE2_State
{
@@ -150,13 +150,13 @@ struct CRYPTOPP_NO_VTABLE BLAKE2_State
size_t length;
};
-//! \class BLAKE2_Base
-//! \brief BLAKE2 hash implementation
-//! \tparam W word type
-//! \tparam T_64bit flag indicating 64-bit
-//! \details BLAKE2b uses BLAKE2_Base, while BLAKE2s
-//! uses BLAKE2_Base.
-//! \since Crypto++ 5.6.4
+/// \class BLAKE2_Base
+/// \brief BLAKE2 hash implementation
+/// \tparam W word type
+/// \tparam T_64bit flag indicating 64-bit
+/// \details BLAKE2b uses BLAKE2_Base, while BLAKE2s
+/// uses BLAKE2_Base.
+/// \since Crypto++ 5.6.4
template
class BLAKE2_Base : public SimpleKeyingInterfaceImpl >
{
@@ -177,15 +177,15 @@ public:
virtual ~BLAKE2_Base() {}
- //! \brief Retrieve the static algorithm name
- //! \returns the algorithm name (BLAKE2s or BLAKE2b)
+ /// \brief Retrieve the static algorithm name
+ /// \returns the algorithm name (BLAKE2s or BLAKE2b)
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return BLAKE2_Info::StaticAlgorithmName();}
- //! \brief Retrieve the object's name
- //! \returns the object's algorithm name following RFC 7693
- //! \details Object algorithm name follows the naming described in
- //! RFC 7693, The BLAKE2 Cryptographic Hash and
- //! Message Authentication Code (MAC). For example, "BLAKE2b-512" and "BLAKE2s-256".
+ /// \brief Retrieve the object's name
+ /// \returns the object's algorithm name following RFC 7693
+ /// \details Object algorithm name follows the naming described in
+ /// RFC 7693, The BLAKE2 Cryptographic Hash and
+ /// Message Authentication Code (MAC). For example, "BLAKE2b-512" and "BLAKE2s-256".
std::string AlgorithmName() const {return std::string(StaticAlgorithmName()) + "-" + IntToString(this->DigestSize()*8);}
unsigned int DigestSize() const {return m_digestSize;}
@@ -194,23 +194,23 @@ public:
void Update(const byte *input, size_t length);
void Restart();
- //! \brief Restart a hash with parameter block and counter
- //! \param block parameter block
- //! \param counter counter array
- //! \details Parameter block is persisted across calls to Restart().
+ /// \brief Restart a hash with parameter block and counter
+ /// \param block parameter block
+ /// \param counter counter array
+ /// \details Parameter block is persisted across calls to Restart().
void Restart(const BLAKE2_ParameterBlock& block, const W counter[2]);
- //! \brief Set tree mode
- //! \param mode the new tree mode
- //! \details BLAKE2 has two finalization flags, called State::f[0] and State::f[1].
- //! If treeMode=false (default), then State::f[1] is never set. If
- //! treeMode=true, then State::f[1] is set when State::f[0] is set.
- //! Tree mode is persisted across calls to Restart().
+ /// \brief Set tree mode
+ /// \param mode the new tree mode
+ /// \details BLAKE2 has two finalization flags, called State::f[0] and State::f[1].
+ /// If treeMode=false (default), then State::f[1] is never set. If
+ /// treeMode=true, then State::f[1] is set when State::f[0] is set.
+ /// Tree mode is persisted across calls to Restart().
void SetTreeMode(bool mode) {m_treeMode=mode;}
- //! \brief Get tree mode
- //! \returns the current tree mode
- //! \details Tree mode is persisted across calls to Restart().
+ /// \brief Get tree mode
+ /// \returns the current tree mode
+ /// \details Tree mode is persisted across calls to Restart().
bool GetTreeMode() const {return m_treeMode;}
void TruncatedFinal(byte *hash, size_t size);
@@ -236,15 +236,15 @@ private:
bool m_treeMode;
};
-//! \brief The BLAKE2b cryptographic hash function
-//! \details BLAKE2b can function as both a hash and keyed hash. If you want only the hash,
-//! then use the BLAKE2b constructor that accepts no parameters or digest size. If you
-//! want a keyed hash, then use the constructor that accpts the key as a parameter.
-//! Once a key and digest size are selected, its effectively immutable. The Restart()
-//! method that accepts a ParameterBlock does not allow you to change it.
-//! \sa Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
-//! BLAKE2: simpler, smaller, fast as MD5 (2013.01.29).
-//! \since Crypto++ 5.6.4
+/// \brief The BLAKE2b cryptographic hash function
+/// \details BLAKE2b can function as both a hash and keyed hash. If you want only the hash,
+/// then use the BLAKE2b constructor that accepts no parameters or digest size. If you
+/// want a keyed hash, then use the constructor that accpts the key as a parameter.
+/// Once a key and digest size are selected, its effectively immutable. The Restart()
+/// method that accepts a ParameterBlock does not allow you to change it.
+/// \sa Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
+/// BLAKE2: simpler, smaller, fast as MD5 (2013.01.29).
+/// \since Crypto++ 5.6.4
class BLAKE2b : public BLAKE2_Base
{
public:
@@ -252,35 +252,35 @@ public:
typedef BLAKE2_ParameterBlock ParameterBlock;
CRYPTOPP_COMPILE_ASSERT(sizeof(ParameterBlock) == 64);
- //! \brief Construct a BLAKE2b hash
- //! \param digestSize the digest size, in bytes
- //! \param treeMode flag indicating tree mode
+ /// \brief Construct a BLAKE2b hash
+ /// \param digestSize the digest size, in bytes
+ /// \param treeMode flag indicating tree mode
BLAKE2b(bool treeMode=false, unsigned int digestSize = DIGESTSIZE) : ThisBase(treeMode, digestSize) {}
- //! \brief Construct a BLAKE2b hash
- //! \param key a byte array used to key the cipher
- //! \param keyLength the size of the byte array
- //! \param salt a byte array used as salt
- //! \param saltLength the size of the byte array
- //! \param personalization a byte array used as prsonalization string
- //! \param personalizationLength the size of the byte array
- //! \param treeMode flag indicating tree mode
- //! \param digestSize the digest size, in bytes
+ /// \brief Construct a BLAKE2b hash
+ /// \param key a byte array used to key the cipher
+ /// \param keyLength the size of the byte array
+ /// \param salt a byte array used as salt
+ /// \param saltLength the size of the byte array
+ /// \param personalization a byte array used as prsonalization string
+ /// \param personalizationLength the size of the byte array
+ /// \param treeMode flag indicating tree mode
+ /// \param digestSize the digest size, in bytes
BLAKE2b(const byte *key, size_t keyLength, const byte* salt = NULLPTR, size_t saltLength = 0,
const byte* personalization = NULLPTR, size_t personalizationLength = 0,
bool treeMode=false, unsigned int digestSize = DIGESTSIZE)
: ThisBase(key, keyLength, salt, saltLength, personalization, personalizationLength, treeMode, digestSize) {}
};
-//! \brief The BLAKE2s cryptographic hash function
-//! \details BLAKE2s can function as both a hash and keyed hash. If you want only the hash,
-//! then use the BLAKE2s constructor that accepts no parameters or digest size. If you
-//! want a keyed hash, then use the constructor that accpts the key as a parameter.
-//! Once a key and digest size are selected, its effectively immutable. The Restart()
-//! method that accepts a ParameterBlock does not allow you to change it.
-//! \sa Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
-//! BLAKE2: simpler, smaller, fast as MD5 (2013.01.29).
-//! \since Crypto++ 5.6.4
+/// \brief The BLAKE2s cryptographic hash function
+/// \details BLAKE2s can function as both a hash and keyed hash. If you want only the hash,
+/// then use the BLAKE2s constructor that accepts no parameters or digest size. If you
+/// want a keyed hash, then use the constructor that accpts the key as a parameter.
+/// Once a key and digest size are selected, its effectively immutable. The Restart()
+/// method that accepts a ParameterBlock does not allow you to change it.
+/// \sa Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
+/// BLAKE2: simpler, smaller, fast as MD5 (2013.01.29).
+/// \since Crypto++ 5.6.4
class BLAKE2s : public BLAKE2_Base
{
public:
@@ -288,20 +288,20 @@ public:
typedef BLAKE2_ParameterBlock ParameterBlock;
CRYPTOPP_COMPILE_ASSERT(sizeof(ParameterBlock) == 32);
- //! \brief Construct a BLAKE2s hash
- //! \param digestSize the digest size, in bytes
- //! \param treeMode flag indicating tree mode
+ /// \brief Construct a BLAKE2s hash
+ /// \param digestSize the digest size, in bytes
+ /// \param treeMode flag indicating tree mode
BLAKE2s(bool treeMode=false, unsigned int digestSize = DIGESTSIZE) : ThisBase(treeMode, digestSize) {}
- //! \brief Construct a BLAKE2s hash
- //! \param key a byte array used to key the cipher
- //! \param keyLength the size of the byte array
- //! \param salt a byte array used as salt
- //! \param saltLength the size of the byte array
- //! \param personalization a byte array used as prsonalization string
- //! \param personalizationLength the size of the byte array
- //! \param treeMode flag indicating tree mode
- //! \param digestSize the digest size, in bytes
+ /// \brief Construct a BLAKE2s hash
+ /// \param key a byte array used to key the cipher
+ /// \param keyLength the size of the byte array
+ /// \param salt a byte array used as salt
+ /// \param saltLength the size of the byte array
+ /// \param personalization a byte array used as prsonalization string
+ /// \param personalizationLength the size of the byte array
+ /// \param treeMode flag indicating tree mode
+ /// \param digestSize the digest size, in bytes
BLAKE2s(const byte *key, size_t keyLength, const byte* salt = NULLPTR, size_t saltLength = 0,
const byte* personalization = NULLPTR, size_t personalizationLength = 0,
bool treeMode=false, unsigned int digestSize = DIGESTSIZE)
diff --git a/blowfish.h b/blowfish.h
index fa710149..fb2a772a 100644
--- a/blowfish.h
+++ b/blowfish.h
@@ -1,7 +1,7 @@
// blowfish.h - originally written and placed in the public domain by Wei Dai
-//! \file blowfish.h
-//! \brief Classes for the Blowfish block cipher
+/// \file blowfish.h
+/// \brief Classes for the Blowfish block cipher
#ifndef CRYPTOPP_BLOWFISH_H
#define CRYPTOPP_BLOWFISH_H
@@ -11,8 +11,8 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class Blowfish_Info
-//! \brief Blowfish block cipher information
+/// \class Blowfish_Info
+/// \brief Blowfish block cipher information
struct Blowfish_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 4, 56>, public FixedRounds<16>
{
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Blowfish";}
@@ -20,14 +20,14 @@ struct Blowfish_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 4,
// Blowfish
-//! \class Blowfish
-//! \brief Blowfish block cipher
-//! \since Crypto++ 1.0
+/// \class Blowfish
+/// \brief Blowfish block cipher
+/// \since Crypto++ 1.0
class Blowfish : public Blowfish_Info, public BlockCipherDocumentation
{
- //! \class Base
- //! \brief Class specific implementation and overrides used to operate the cipher.
- //! \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions
+ /// \class Base
+ /// \brief Class specific implementation and overrides used to operate the cipher.
+ /// \details Implementations and overrides in \p Base apply to both \p ENCRYPTION and \p DECRYPTION directions
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl
{
public:
diff --git a/blumshub.h b/blumshub.h
index 54fbc0f0..1827f47b 100644
--- a/blumshub.h
+++ b/blumshub.h
@@ -1,8 +1,8 @@
// blumshub.h - originally written and placed in the public domain by Wei Dai
-//! \file
-//! \headerfile blumshub.h
-//! \brief Classes for Blum Blum Shub generator
+/// \file
+/// \headerfile blumshub.h
+/// \brief Classes for Blum Blum Shub generator
#ifndef CRYPTOPP_BLUMSHUB_H
#define CRYPTOPP_BLUMSHUB_H
@@ -13,7 +13,7 @@
NAMESPACE_BEGIN(CryptoPP)
-//! BlumBlumShub without factorization of the modulus
+/// BlumBlumShub without factorization of the modulus
class PublicBlumBlumShub : public RandomNumberGenerator,
public StreamTransformation
{
@@ -36,7 +36,7 @@ protected:
word maxBits, bitsLeft;
};
-//! BlumBlumShub with factorization of the modulus
+/// BlumBlumShub with factorization of the modulus
class BlumBlumShub : public PublicBlumBlumShub
{
public:
diff --git a/camellia.h b/camellia.h
index 1fa56e16..d29f9c56 100644
--- a/camellia.h
+++ b/camellia.h
@@ -1,7 +1,7 @@
// camellia.h - originally written and placed in the public domain by Wei Dai
-//! \file camellia.h
-//! \brief Classes for the Camellia block cipher
+/// \file camellia.h
+/// \brief Classes for the Camellia block cipher
#ifndef CRYPTOPP_CAMELLIA_H
#define CRYPTOPP_CAMELLIA_H
@@ -12,16 +12,16 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class Camellia_Info
-//! \brief Camellia block cipher information
+/// \class Camellia_Info
+/// \brief Camellia block cipher information
struct Camellia_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
{
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Camellia";}
};
-//! \class Camellia
-//! \brief Camellia block cipher
-//! \sa Camellia
+/// \class Camellia
+/// \brief Camellia block cipher
+/// \sa Camellia
class Camellia : public Camellia_Info, public BlockCipherDocumentation
{
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl
diff --git a/cast.h b/cast.h
index 99436c2e..89e66362 100644
--- a/cast.h
+++ b/cast.h
@@ -1,7 +1,7 @@
// cast.h - originally written and placed in the public domain by Wei Dai
-//! \file cast.h
-//! \brief Classes for the CAST-128 and CAST-256 block ciphers
+/// \file cast.h
+/// \brief Classes for the CAST-128 and CAST-256 block ciphers
#ifndef CRYPTOPP_CAST_H
#define CRYPTOPP_CAST_H
@@ -11,28 +11,28 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class CAST
-//! \brief CAST block cipher base
+/// \class CAST
+/// \brief CAST block cipher base
class CAST
{
protected:
static const word32 S[8][256];
};
-//! \class CAST128_Info
-//! \brief CAST128 block cipher information
+/// \class CAST128_Info
+/// \brief CAST128 block cipher information
struct CAST128_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 5, 16>
{
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "CAST-128";}
};
-//! \class CAST128
-//! \brief CAST128 block cipher
-//! \sa CAST-128
+/// \class CAST128
+/// \brief CAST128 block cipher
+/// \sa CAST-128
class CAST128 : public CAST128_Info, public BlockCipherDocumentation
{
- //! \class Base
- //! \brief CAST128 block cipher default operation
+ /// \class Base
+ /// \brief CAST128 block cipher default operation
class CRYPTOPP_NO_VTABLE Base : public CAST, public BlockCipherImpl
{
public:
@@ -43,16 +43,16 @@ class CAST128 : public CAST128_Info, public BlockCipherDocumentation
FixedSizeSecBlock K;
};
- //! \class Enc
- //! \brief CAST128 block cipher encryption operation
+ /// \class Enc
+ /// \brief CAST128 block cipher encryption operation
class CRYPTOPP_NO_VTABLE Enc : public Base
{
public:
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
};
- //! \class Dec
- //! \brief CAST128 block cipher decryption operation
+ /// \class Dec
+ /// \brief CAST128 block cipher decryption operation
class CRYPTOPP_NO_VTABLE Dec : public Base
{
public:
@@ -64,20 +64,20 @@ public:
typedef BlockCipherFinal Decryption;
};
-//! \class CAST256_Info
-//! \brief CAST256 block cipher information
+/// \class CAST256_Info
+/// \brief CAST256 block cipher information
struct CAST256_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 4>
{
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "CAST-256";}
};
-//! \class CAST256
-//! \brief CAST256 block cipher
-//! \sa CAST-256
+/// \class CAST256
+/// \brief CAST256 block cipher
+/// \sa CAST-256
class CAST256 : public CAST256_Info, public BlockCipherDocumentation
{
- //! \class Base
- //! \brief CAST256 block cipher default operation
+ /// \class Base
+ /// \brief CAST256 block cipher default operation
class CRYPTOPP_NO_VTABLE Base : public CAST, public BlockCipherImpl
{
public:
diff --git a/cbcmac.h b/cbcmac.h
index 985a34d1..2e0a4037 100644
--- a/cbcmac.h
+++ b/cbcmac.h
@@ -1,8 +1,8 @@
// cbcmac.h - originally written and placed in the public domain by Wei Dai
-//! \file
-//! \headerfile cbcmac.h
-//! \brief Classes for CBC MAC
+/// \file
+/// \headerfile cbcmac.h
+/// \brief Classes for CBC MAC
#ifndef CRYPTOPP_CBCMAC_H
#define CRYPTOPP_CBCMAC_H
@@ -12,7 +12,7 @@
NAMESPACE_BEGIN(CryptoPP)
-//! _
+/// _
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_MAC_Base : public MessageAuthenticationCode
{
public:
@@ -32,7 +32,7 @@ private:
unsigned int m_counter;
};
-//! CBC-MAC
+/// CBC-MAC
/*! Compatible with FIPS 113. T should be a class derived from BlockCipherDocumentation.
Secure only for fixed length messages. For variable length messages use CMAC or DMAC.
*/
diff --git a/ccm.h b/ccm.h
index c147f1af..398da200 100644
--- a/ccm.h
+++ b/ccm.h
@@ -1,8 +1,8 @@
// ccm.h - originally written and placed in the public domain by Wei Dai
-//! \file ccm.h
-//! \brief CCM block cipher mode of operation
-//! \since Crypto++ 5.6.0
+/// \file ccm.h
+/// \brief CCM block cipher mode of operation
+/// \since Crypto++ 5.6.0
#ifndef CRYPTOPP_CCM_H
#define CRYPTOPP_CCM_H
@@ -12,10 +12,10 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class CCM_Base
-//! \brief CCM block cipher base implementation
-//! \details Base implementation of the AuthenticatedSymmetricCipher interface
-//! \since Crypto++ 5.6.0
+/// \class CCM_Base
+/// \brief CCM block cipher base implementation
+/// \details Base implementation of the AuthenticatedSymmetricCipher interface
+/// \since Crypto++ 5.6.0
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CCM_Base : public AuthenticatedSymmetricCipherBase
{
public:
@@ -81,12 +81,12 @@ protected:
CTR_Mode_ExternalCipher::Encryption m_ctr;
};
-//! \class CCM_Final
-//! \brief CCM block cipher final implementation
-//! \tparam T_BlockCipher block cipher
-//! \tparam T_DefaultDigestSize default digest size, in bytes
-//! \tparam T_IsEncryption direction in which to operate the cipher
-//! \since Crypto++ 5.6.0
+/// \class CCM_Final
+/// \brief CCM block cipher final implementation
+/// \tparam T_BlockCipher block cipher
+/// \tparam T_DefaultDigestSize default digest size, in bytes
+/// \tparam T_IsEncryption direction in which to operate the cipher
+/// \since Crypto++ 5.6.0
template
class CCM_Final : public CCM_Base
{
@@ -102,16 +102,16 @@ private:
typename T_BlockCipher::Encryption m_cipher;
};
-//! \class CCM
-//! \brief CCM block cipher mode of operation
-//! \tparam T_BlockCipher block cipher
-//! \tparam T_DefaultDigestSize default digest size, in bytes
-//! \details \p CCM provides the \p Encryption and \p Decryption typedef. See GCM_Base
-//! and GCM_Final for the AuthenticatedSymmetricCipher implementation.
-//! \sa CCM Mode and
-//! Modes of Operation
-//! on the Crypto++ wiki.
-//! \since Crypto++ 5.6.0
+/// \class CCM
+/// \brief CCM block cipher mode of operation
+/// \tparam T_BlockCipher block cipher
+/// \tparam T_DefaultDigestSize default digest size, in bytes
+/// \details \p CCM provides the \p Encryption and \p Decryption typedef. See GCM_Base
+/// and GCM_Final for the AuthenticatedSymmetricCipher implementation.
+/// \sa CCM Mode and
+/// Modes of Operation
+/// on the Crypto++ wiki.
+/// \since Crypto++ 5.6.0
template
struct CCM : public AuthenticatedSymmetricCipherDocumentation
{
diff --git a/chacha.h b/chacha.h
index b07031b7..12547380 100644
--- a/chacha.h
+++ b/chacha.h
@@ -2,13 +2,13 @@
// Based on Wei Dai's Salsa20 and Bernstein's reference ChaCha
// family implementation at http://cr.yp.to/chacha.html.
-//! \file chacha.h
-//! \brief Classes for ChaCha8, ChaCha12 and ChaCha20 stream ciphers
-//! \details Crypto++ provides Bernstein and ECRYPT's ChaCha from ChaCha,
-//! a variant of Salsa20 (2008.01.28). Bernstein's implementation is _slightly_ different from the TLS working group's
-//! implementation for cipher suites TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
-//! TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, and TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256.
-//! \since Crypto++ 5.6.4
+/// \file chacha.h
+/// \brief Classes for ChaCha8, ChaCha12 and ChaCha20 stream ciphers
+/// \details Crypto++ provides Bernstein and ECRYPT's ChaCha from ChaCha,
+/// a variant of Salsa20 (2008.01.28). Bernstein's implementation is _slightly_ different from the TLS working group's
+/// implementation for cipher suites TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
+/// TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, and TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256.
+/// \since Crypto++ 5.6.4
#ifndef CRYPTOPP_CHACHA_H
#define CRYPTOPP_CHACHA_H
@@ -18,9 +18,9 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class ChaCha_Info
-//! \brief ChaCha stream cipher information
-//! \since Crypto++ 5.6.4
+/// \class ChaCha_Info
+/// \brief ChaCha stream cipher information
+/// \since Crypto++ 5.6.4
template
struct ChaCha_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterface::UNIQUE_IV, 8>, public FixedRounds
{
@@ -29,9 +29,9 @@ struct ChaCha_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterf
}
};
-//! \class ChaCha_Policy
-//! \brief ChaCha stream cipher implementation
-//! \since Crypto++ 5.6.4
+/// \class ChaCha_Policy
+/// \brief ChaCha stream cipher implementation
+/// \since Crypto++ 5.6.4
template
class CRYPTOPP_NO_VTABLE ChaCha_Policy : public AdditiveCipherConcretePolicy
{
@@ -49,36 +49,36 @@ protected:
FixedSizeAlignedSecBlock m_state;
};
-//! \class ChaCha8
-//! \brief ChaCha8 stream cipher
-//! \sa ChaCha, a variant of Salsa20 (2008.01.28).
-//! \since Crypto++ 5.6.4
+/// \class ChaCha8
+/// \brief ChaCha8 stream cipher
+/// \sa ChaCha, a variant of Salsa20 (2008.01.28).
+/// \since Crypto++ 5.6.4
struct ChaCha8 : public ChaCha_Info<8>, public SymmetricCipherDocumentation
{
typedef SymmetricCipherFinal, AdditiveCipherTemplate<> >, ChaCha_Info<8> > Encryption;
typedef Encryption Decryption;
};
-//! \class ChaCha12
-//! \brief ChaCha12 stream cipher
-//! \details Bernstein and ECRYPT's ChaCha is _slightly_ different from the TLS working group's implementation for
-//! cipher suites TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
-//! TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, and TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256.
-//! \sa ChaCha, a variant of Salsa20 (2008.01.28).
-//! \since Crypto++ 5.6.4
+/// \class ChaCha12
+/// \brief ChaCha12 stream cipher
+/// \details Bernstein and ECRYPT's ChaCha is _slightly_ different from the TLS working group's implementation for
+/// cipher suites TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
+/// TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, and TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256.
+/// \sa ChaCha, a variant of Salsa20 (2008.01.28).
+/// \since Crypto++ 5.6.4
struct ChaCha12 : public ChaCha_Info<12>, public SymmetricCipherDocumentation
{
typedef SymmetricCipherFinal, AdditiveCipherTemplate<> >, ChaCha_Info<12> > Encryption;
typedef Encryption Decryption;
};
-//! \class ChaCha20
-//! \brief ChaCha20 stream cipher
-//! \sa ChaCha, a variant of Salsa20 (2008.01.28).
-//! \details Bernstein and ECRYPT's ChaCha is _slightly_ different from the TLS working group's implementation for
-//! cipher suites TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
-//! TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, and TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256.
-//! \since Crypto++ 5.6.4
+/// \class ChaCha20
+/// \brief ChaCha20 stream cipher
+/// \sa ChaCha, a variant of Salsa20 (2008.01.28).
+/// \details Bernstein and ECRYPT's ChaCha is _slightly_ different from the TLS working group's implementation for
+/// cipher suites TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
+/// TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, and TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256.
+/// \since Crypto++ 5.6.4
struct ChaCha20 : public ChaCha_Info<20>, public SymmetricCipherDocumentation
{
typedef SymmetricCipherFinal, AdditiveCipherTemplate<> >, ChaCha_Info<20> > Encryption;
diff --git a/channels.h b/channels.h
index 9af4b461..7da9a813 100644
--- a/channels.h
+++ b/channels.h
@@ -1,8 +1,8 @@
// channels.h - originally written and placed in the public domain by Wei Dai
-//! \file
-//! \headerfile channels.h
-//! \brief Classes for multiple named channels
+/// \file
+/// \headerfile channels.h
+/// \brief Classes for multiple named channels
#ifndef CRYPTOPP_CHANNELS_H
#define CRYPTOPP_CHANNELS_H
@@ -20,7 +20,7 @@
NAMESPACE_BEGIN(CryptoPP)
#if 0
-//! Route input on default channel to different and/or multiple channels based on message sequence number
+/// Route input on default channel to different and/or multiple channels based on message sequence number
class MessageSwitch : public Sink
{
public:
@@ -93,7 +93,7 @@ protected:
ChannelRouteIterator();
};
-//! Route input to different and/or multiple channels based on channel ID
+/// Route input to different and/or multiple channels based on channel ID
class CRYPTOPP_DLL ChannelSwitch : public Multichannel, public ChannelSwitchTypedefs
{
public:
diff --git a/cmac.h b/cmac.h
index 60482277..29dfb097 100644
--- a/cmac.h
+++ b/cmac.h
@@ -1,8 +1,8 @@
// cmac.h - originally written and placed in the public domain by Wei Dai
-//! \file cmac.h
-//! \brief Classes for CMAC message authentication code
-//! \since Crypto++ 5.6.0
+/// \file cmac.h
+/// \brief Classes for CMAC message authentication code
+/// \since Crypto++ 5.6.0
#ifndef CRYPTOPP_CMAC_H
#define CRYPTOPP_CMAC_H
@@ -12,9 +12,9 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class CMAC_Base
-//! \brief CMAC base implementation
-//! \since Crypto++ 5.6.0
+/// \class CMAC_Base
+/// \brief CMAC base implementation
+/// \since Crypto++ 5.6.0
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CMAC_Base : public MessageAuthenticationCode
{
public:
@@ -38,20 +38,20 @@ protected:
unsigned int m_counter;
};
-//! \brief CMAC message authentication code
-//! \tparam T block cipher
-//! \details Template parameter T should be a class derived from BlockCipherDocumentation, for example AES, with a block size of 8, 16, or 32.
-//! \sa CMAC
-//! \since Crypto++ 5.6.0
+/// \brief CMAC message authentication code
+/// \tparam T block cipher
+/// \details Template parameter T should be a class derived from BlockCipherDocumentation, for example AES, with a block size of 8, 16, or 32.
+/// \sa CMAC
+/// \since Crypto++ 5.6.0
template
class CMAC : public MessageAuthenticationCodeImpl >, public SameKeyLengthAs
{
public:
- //! \brief Construct a CMAC
+ /// \brief Construct a CMAC
CMAC() {}
- //! \brief Construct a CMAC
- //! \param key the MAC key
- //! \param length the key size, in bytes
+ /// \brief Construct a CMAC
+ /// \param key the MAC key
+ /// \param length the key size, in bytes
CMAC(const byte *key, size_t length=SameKeyLengthAs::DEFAULT_KEYLENGTH)
{this->SetKey(key, length);}
diff --git a/config.h b/config.h
index 01e60467..8038e9e4 100644
--- a/config.h
+++ b/config.h
@@ -1,7 +1,7 @@
// config.h - originally written and placed in the public domain by Wei Dai
-//! \file config.h
-//! \brief Library configuration file
+/// \file config.h
+/// \brief Library configuration file
#ifndef CRYPTOPP_CONFIG_H
#define CRYPTOPP_CONFIG_H
@@ -163,15 +163,15 @@
#ifdef CRYPTOPP_DOXYGEN_PROCESSING
// Document the namespce exists. Put it here before CryptoPP is undefined below.
-//! \namespace CryptoPP
-//! \brief Crypto++ library namespace
-//! \details Nearly all classes are located in the CryptoPP namespace. Within
-//! the namespace, there are two additional namespaces.
-//!
-//! - Name - namespace for names used with \p NameValuePairs and documented in argnames.h
-//!
- Test - namespace for testing and benchmarks classes
-//!
- Weak - namespace for weak and wounded algorithms, like ARC4, MD5 and Pananma
-//!
+/// \namespace CryptoPP
+/// \brief Crypto++ library namespace
+/// \details Nearly all classes are located in the CryptoPP namespace. Within
+/// the namespace, there are two additional namespaces.
+///
+/// - Name - namespace for names used with \p NameValuePairs and documented in argnames.h
+///
- Test - namespace for testing and benchmarks classes
+///
- Weak - namespace for weak and wounded algorithms, like ARC4, MD5 and Pananma
+///
namespace CryptoPP { }
// Bring in the symbols fund in the weak namespace; and fold Weak1 into Weak
# define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
diff --git a/cpu.h b/cpu.h
index 481d578d..fa0158be 100644
--- a/cpu.h
+++ b/cpu.h
@@ -2,30 +2,30 @@
// updated for ARM and PowerPC by Jeffrey Walton.
// updated to split CPU_Query() and CPU_Probe() by Jeffrey Walton.
-//! \file cpu.h
-//! \brief Functions for CPU features and intrinsics
-//! \details The CPU functions are used in IA-32, ARM and PowerPC code paths. The
-//! functions provide cpu specific feature testing on IA-32, ARM and PowerPC machines.
-//! \details Feature detection uses CPUID on IA-32, like Intel and AMD. On other platforms
-//! a two-part strategy is used. First, the library attempts to *Query* the OS for a feature,
-//! like using Linux getauxval() or android_getCpuFeatures(). If that fails, then *Probe*
-//! the cpu executing an instruction and an observe a SIGILL if unsupported. The general
-//! pattern used by the library is:
-//!
-//! g_hasCRC32 = CPU_QueryCRC32() || CPU_ProbeCRC32();
-//! g_hasPMULL = CPU_QueryPMULL() || CPU_ProbePMULL();
-//! g_hasAES = CPU_QueryAES() || CPU_ProbeAES();
-//!
-//! \details Generally speaking, CPU_Query() is in the source file cpu.cpp because it
-//! does not require special architectural flags. CPU_Probe() is in a source file that recieves
-//! architectural flags, like sse-simd.cpp, neon-simd.cpp and
-//! ppc-simd.cpp. For example, compiling neon-simd.cpp on an ARM64 machine will
-//! have -march=armv8-a applied during a compile to make the instruction set architecture
-//! (ISA) available.
-//! \details The cpu probes are expensive when compared to a standard OS feature query. The library
-//! also avoids probes on Apple platforms because Apple's signal handling for SIGILLs appears to
-//! corrupt memory. CPU_Probe() will unconditionally return false for Apple platforms. OpenSSL
-//! experienced the same problem and moved away from SIGILL probes on Apple.
+/// \file cpu.h
+/// \brief Functions for CPU features and intrinsics
+/// \details The CPU functions are used in IA-32, ARM and PowerPC code paths. The
+/// functions provide cpu specific feature testing on IA-32, ARM and PowerPC machines.
+/// \details Feature detection uses CPUID on IA-32, like Intel and AMD. On other platforms
+/// a two-part strategy is used. First, the library attempts to *Query* the OS for a feature,
+/// like using Linux getauxval() or android_getCpuFeatures(). If that fails, then *Probe*
+/// the cpu executing an instruction and an observe a SIGILL if unsupported. The general
+/// pattern used by the library is:
+///
+/// g_hasCRC32 = CPU_QueryCRC32() || CPU_ProbeCRC32();
+/// g_hasPMULL = CPU_QueryPMULL() || CPU_ProbePMULL();
+/// g_hasAES = CPU_QueryAES() || CPU_ProbeAES();
+///
+/// \details Generally speaking, CPU_Query() is in the source file cpu.cpp because it
+/// does not require special architectural flags. CPU_Probe() is in a source file that recieves
+/// architectural flags, like sse-simd.cpp, neon-simd.cpp and
+/// ppc-simd.cpp. For example, compiling neon-simd.cpp on an ARM64 machine will
+/// have -march=armv8-a applied during a compile to make the instruction set architecture
+/// (ISA) available.
+/// \details The cpu probes are expensive when compared to a standard OS feature query. The library
+/// also avoids probes on Apple platforms because Apple's signal handling for SIGILLs appears to
+/// corrupt memory. CPU_Probe() will unconditionally return false for Apple platforms. OpenSSL
+/// experienced the same problem and moved away from SIGILL probes on Apple.
#ifndef CRYPTOPP_CPU_H
#define CRYPTOPP_CPU_H
@@ -103,14 +103,14 @@ CRYPTOPP_DLL void CRYPTOPP_API DetectX86Features();
CRYPTOPP_DLL bool CRYPTOPP_API CpuId(word32 func, word32 subfunc, word32 output[4]);
#endif // CRYPTOPP_DOXYGEN_PROCESSING
-//! \name IA-32 CPU FEATURES
+/// \name IA-32 CPU FEATURES
//@{
-//! \brief Determines SSE2 availability
-//! \returns true if SSE2 is determined to be available, false otherwise
-//! \details MMX, SSE and SSE2 are core processor features for x86_64, and
-//! the function always returns true for the platform.
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines SSE2 availability
+/// \returns true if SSE2 is determined to be available, false otherwise
+/// \details MMX, SSE and SSE2 are core processor features for x86_64, and
+/// the function always returns true for the platform.
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasSSE2()
{
#if CRYPTOPP_BOOL_X64
@@ -122,10 +122,10 @@ inline bool HasSSE2()
#endif
}
-//! \brief Determines SSSE3 availability
-//! \returns true if SSSE3 is determined to be available, false otherwise
-//! \details HasSSSE3() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines SSSE3 availability
+/// \returns true if SSSE3 is determined to be available, false otherwise
+/// \details HasSSSE3() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasSSSE3()
{
if (!g_x86DetectionDone)
@@ -133,10 +133,10 @@ inline bool HasSSSE3()
return g_hasSSSE3;
}
-//! \brief Determines SSE4.1 availability
-//! \returns true if SSE4.1 is determined to be available, false otherwise
-//! \details HasSSE41() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines SSE4.1 availability
+/// \returns true if SSE4.1 is determined to be available, false otherwise
+/// \details HasSSE41() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasSSE41()
{
if (!g_x86DetectionDone)
@@ -144,10 +144,10 @@ inline bool HasSSE41()
return g_hasSSE41;
}
-//! \brief Determines SSE4.2 availability
-//! \returns true if SSE4.2 is determined to be available, false otherwise
-//! \details HasSSE42() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines SSE4.2 availability
+/// \returns true if SSE4.2 is determined to be available, false otherwise
+/// \details HasSSE42() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasSSE42()
{
if (!g_x86DetectionDone)
@@ -155,10 +155,10 @@ inline bool HasSSE42()
return g_hasSSE42;
}
-//! \brief Determines AES-NI availability
-//! \returns true if AES-NI is determined to be available, false otherwise
-//! \details HasAESNI() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines AES-NI availability
+/// \returns true if AES-NI is determined to be available, false otherwise
+/// \details HasAESNI() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasAESNI()
{
if (!g_x86DetectionDone)
@@ -166,10 +166,10 @@ inline bool HasAESNI()
return g_hasAESNI;
}
-//! \brief Determines Carryless Multiply availability
-//! \returns true if pclmulqdq is determined to be available, false otherwise
-//! \details HasCLMUL() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines Carryless Multiply availability
+/// \returns true if pclmulqdq is determined to be available, false otherwise
+/// \details HasCLMUL() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasCLMUL()
{
if (!g_x86DetectionDone)
@@ -177,10 +177,10 @@ inline bool HasCLMUL()
return g_hasCLMUL;
}
-//! \brief Determines SHA availability
-//! \returns true if SHA is determined to be available, false otherwise
-//! \details HasSHA() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines SHA availability
+/// \returns true if SHA is determined to be available, false otherwise
+/// \details HasSHA() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasSHA()
{
if (!g_x86DetectionDone)
@@ -188,10 +188,10 @@ inline bool HasSHA()
return g_hasSHA;
}
-//! \brief Determines ADX availability
-//! \returns true if ADX is determined to be available, false otherwise
-//! \details HasADX() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines ADX availability
+/// \returns true if ADX is determined to be available, false otherwise
+/// \details HasADX() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasADX()
{
if (!g_x86DetectionDone)
@@ -199,10 +199,10 @@ inline bool HasADX()
return g_hasADX;
}
-//! \brief Determines if the CPU is an Intel P4
-//! \returns true if the CPU is a P4, false otherwise
-//! \details IsP4() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines if the CPU is an Intel P4
+/// \returns true if the CPU is a P4, false otherwise
+/// \details IsP4() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool IsP4()
{
if (!g_x86DetectionDone)
@@ -210,10 +210,10 @@ inline bool IsP4()
return g_isP4;
}
-//! \brief Determines RDRAND availability
-//! \returns true if RDRAND is determined to be available, false otherwise
-//! \details HasRDRAND() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines RDRAND availability
+/// \returns true if RDRAND is determined to be available, false otherwise
+/// \details HasRDRAND() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasRDRAND()
{
if (!g_x86DetectionDone)
@@ -221,10 +221,10 @@ inline bool HasRDRAND()
return g_hasRDRAND;
}
-//! \brief Determines RDSEED availability
-//! \returns true if RDSEED is determined to be available, false otherwise
-//! \details HasRDSEED() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines RDSEED availability
+/// \returns true if RDSEED is determined to be available, false otherwise
+/// \details HasRDSEED() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasRDSEED()
{
if (!g_x86DetectionDone)
@@ -232,10 +232,10 @@ inline bool HasRDSEED()
return g_hasRDSEED;
}
-//! \brief Determines Padlock RNG availability
-//! \returns true if VIA Padlock RNG is determined to be available, false otherwise
-//! \details HasPadlockRNG() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines Padlock RNG availability
+/// \returns true if VIA Padlock RNG is determined to be available, false otherwise
+/// \details HasPadlockRNG() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasPadlockRNG()
{
if (!g_x86DetectionDone)
@@ -243,10 +243,10 @@ inline bool HasPadlockRNG()
return g_hasPadlockRNG;
}
-//! \brief Determines Padlock ACE availability
-//! \returns true if VIA Padlock ACE is determined to be available, false otherwise
-//! \details HasPadlockACE() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines Padlock ACE availability
+/// \returns true if VIA Padlock ACE is determined to be available, false otherwise
+/// \details HasPadlockACE() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasPadlockACE()
{
if (!g_x86DetectionDone)
@@ -254,10 +254,10 @@ inline bool HasPadlockACE()
return g_hasPadlockACE;
}
-//! \brief Determines Padlock ACE2 availability
-//! \returns true if VIA Padlock ACE2 is determined to be available, false otherwise
-//! \details HasPadlockACE2() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines Padlock ACE2 availability
+/// \returns true if VIA Padlock ACE2 is determined to be available, false otherwise
+/// \details HasPadlockACE2() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasPadlockACE2()
{
if (!g_x86DetectionDone)
@@ -265,10 +265,10 @@ inline bool HasPadlockACE2()
return g_hasPadlockACE2;
}
-//! \brief Determines Padlock PHE availability
-//! \returns true if VIA Padlock PHE is determined to be available, false otherwise
-//! \details HasPadlockPHE() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines Padlock PHE availability
+/// \returns true if VIA Padlock PHE is determined to be available, false otherwise
+/// \details HasPadlockPHE() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasPadlockPHE()
{
if (!g_x86DetectionDone)
@@ -276,10 +276,10 @@ inline bool HasPadlockPHE()
return g_hasPadlockPHE;
}
-//! \brief Determines Padlock PMM availability
-//! \returns true if VIA Padlock PMM is determined to be available, false otherwise
-//! \details HasPadlockPMM() is a runtime check performed using CPUID
-//! \note This function is only available on Intel IA-32 platforms
+/// \brief Determines Padlock PMM availability
+/// \returns true if VIA Padlock PMM is determined to be available, false otherwise
+/// \details HasPadlockPMM() is a runtime check performed using CPUID
+/// \note This function is only available on Intel IA-32 platforms
inline bool HasPadlockPMM()
{
if (!g_x86DetectionDone)
@@ -287,14 +287,14 @@ inline bool HasPadlockPMM()
return g_hasPadlockPMM;
}
-//! \brief Provides the cache line size
-//! \returns lower bound on the size of a cache line in bytes, if available
-//! \details GetCacheLineSize() returns the lower bound on the size of a cache line, if it
-//! is available. If the value is not available at runtime, then 32 is returned for a 32-bit
-//! processor and 64 is returned for a 64-bit processor.
-//! \details x86/x32/x64 uses CPUID to determine the value and it is usually accurate. PowerPC
-//! and AIX also makes the value available to user space and it is also usually accurate. The
-//! ARM processor equivalent is a privileged instruction, so a compile time value is returned.
+/// \brief Provides the cache line size
+/// \returns lower bound on the size of a cache line in bytes, if available
+/// \details GetCacheLineSize() returns the lower bound on the size of a cache line, if it
+/// is available. If the value is not available at runtime, then 32 is returned for a 32-bit
+/// processor and 64 is returned for a 64-bit processor.
+/// \details x86/x32/x64 uses CPUID to determine the value and it is usually accurate. PowerPC
+/// and AIX also makes the value available to user space and it is also usually accurate. The
+/// ARM processor equivalent is a privileged instruction, so a compile time value is returned.
inline int GetCacheLineSize()
{
if (!g_x86DetectionDone)
@@ -316,16 +316,16 @@ extern bool g_hasNEON, g_hasPMULL, g_hasCRC32, g_hasAES, g_hasSHA1, g_hasSHA2;
void CRYPTOPP_API DetectArmFeatures();
#endif // CRYPTOPP_DOXYGEN_PROCESSING
-//! \name ARM A-32, Aarch32 and AArch64 CPU FEATURES
+/// \name ARM A-32, Aarch32 and AArch64 CPU FEATURES
//@{
-//! \brief Determine if an ARM processor has Advanced SIMD available
-//! \returns true if the hardware is capable of Advanced SIMD at runtime, false otherwise.
-//! \details Advanced SIMD instructions are available under most ARMv7, Aarch32 and Aarch64.
-//! \details Runtime support requires compile time support. When compiling with GCC, you may
-//! need to compile with -mfpu=neon (32-bit) or -march=armv8-a
-//! (64-bit). Also see ARM's __ARM_NEON preprocessor macro.
-//! \note This function is only available on ARM-32, Aarch32 and Aarch64 platforms
+/// \brief Determine if an ARM processor has Advanced SIMD available
+/// \returns true if the hardware is capable of Advanced SIMD at runtime, false otherwise.
+/// \details Advanced SIMD instructions are available under most ARMv7, Aarch32 and Aarch64.
+/// \details Runtime support requires compile time support. When compiling with GCC, you may
+/// need to compile with -mfpu=neon (32-bit) or -march=armv8-a
+/// (64-bit). Also see ARM's __ARM_NEON preprocessor macro.
+/// \note This function is only available on ARM-32, Aarch32 and Aarch64 platforms
inline bool HasNEON()
{
// ASIMD is a core feature on Aarch32 and Aarch64 like SSE2 is a core feature on x86_64
@@ -338,13 +338,13 @@ inline bool HasNEON()
#endif
}
-//! \brief Determine if an ARM processor provides Polynomial Multiplication
-//! \returns true if the hardware is capable of polynomial multiplications at runtime, false otherwise.
-//! \details The multiplication instructions are available under Aarch32 and Aarch64.
-//! \details Runtime support requires compile time support. When compiling with GCC, you may
-//! need to compile with -march=armv8-a+crypto; while Apple requires
-//! -arch arm64. Also see ARM's __ARM_FEATURE_CRYPTO preprocessor macro.
-//! \note This function is only available on ARM-32, Aarch32 and Aarch64 platforms
+/// \brief Determine if an ARM processor provides Polynomial Multiplication
+/// \returns true if the hardware is capable of polynomial multiplications at runtime, false otherwise.
+/// \details The multiplication instructions are available under Aarch32 and Aarch64.
+/// \details Runtime support requires compile time support. When compiling with GCC, you may
+/// need to compile with -march=armv8-a+crypto; while Apple requires
+/// -arch arm64. Also see ARM's __ARM_FEATURE_CRYPTO preprocessor macro.
+/// \note This function is only available on ARM-32, Aarch32 and Aarch64 platforms
inline bool HasPMULL()
{
#if defined(__aarch32__) || defined(__aarch64__)
@@ -356,14 +356,14 @@ inline bool HasPMULL()
#endif
}
-//! \brief Determine if an ARM processor has CRC32 available
-//! \returns true if the hardware is capable of CRC32 at runtime, false otherwise.
-//! \details CRC32 instructions provide access to the processor's CRC-32 and CRC-32C instructions.
-//! They are provided by ARM C Language Extensions 2.0 (ACLE 2.0) and available under Aarch32 and Aarch64.
-//! \details Runtime support requires compile time support. When compiling with GCC, you may
-//! need to compile with -march=armv8-a+crc; while Apple requires
-//! -arch arm64. Also see ARM's __ARM_FEATURE_CRC32 preprocessor macro.
-//! \note This function is only available on ARM-32, Aarch32 and Aarch64 platforms
+/// \brief Determine if an ARM processor has CRC32 available
+/// \returns true if the hardware is capable of CRC32 at runtime, false otherwise.
+/// \details CRC32 instructions provide access to the processor's CRC-32 and CRC-32C instructions.
+/// They are provided by ARM C Language Extensions 2.0 (ACLE 2.0) and available under Aarch32 and Aarch64.
+/// \details Runtime support requires compile time support. When compiling with GCC, you may
+/// need to compile with -march=armv8-a+crc; while Apple requires
+/// -arch arm64. Also see ARM's __ARM_FEATURE_CRC32 preprocessor macro.
+/// \note This function is only available on ARM-32, Aarch32 and Aarch64 platforms
inline bool HasCRC32()
{
#if defined(__aarch32__) || defined(__aarch64__)
@@ -375,14 +375,14 @@ inline bool HasCRC32()
#endif
}
-//! \brief Determine if an ARM processor has AES available
-//! \returns true if the hardware is capable of AES at runtime, false otherwise.
-//! \details AES is part of the optional Crypto extensions on Aarch32 and Aarch64. They are
-//! accessed using ARM C Language Extensions 2.0 (ACLE 2.0).
-//! \details Runtime support requires compile time support. When compiling with GCC, you may
-//! need to compile with -march=armv8-a+crypto; while Apple requires
-//! -arch arm64. Also see ARM's __ARM_FEATURE_CRYPTO preprocessor macro.
-//! \note This function is only available on ARM-32, Aarch32 and Aarch64 platforms
+/// \brief Determine if an ARM processor has AES available
+/// \returns true if the hardware is capable of AES at runtime, false otherwise.
+/// \details AES is part of the optional Crypto extensions on Aarch32 and Aarch64. They are
+/// accessed using ARM C Language Extensions 2.0 (ACLE 2.0).
+/// \details Runtime support requires compile time support. When compiling with GCC, you may
+/// need to compile with -march=armv8-a+crypto; while Apple requires
+/// -arch arm64. Also see ARM's __ARM_FEATURE_CRYPTO preprocessor macro.
+/// \note This function is only available on ARM-32, Aarch32 and Aarch64 platforms
inline bool HasAES()
{
#if defined(__aarch32__) || defined(__aarch64__)
@@ -394,14 +394,14 @@ inline bool HasAES()
#endif
}
-//! \brief Determine if an ARM processor has SHA1 available
-//! \returns true if the hardware is capable of SHA1 at runtime, false otherwise.
-//! \details SHA1 is part of the optional Crypto extensions on Aarch32 and Aarch64. They are
-//! accessed using ARM C Language Extensions 2.0 (ACLE 2.0).
-//! \details Runtime support requires compile time support. When compiling with GCC, you may
-//! need to compile with -march=armv8-a+crypto; while Apple requires
-//! -arch arm64. Also see ARM's __ARM_FEATURE_CRYPTO preprocessor macro.
-//! \note This function is only available on ARM-32, Aarch32 and Aarch64 platforms
+/// \brief Determine if an ARM processor has SHA1 available
+/// \returns true if the hardware is capable of SHA1 at runtime, false otherwise.
+/// \details SHA1 is part of the optional Crypto extensions on Aarch32 and Aarch64. They are
+/// accessed using ARM C Language Extensions 2.0 (ACLE 2.0).
+/// \details Runtime support requires compile time support. When compiling with GCC, you may
+/// need to compile with -march=armv8-a+crypto; while Apple requires
+/// -arch arm64. Also see ARM's __ARM_FEATURE_CRYPTO preprocessor macro.
+/// \note This function is only available on ARM-32, Aarch32 and Aarch64 platforms
inline bool HasSHA1()
{
#if defined(__aarch32__) || defined(__aarch64__)
@@ -413,14 +413,14 @@ inline bool HasSHA1()
#endif
}
-//! \brief Determine if an ARM processor has SHA2 available
-//! \returns true if the hardware is capable of SHA2 at runtime, false otherwise.
-//! \details SHA2 is part of the optional Crypto extensions on Aarch32 and Aarch64. They are
-//! accessed using ARM C Language Extensions 2.0 (ACLE 2.0).
-//! \details Runtime support requires compile time support. When compiling with GCC, you may
-//! need to compile with -march=armv8-a+crypto; while Apple requires
-//! -arch arm64. Also see ARM's __ARM_FEATURE_CRYPTO preprocessor macro.
-//! \note This function is only available on ARM-32, Aarch32 and Aarch64 platforms
+/// \brief Determine if an ARM processor has SHA2 available
+/// \returns true if the hardware is capable of SHA2 at runtime, false otherwise.
+/// \details SHA2 is part of the optional Crypto extensions on Aarch32 and Aarch64. They are
+/// accessed using ARM C Language Extensions 2.0 (ACLE 2.0).
+/// \details Runtime support requires compile time support. When compiling with GCC, you may
+/// need to compile with -march=armv8-a+crypto; while Apple requires
+/// -arch arm64. Also see ARM's __ARM_FEATURE_CRYPTO preprocessor macro.
+/// \note This function is only available on ARM-32, Aarch32 and Aarch64 platforms
inline bool HasSHA2()
{
#if defined(__aarch32__) || defined(__aarch64__)
@@ -448,19 +448,19 @@ extern word32 g_cacheLineSize;
void CRYPTOPP_API DetectPowerpcFeatures();
#endif // CRYPTOPP_DOXYGEN_PROCESSING
-//! \name POWERPC CPU FEATURES
+/// \name POWERPC CPU FEATURES
//@{
-//! \brief Determine if a PowerPC processor has Altivec available
-//! \returns true if the hardware is capable of Altivec at runtime, false otherwise.
-//! \details Altivec instructions are available under most modern PowerPCs.
-//! \details Runtime support requires compile time support. When compiling with GCC, you may
-//! need to compile with -mcpu=power7; while IBM XL C/C++ compilers require
-//! -qarch=pwr7 -qaltivec. Also see PowerPC's _ALTIVEC_ preprocessor macro.
-//! \details Atilvec was first available on Power4 platforms. However Crypto++ releies on unaligned
-//! loads and stores which is a Power7 feature. If the platform lacks Power7 extensions, then the
-//! GNUmakefile sets -DCRYPTOPP_DISABLE_ALTIVEC.
-//! \note This function is only available on PowerPC and PowerPC-64 platforms
+/// \brief Determine if a PowerPC processor has Altivec available
+/// \returns true if the hardware is capable of Altivec at runtime, false otherwise.
+/// \details Altivec instructions are available under most modern PowerPCs.
+/// \details Runtime support requires compile time support. When compiling with GCC, you may
+/// need to compile with -mcpu=power7; while IBM XL C/C++ compilers require
+/// -qarch=pwr7 -qaltivec. Also see PowerPC's _ALTIVEC_ preprocessor macro.
+/// \details Atilvec was first available on Power4 platforms. However Crypto++ releies on unaligned
+/// loads and stores which is a Power7 feature. If the platform lacks Power7 extensions, then the
+/// GNUmakefile sets -DCRYPTOPP_DISABLE_ALTIVEC.
+/// \note This function is only available on PowerPC and PowerPC-64 platforms
inline bool HasAltivec()
{
if (!g_PowerpcDetectionDone)
@@ -468,16 +468,16 @@ inline bool HasAltivec()
return g_hasAltivec;
}
-//! \brief Determine if a PowerPC processor has Power8 available
-//! \returns true if the hardware is capable of Power8 at runtime, false otherwise.
-//! \details Altivec instructions are available under most modern PowerPCs.
-//! \details Runtime support requires compile time support. When compiling with GCC, you may
-//! need to compile with -mcpu=power8; while IBM XL C/C++ compilers require
-//! -qarch=pwr8 -qaltivec. Also see PowerPC's _ALTIVEC_ preprocessor macro.
-//! \details Atilvec was first available on Power4 platforms. However Crypto++ releies on unaligned
-//! loads and stores which is a Power7 feature. If the platform lacks Power7 extensions, then the
-//! GNUmakefile sets -DCRYPTOPP_DISABLE_ALTIVEC.
-//! \note This function is only available on PowerPC and PowerPC-64 platforms
+/// \brief Determine if a PowerPC processor has Power8 available
+/// \returns true if the hardware is capable of Power8 at runtime, false otherwise.
+/// \details Altivec instructions are available under most modern PowerPCs.
+/// \details Runtime support requires compile time support. When compiling with GCC, you may
+/// need to compile with -mcpu=power8; while IBM XL C/C++ compilers require
+/// -qarch=pwr8 -qaltivec. Also see PowerPC's _ALTIVEC_ preprocessor macro.
+/// \details Atilvec was first available on Power4 platforms. However Crypto++ releies on unaligned
+/// loads and stores which is a Power7 feature. If the platform lacks Power7 extensions, then the
+/// GNUmakefile sets -DCRYPTOPP_DISABLE_ALTIVEC.
+/// \note This function is only available on PowerPC and PowerPC-64 platforms
inline bool HasPower7()
{
if (!g_PowerpcDetectionDone)
@@ -485,16 +485,16 @@ inline bool HasPower7()
return g_hasPower7;
}
-//! \brief Determine if a PowerPC processor has Power8 available
-//! \returns true if the hardware is capable of Power8 at runtime, false otherwise.
-//! \details Altivec instructions are available under most modern PowerPCs.
-//! \details Runtime support requires compile time support. When compiling with GCC, you may
-//! need to compile with -mcpu=power8; while IBM XL C/C++ compilers require
-//! -qarch=pwr8 -qaltivec. Also see PowerPC's _ALTIVEC_ preprocessor macro.
-//! \details Atilvec was first available on Power4 platforms. However Crypto++ releies on unaligned
-//! loads and stores which is a Power7 feature. If the platform lacks Power7 extensions, then the
-//! GNUmakefile sets -DCRYPTOPP_DISABLE_ALTIVEC.
-//! \note This function is only available on PowerPC and PowerPC-64 platforms
+/// \brief Determine if a PowerPC processor has Power8 available
+/// \returns true if the hardware is capable of Power8 at runtime, false otherwise.
+/// \details Altivec instructions are available under most modern PowerPCs.
+/// \details Runtime support requires compile time support. When compiling with GCC, you may
+/// need to compile with -mcpu=power8; while IBM XL C/C++ compilers require
+/// -qarch=pwr8 -qaltivec. Also see PowerPC's _ALTIVEC_ preprocessor macro.
+/// \details Atilvec was first available on Power4 platforms. However Crypto++ releies on unaligned
+/// loads and stores which is a Power7 feature. If the platform lacks Power7 extensions, then the
+/// GNUmakefile sets -DCRYPTOPP_DISABLE_ALTIVEC.
+/// \note This function is only available on PowerPC and PowerPC-64 platforms
inline bool HasPower8()
{
if (!g_PowerpcDetectionDone)
@@ -502,13 +502,13 @@ inline bool HasPower8()
return g_hasPower8;
}
-//! \brief Determine if a PowerPC processor has AES available
-//! \returns true if the hardware is capable of AES at runtime, false otherwise.
-//! \details AES is part of the in-crypto extensions on Power8 and Power9.
-//! \details Runtime support requires compile time support. When compiling with GCC, you may
-//! need to compile with -mcpu=power8; while IBM XL C/C++ compilers require
-//! -qarch=pwr8 -qaltivec. Also see PowerPC's __CRYPTO preprocessor macro.
-//! \note This function is only available on PowerPC and PowerPC-64 platforms
+/// \brief Determine if a PowerPC processor has AES available
+/// \returns true if the hardware is capable of AES at runtime, false otherwise.
+/// \details AES is part of the in-crypto extensions on Power8 and Power9.
+/// \details Runtime support requires compile time support. When compiling with GCC, you may
+/// need to compile with -mcpu=power8; while IBM XL C/C++ compilers require
+/// -qarch=pwr8 -qaltivec. Also see PowerPC's __CRYPTO preprocessor macro.
+/// \note This function is only available on PowerPC and PowerPC-64 platforms
inline bool HasAES()
{
if (!g_PowerpcDetectionDone)
@@ -516,13 +516,13 @@ inline bool HasAES()
return g_hasAES;
}
-//! \brief Determine if a PowerPC processor has SHA256 available
-//! \returns true if the hardware is capable of SHA256 at runtime, false otherwise.
-//! \details SHA is part of the in-crypto extensions on Power8 and Power9.
-//! \details Runtime support requires compile time support. When compiling with GCC, you may
-//! need to compile with -mcpu=power8; while IBM XL C/C++ compilers require
-//! -qarch=pwr8 -qaltivec. Also see PowerPC's __CRYPTO preprocessor macro.
-//! \note This function is only available on PowerPC and PowerPC-64 platforms
+/// \brief Determine if a PowerPC processor has SHA256 available
+/// \returns true if the hardware is capable of SHA256 at runtime, false otherwise.
+/// \details SHA is part of the in-crypto extensions on Power8 and Power9.
+/// \details Runtime support requires compile time support. When compiling with GCC, you may
+/// need to compile with -mcpu=power8; while IBM XL C/C++ compilers require
+/// -qarch=pwr8 -qaltivec. Also see PowerPC's __CRYPTO preprocessor macro.
+/// \note This function is only available on PowerPC and PowerPC-64 platforms
inline bool HasSHA256()
{
if (!g_PowerpcDetectionDone)
@@ -530,13 +530,13 @@ inline bool HasSHA256()
return g_hasSHA256;
}
-//! \brief Determine if a PowerPC processor has SHA512 available
-//! \returns true if the hardware is capable of SHA512 at runtime, false otherwise.
-//! \details SHA is part of the in-crypto extensions on Power8 and Power9.
-//! \details Runtime support requires compile time support. When compiling with GCC, you may
-//! need to compile with -mcpu=power8; while IBM XL C/C++ compilers require
-//! -qarch=pwr8 -qaltivec. Also see PowerPC's __CRYPTO preprocessor macro.
-//! \note This function is only available on PowerPC and PowerPC-64 platforms
+/// \brief Determine if a PowerPC processor has SHA512 available
+/// \returns true if the hardware is capable of SHA512 at runtime, false otherwise.
+/// \details SHA is part of the in-crypto extensions on Power8 and Power9.
+/// \details Runtime support requires compile time support. When compiling with GCC, you may
+/// need to compile with -mcpu=power8; while IBM XL C/C++ compilers require
+/// -qarch=pwr8 -qaltivec. Also see PowerPC's __CRYPTO preprocessor macro.
+/// \note This function is only available on PowerPC and PowerPC-64 platforms
inline bool HasSHA512()
{
if (!g_PowerpcDetectionDone)
@@ -544,14 +544,14 @@ inline bool HasSHA512()
return g_hasSHA512;
}
-//! \brief Provides the cache line size
-//! \returns lower bound on the size of a cache line in bytes, if available
-//! \details GetCacheLineSize() returns the lower bound on the size of a cache line, if it
-//! is available. If the value is not available at runtime, then 32 is returned for a 32-bit
-//! processor and 64 is returned for a 64-bit processor.
-//! \details x86/x32/x64 uses CPUID to determine the value and it is usually accurate. PowerPC
-//! and AIX also makes the value available to user space and it is also usually accurate. The
-//! ARM processor equivalent is a privileged instruction, so a compile time value is returned.
+/// \brief Provides the cache line size
+/// \returns lower bound on the size of a cache line in bytes, if available
+/// \details GetCacheLineSize() returns the lower bound on the size of a cache line, if it
+/// is available. If the value is not available at runtime, then 32 is returned for a 32-bit
+/// processor and 64 is returned for a 64-bit processor.
+/// \details x86/x32/x64 uses CPUID to determine the value and it is usually accurate. PowerPC
+/// and AIX also makes the value available to user space and it is also usually accurate. The
+/// ARM processor equivalent is a privileged instruction, so a compile time value is returned.
inline int GetCacheLineSize()
{
if (!g_PowerpcDetectionDone)
@@ -567,14 +567,14 @@ inline int GetCacheLineSize()
// Non-Intel systems
#if !(CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64)
-//! \brief Provides the cache line size
-//! \returns lower bound on the size of a cache line in bytes, if available
-//! \details GetCacheLineSize() returns the lower bound on the size of a cache line, if it
-//! is available. If the value is not available at runtime, then 32 is returned for a 32-bit
-//! processor and 64 is returned for a 64-bit processor.
-//! \details x86/x32/x64 uses CPUID to determine the value and it is usually accurate. PowerPC
-//! and AIX also makes the value available to user space and it is also usually accurate. The
-//! ARM processor equivalent is a privileged instruction, so a compile time value is returned.
+/// \brief Provides the cache line size
+/// \returns lower bound on the size of a cache line in bytes, if available
+/// \details GetCacheLineSize() returns the lower bound on the size of a cache line, if it
+/// is available. If the value is not available at runtime, then 32 is returned for a 32-bit
+/// processor and 64 is returned for a 64-bit processor.
+/// \details x86/x32/x64 uses CPUID to determine the value and it is usually accurate. PowerPC
+/// and AIX also makes the value available to user space and it is also usually accurate. The
+/// ARM processor equivalent is a privileged instruction, so a compile time value is returned.
inline int GetCacheLineSize()
{
return CRYPTOPP_L1_CACHE_LINE_SIZE;
diff --git a/crc.h b/crc.h
index 0334f705..08a20a64 100644
--- a/crc.h
+++ b/crc.h
@@ -1,8 +1,8 @@
// crc.h - originally written and placed in the public domain by Wei Dai
-//! \file
-//! \headerfile crc.h
-//! \brief Classes for CRC-32 and CRC-32C checksum algorithm
+/// \file
+/// \headerfile crc.h
+/// \brief Classes for CRC-32 and CRC-32C checksum algorithm
#ifndef CRYPTOPP_CRC32_H
#define CRYPTOPP_CRC32_H
@@ -21,8 +21,8 @@ const word32 CRC32_NEGL = 0xffffffffL;
#define CRC32_SHIFTED(c) (c << 8)
#endif
-//! \brief CRC-32 Checksum Calculation
-//! \details Uses CRC polynomial 0xEDB88320
+/// \brief CRC-32 Checksum Calculation
+/// \details Uses CRC polynomial 0xEDB88320
class CRC32 : public HashTransformation
{
public:
@@ -45,9 +45,9 @@ private:
word32 m_crc;
};
-//! \brief CRC-32C Checksum Calculation
-//! \details Uses CRC polynomial 0x82F63B78
-//! \since Crypto++ 5.6.4
+/// \brief CRC-32C Checksum Calculation
+/// \details Uses CRC polynomial 0x82F63B78
+/// \since Crypto++ 5.6.4
class CRC32C : public HashTransformation
{
public:
diff --git a/cryptlib.cpp b/cryptlib.cpp
index a9722159..03f0f0ff 100644
--- a/cryptlib.cpp
+++ b/cryptlib.cpp
@@ -330,28 +330,28 @@ void RandomNumberGenerator::GenerateIntoBufferedTransformation(BufferedTransform
}
}
-//! \class ClassNullRNG
-//! \brief Random Number Generator that does not produce random numbers
-//! \details ClassNullRNG can be used for functions that require a RandomNumberGenerator
-//! but don't actually use it. The class throws NotImplemented when a generation function is called.
-//! \sa NullRNG()
+/// \class ClassNullRNG
+/// \brief Random Number Generator that does not produce random numbers
+/// \details ClassNullRNG can be used for functions that require a RandomNumberGenerator
+/// but don't actually use it. The class throws NotImplemented when a generation function is called.
+/// \sa NullRNG()
class ClassNullRNG : public RandomNumberGenerator
{
public:
- //! \brief The name of the generator
- //! \returns the string \a NullRNGs
+ /// \brief The name of the generator
+ /// \returns the string \a NullRNGs
std::string AlgorithmName() const {return "NullRNG";}
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
- //! \brief An implementation that throws NotImplemented
+ /// \brief An implementation that throws NotImplemented
byte GenerateByte () {}
- //! \brief An implementation that throws NotImplemented
+ /// \brief An implementation that throws NotImplemented
unsigned int GenerateBit () {}
- //! \brief An implementation that throws NotImplemented
+ /// \brief An implementation that throws NotImplemented
word32 GenerateWord32 (word32 min, word32 max) {}
#endif
- //! \brief An implementation that throws NotImplemented
+ /// \brief An implementation that throws NotImplemented
void GenerateBlock(byte *output, size_t size)
{
CRYPTOPP_UNUSED(output); CRYPTOPP_UNUSED(size);
@@ -359,15 +359,15 @@ public:
}
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
- //! \brief An implementation that throws NotImplemented
+ /// \brief An implementation that throws NotImplemented
void GenerateIntoBufferedTransformation (BufferedTransformation &target, const std::string &channel, lword length) {}
- //! \brief An implementation that throws NotImplemented
+ /// \brief An implementation that throws NotImplemented
void IncorporateEntropy (const byte *input, size_t length) {}
- //! \brief An implementation that returns \p false
+ /// \brief An implementation that returns \p false
bool CanIncorporateEntropy () const {}
- //! \brief An implementation that does nothing
+ /// \brief An implementation that does nothing
void DiscardBytes (size_t n) {}
- //! \brief An implementation that does nothing
+ /// \brief An implementation that does nothing
void Shuffle (IT begin, IT end) {}
private:
diff --git a/cryptlib.h b/cryptlib.h
index 644f4790..272659cc 100644
--- a/cryptlib.h
+++ b/cryptlib.h
@@ -1,7 +1,7 @@
// cryptlib.h - originally written and placed in the public domain by Wei Dai
-//! \file cryptlib.h
-//! \brief Abstract base classes that provide a uniform interface to this library.
+/// \file cryptlib.h
+/// \brief Abstract base classes that provide a uniform interface to this library.
/*! \mainpage Crypto++ Library 6.0 API Reference
@@ -116,80 +116,80 @@ class Integer;
class RandomNumberGenerator;
class BufferedTransformation;
-//! \brief Specifies a direction for a cipher to operate
-//! \sa BlockTransformation::IsForwardTransformation(), BlockTransformation::IsPermutation(), BlockTransformation::GetCipherDirection()
+/// \brief Specifies a direction for a cipher to operate
+/// \sa BlockTransformation::IsForwardTransformation(), BlockTransformation::IsPermutation(), BlockTransformation::GetCipherDirection()
enum CipherDir {
- //! \brief the cipher is performing encryption
+ /// \brief the cipher is performing encryption
ENCRYPTION,
- //! \brief the cipher is performing decryption
+ /// \brief the cipher is performing decryption
DECRYPTION};
-//! \brief Represents infinite time
+/// \brief Represents infinite time
const unsigned long INFINITE_TIME = ULONG_MAX;
// VC60 workaround: using enums as template parameters causes problems
-//! \brief Converts an enumeration to a type suitable for use as a template parameter
+/// \brief Converts an enumeration to a type suitable for use as a template parameter
template
struct EnumToType
{
static ENUM_TYPE ToEnum() {return (ENUM_TYPE)VALUE;}
};
-//! \brief Provides the byte ordering
-//! \details Big-endian and little-endian modes are supported. Bi-endian and PDP-endian modes
-//! are not supported.
+/// \brief Provides the byte ordering
+/// \details Big-endian and little-endian modes are supported. Bi-endian and PDP-endian modes
+/// are not supported.
enum ByteOrder {
- //! \brief byte order is little-endian
+ /// \brief byte order is little-endian
LITTLE_ENDIAN_ORDER = 0,
- //! \brief byte order is big-endian
+ /// \brief byte order is big-endian
BIG_ENDIAN_ORDER = 1};
-//! \brief Provides a constant for LittleEndian
+/// \brief Provides a constant for LittleEndian
typedef EnumToType LittleEndian;
-//! \brief Provides a constant for BigEndian
+/// \brief Provides a constant for BigEndian
typedef EnumToType BigEndian;
-//! \class Exception
-//! \brief Base class for all exceptions thrown by the library
-//! \details All library exceptions directly or indirectly inherit from the Exception class.
-//! The Exception class itself inherits from std::exception. The library does not use
-//! std::runtime_error derived classes.
+/// \class Exception
+/// \brief Base class for all exceptions thrown by the library
+/// \details All library exceptions directly or indirectly inherit from the Exception class.
+/// The Exception class itself inherits from std::exception. The library does not use
+/// std::runtime_error derived classes.
class CRYPTOPP_DLL Exception : public std::exception
{
public:
- //! \enum ErrorType
- //! \brief Error types or categories
+ /// \enum ErrorType
+ /// \brief Error types or categories
enum ErrorType {
- //! \brief A method was called which was not implemented
+ /// \brief A method was called which was not implemented
NOT_IMPLEMENTED,
- //! \brief An invalid argument was detected
+ /// \brief An invalid argument was detected
INVALID_ARGUMENT,
- //! \brief BufferedTransformation received a Flush(true) signal but can't flush buffers
+ /// \brief BufferedTransformation received a Flush(true) signal but can't flush buffers
CANNOT_FLUSH,
- //! \brief Data integerity check, such as CRC or MAC, failed
+ /// \brief Data integerity check, such as CRC or MAC, failed
DATA_INTEGRITY_CHECK_FAILED,
- //! \brief Input data was received that did not conform to expected format
+ /// \brief Input data was received that did not conform to expected format
INVALID_DATA_FORMAT,
- //! \brief Error reading from input device or writing to output device
+ /// \brief Error reading from input device or writing to output device
IO_ERROR,
- //! \brief Some other error occurred not belonging to other categories
+ /// \brief Some other error occurred not belonging to other categories
OTHER_ERROR
};
virtual ~Exception() throw() {}
- //! \brief Construct a new Exception
+ /// \brief Construct a new Exception
explicit Exception(ErrorType errorType, const std::string &s) : m_errorType(errorType), m_what(s) {}
- //! \brief Retrieves a C-string describing the exception
+ /// \brief Retrieves a C-string describing the exception
const char *what() const throw() {return (m_what.c_str());}
- //! \brief Retrieves a string describing the exception
+ /// \brief Retrieves a string describing the exception
const std::string &GetWhat() const {return m_what;}
- //! \brief Sets the error string for the exception
+ /// \brief Sets the error string for the exception
void SetWhat(const std::string &s) {m_what = s;}
- //! \brief Retrieves the error type for the exception
+ /// \brief Retrieves the error type for the exception
ErrorType GetErrorType() const {return m_errorType;}
- //! \brief Sets the error type for the exceptions
+ /// \brief Sets the error type for the exceptions
void SetErrorType(ErrorType errorType) {m_errorType = errorType;}
private:
@@ -197,42 +197,42 @@ private:
std::string m_what;
};
-//! \brief An invalid argument was detected
+/// \brief An invalid argument was detected
class CRYPTOPP_DLL InvalidArgument : public Exception
{
public:
explicit InvalidArgument(const std::string &s) : Exception(INVALID_ARGUMENT, s) {}
};
-//! \brief Input data was received that did not conform to expected format
+/// \brief Input data was received that did not conform to expected format
class CRYPTOPP_DLL InvalidDataFormat : public Exception
{
public:
explicit InvalidDataFormat(const std::string &s) : Exception(INVALID_DATA_FORMAT, s) {}
};
-//! \brief A decryption filter encountered invalid ciphertext
+/// \brief A decryption filter encountered invalid ciphertext
class CRYPTOPP_DLL InvalidCiphertext : public InvalidDataFormat
{
public:
explicit InvalidCiphertext(const std::string &s) : InvalidDataFormat(s) {}
};
-//! \brief A method was called which was not implemented
+/// \brief A method was called which was not implemented
class CRYPTOPP_DLL NotImplemented : public Exception
{
public:
explicit NotImplemented(const std::string &s) : Exception(NOT_IMPLEMENTED, s) {}
};
-//! \brief Flush(true) was called but it can't completely flush its buffers
+/// \brief Flush(true) was called but it can't completely flush its buffers
class CRYPTOPP_DLL CannotFlush : public Exception
{
public:
explicit CannotFlush(const std::string &s) : Exception(CANNOT_FLUSH, s) {}
};
-//! \brief The operating system reported an error
+/// \brief The operating system reported an error
class CRYPTOPP_DLL OS_Error : public Exception
{
public:
@@ -240,9 +240,9 @@ public:
OS_Error(ErrorType errorType, const std::string &s, const std::string& operation, int errorCode)
: Exception(errorType, s), m_operation(operation), m_errorCode(errorCode) {}
- //! \brief Retrieve the operating system API that reported the error
+ /// \brief Retrieve the operating system API that reported the error
const std::string & GetOperation() const {return m_operation;}
- //! \brief Retrieve the error code returned by the operating system
+ /// \brief Retrieve the error code returned by the operating system
int GetErrorCode() const {return m_errorCode;}
protected:
@@ -250,72 +250,72 @@ protected:
int m_errorCode;
};
-//! \class DecodingResult
-//! \brief Returns a decoding results
+/// \class DecodingResult
+/// \brief Returns a decoding results
struct CRYPTOPP_DLL DecodingResult
{
- //! \brief Constructs a DecodingResult
- //! \details isValidCoding is initialized to false and messageLength is initialized to 0.
+ /// \brief Constructs a DecodingResult
+ /// \details isValidCoding is initialized to false and messageLength is initialized to 0.
explicit DecodingResult() : isValidCoding(false), messageLength(0) {}
- //! \brief Constructs a DecodingResult
- //! \param len the message length
- //! \details isValidCoding is initialized to true.
+ /// \brief Constructs a DecodingResult
+ /// \param len the message length
+ /// \details isValidCoding is initialized to true.
explicit DecodingResult(size_t len) : isValidCoding(true), messageLength(len) {}
- //! \brief Compare two DecodingResult
- //! \param rhs the other DecodingResult
- //! \return true if both isValidCoding and messageLength are equal, false otherwise
+ /// \brief Compare two DecodingResult
+ /// \param rhs the other DecodingResult
+ /// \return true if both isValidCoding and messageLength are equal, false otherwise
bool operator==(const DecodingResult &rhs) const {return isValidCoding == rhs.isValidCoding && messageLength == rhs.messageLength;}
- //! \brief Compare two DecodingResult
- //! \param rhs the other DecodingResult
- //! \return true if either isValidCoding or messageLength is \a not equal, false otherwise
- //! \details Returns !operator==(rhs).
+ /// \brief Compare two DecodingResult
+ /// \param rhs the other DecodingResult
+ /// \return true if either isValidCoding or messageLength is \a not equal, false otherwise
+ /// \details Returns !operator==(rhs).
bool operator!=(const DecodingResult &rhs) const {return !operator==(rhs);}
- //! \brief Flag to indicate the decoding is valid
+ /// \brief Flag to indicate the decoding is valid
bool isValidCoding;
- //! \brief Recovered message length if isValidCoding is true, undefined otherwise
+ /// \brief Recovered message length if isValidCoding is true, undefined otherwise
size_t messageLength;
};
-//! \class NameValuePairs
-//! \brief Interface for retrieving values given their names
-//! \details This class is used to safely pass a variable number of arbitrarily typed arguments to functions
-//! and to read values from keys and crypto parameters.
-//! \details To obtain an object that implements NameValuePairs for the purpose of parameter
-//! passing, use the MakeParameters() function.
-//! \details To get a value from NameValuePairs, you need to know the name and the type of the value.
-//! Call GetValueNames() on a NameValuePairs object to obtain a list of value names that it supports.
-//! then look at the Name namespace documentation to see what the type of each value is, or
-//! alternatively, call GetIntValue() with the value name, and if the type is not int, a
-//! ValueTypeMismatch exception will be thrown and you can get the actual type from the exception object.
-//! \sa NullNameValuePairs, g_nullNameValuePairs,
-//! NameValuePairs on the Crypto++ wiki
+/// \class NameValuePairs
+/// \brief Interface for retrieving values given their names
+/// \details This class is used to safely pass a variable number of arbitrarily typed arguments to functions
+/// and to read values from keys and crypto parameters.
+/// \details To obtain an object that implements NameValuePairs for the purpose of parameter
+/// passing, use the MakeParameters() function.
+/// \details To get a value from NameValuePairs, you need to know the name and the type of the value.
+/// Call GetValueNames() on a NameValuePairs object to obtain a list of value names that it supports.
+/// then look at the Name namespace documentation to see what the type of each value is, or
+/// alternatively, call GetIntValue() with the value name, and if the type is not int, a
+/// ValueTypeMismatch exception will be thrown and you can get the actual type from the exception object.
+/// \sa NullNameValuePairs, g_nullNameValuePairs,
+/// NameValuePairs on the Crypto++ wiki
class NameValuePairs
{
public:
virtual ~NameValuePairs() {}
- //! \class ValueTypeMismatch
- //! \brief Thrown when an unexpected type is encountered
- //! \details Exception thrown when trying to retrieve a value using a different type than expected
+ /// \class ValueTypeMismatch
+ /// \brief Thrown when an unexpected type is encountered
+ /// \details Exception thrown when trying to retrieve a value using a different type than expected
class CRYPTOPP_DLL ValueTypeMismatch : public InvalidArgument
{
public:
- //! \brief Construct a ValueTypeMismatch
- //! \param name the name of the value
- //! \param stored the \a actual type of the value stored
- //! \param retrieving the \a presumed type of the value retrieved
+ /// \brief Construct a ValueTypeMismatch
+ /// \param name the name of the value
+ /// \param stored the \a actual type of the value stored
+ /// \param retrieving the \a presumed type of the value retrieved
ValueTypeMismatch(const std::string &name, const std::type_info &stored, const std::type_info &retrieving)
: InvalidArgument("NameValuePairs: type mismatch for '" + name + "', stored '" + stored.name() + "', trying to retrieve '" + retrieving.name() + "'")
, m_stored(stored), m_retrieving(retrieving) {}
- //! \brief Provides the stored type
- //! \return the C++ mangled name of the type
+ /// \brief Provides the stored type
+ /// \return the C++ mangled name of the type
const std::type_info & GetStoredTypeInfo() const {return m_stored;}
- //! \brief Provides the retrieveing type
- //! \return the C++ mangled name of the type
+ /// \brief Provides the retrieveing type
+ /// \return the C++ mangled name of the type
const std::type_info & GetRetrievingTypeInfo() const {return m_retrieving;}
private:
@@ -323,44 +323,44 @@ public:
const std::type_info &m_retrieving;
};
- //! \brief Get a copy of this object or subobject
- //! \tparam T class or type
- //! \param object reference to a variable that receives the value
+ /// \brief Get a copy of this object or subobject
+ /// \tparam T class or type
+ /// \param object reference to a variable that receives the value
template
bool GetThisObject(T &object) const
{
return GetValue((std::string("ThisObject:")+typeid(T).name()).c_str(), object);
}
- //! \brief Get a pointer to this object
- //! \tparam T class or type
- //! \param ptr reference to a pointer to a variable that receives the value
+ /// \brief Get a pointer to this object
+ /// \tparam T class or type
+ /// \param ptr reference to a pointer to a variable that receives the value
template
bool GetThisPointer(T *&ptr) const
{
return GetValue((std::string("ThisPointer:")+typeid(T).name()).c_str(), ptr);
}
- //! \brief Get a named value
- //! \tparam T class or type
- //! \param name the name of the object or value to retrieve
- //! \param value reference to a variable that receives the value
- //! \returns true if the value was retrieved, false otherwise
- //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
- //! GetRequiredParameter() and GetRequiredIntParameter()
+ /// \brief Get a named value
+ /// \tparam T class or type
+ /// \param name the name of the object or value to retrieve
+ /// \param value reference to a variable that receives the value
+ /// \returns true if the value was retrieved, false otherwise
+ /// \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
+ /// GetRequiredParameter() and GetRequiredIntParameter()
template
bool GetValue(const char *name, T &value) const
{
return GetVoidValue(name, typeid(T), &value);
}
- //! \brief Get a named value
- //! \tparam T class or type
- //! \param name the name of the object or value to retrieve
- //! \param defaultValue the default value of the class or type if it does not exist
- //! \return the object or value
- //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
- //! GetRequiredParameter() and GetRequiredIntParameter()
+ /// \brief Get a named value
+ /// \tparam T class or type
+ /// \param name the name of the object or value to retrieve
+ /// \param defaultValue the default value of the class or type if it does not exist
+ /// \return the object or value
+ /// \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
+ /// GetRequiredParameter() and GetRequiredIntParameter()
template
T GetValueWithDefault(const char *name, T defaultValue) const
{
@@ -371,54 +371,54 @@ public:
return defaultValue;
}
- //! \brief Get a list of value names that can be retrieved
- //! \return a list of names available to retrieve
- //! \details the items in the list are delimited with a colon.
+ /// \brief Get a list of value names that can be retrieved
+ /// \return a list of names available to retrieve
+ /// \details the items in the list are delimited with a colon.
CRYPTOPP_DLL std::string GetValueNames() const
{std::string result; GetValue("ValueNames", result); return result;}
- //! \brief Get a named value with type int
- //! \param name the name of the value to retrieve
- //! \param value the value retrieved upon success
- //! \return true if an int value was retrieved, false otherwise
- //! \details GetIntValue() is used to ensure we don't accidentally try to get an
- //! unsigned int or some other type when we mean int (which is the most common case)
- //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
- //! GetRequiredParameter() and GetRequiredIntParameter()
+ /// \brief Get a named value with type int
+ /// \param name the name of the value to retrieve
+ /// \param value the value retrieved upon success
+ /// \return true if an int value was retrieved, false otherwise
+ /// \details GetIntValue() is used to ensure we don't accidentally try to get an
+ /// unsigned int or some other type when we mean int (which is the most common case)
+ /// \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
+ /// GetRequiredParameter() and GetRequiredIntParameter()
CRYPTOPP_DLL bool GetIntValue(const char *name, int &value) const
{return GetValue(name, value);}
- //! \brief Get a named value with type int, with default
- //! \param name the name of the value to retrieve
- //! \param defaultValue the default value if the name does not exist
- //! \return the value retrieved on success or the default value
- //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
- //! GetRequiredParameter() and GetRequiredIntParameter()
+ /// \brief Get a named value with type int, with default
+ /// \param name the name of the value to retrieve
+ /// \param defaultValue the default value if the name does not exist
+ /// \return the value retrieved on success or the default value
+ /// \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
+ /// GetRequiredParameter() and GetRequiredIntParameter()
CRYPTOPP_DLL int GetIntValueWithDefault(const char *name, int defaultValue) const
{return GetValueWithDefault(name, defaultValue);}
- //! \brief Ensures an expected name and type is present
- //! \param name the name of the value
- //! \param stored the type that was stored for the name
- //! \param retrieving the type that is being retrieved for the name
- //! \throws ValueTypeMismatch
- //! \details ThrowIfTypeMismatch() effectively performs a type safety check.
- //! stored and retrieving are C++ mangled names for the type.
- //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
- //! GetRequiredParameter() and GetRequiredIntParameter()
+ /// \brief Ensures an expected name and type is present
+ /// \param name the name of the value
+ /// \param stored the type that was stored for the name
+ /// \param retrieving the type that is being retrieved for the name
+ /// \throws ValueTypeMismatch
+ /// \details ThrowIfTypeMismatch() effectively performs a type safety check.
+ /// stored and retrieving are C++ mangled names for the type.
+ /// \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
+ /// GetRequiredParameter() and GetRequiredIntParameter()
CRYPTOPP_DLL static void CRYPTOPP_API ThrowIfTypeMismatch(const char *name, const std::type_info &stored, const std::type_info &retrieving)
{if (stored != retrieving) throw ValueTypeMismatch(name, stored, retrieving);}
- //! \brief Retrieves a required name/value pair
- //! \tparam T class or type
- //! \param className the name of the class
- //! \param name the name of the value
- //! \param value reference to a variable to receive the value
- //! \throws InvalidArgument
- //! \details GetRequiredParameter() throws InvalidArgument if the name
- //! is not present or not of the expected type T.
- //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
- //! GetRequiredParameter() and GetRequiredIntParameter()
+ /// \brief Retrieves a required name/value pair
+ /// \tparam T class or type
+ /// \param className the name of the class
+ /// \param name the name of the value
+ /// \param value reference to a variable to receive the value
+ /// \throws InvalidArgument
+ /// \details GetRequiredParameter() throws InvalidArgument if the name
+ /// is not present or not of the expected type T.
+ /// \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
+ /// GetRequiredParameter() and GetRequiredIntParameter()
template
void GetRequiredParameter(const char *className, const char *name, T &value) const
{
@@ -426,44 +426,44 @@ public:
throw InvalidArgument(std::string(className) + ": missing required parameter '" + name + "'");
}
- //! \brief Retrieves a required name/value pair
- //! \param className the name of the class
- //! \param name the name of the value
- //! \param value reference to a variable to receive the value
- //! \throws InvalidArgument
- //! \details GetRequiredParameter() throws InvalidArgument if the name
- //! is not present or not of the expected type T.
- //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
- //! GetRequiredParameter() and GetRequiredIntParameter()
+ /// \brief Retrieves a required name/value pair
+ /// \param className the name of the class
+ /// \param name the name of the value
+ /// \param value reference to a variable to receive the value
+ /// \throws InvalidArgument
+ /// \details GetRequiredParameter() throws InvalidArgument if the name
+ /// is not present or not of the expected type T.
+ /// \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
+ /// GetRequiredParameter() and GetRequiredIntParameter()
CRYPTOPP_DLL void GetRequiredIntParameter(const char *className, const char *name, int &value) const
{
if (!GetIntValue(name, value))
throw InvalidArgument(std::string(className) + ": missing required parameter '" + name + "'");
}
- //! \brief Get a named value
- //! \param name the name of the object or value to retrieve
- //! \param valueType reference to a variable that receives the value
- //! \param pValue void pointer to a variable that receives the value
- //! \returns true if the value was retrieved, false otherwise
- //! \details GetVoidValue() retrieves the value of name if it exists.
- //! \note GetVoidValue() is an internal function and should be implemented
- //! by derived classes. Users should use one of the other functions instead.
- //! \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
- //! GetRequiredParameter() and GetRequiredIntParameter()
+ /// \brief Get a named value
+ /// \param name the name of the object or value to retrieve
+ /// \param valueType reference to a variable that receives the value
+ /// \param pValue void pointer to a variable that receives the value
+ /// \returns true if the value was retrieved, false otherwise
+ /// \details GetVoidValue() retrieves the value of name if it exists.
+ /// \note GetVoidValue() is an internal function and should be implemented
+ /// by derived classes. Users should use one of the other functions instead.
+ /// \sa GetValue(), GetValueWithDefault(), GetIntValue(), GetIntValueWithDefault(),
+ /// GetRequiredParameter() and GetRequiredIntParameter()
CRYPTOPP_DLL virtual bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const =0;
};
-//! \class NullNameValuePairs
-//! \brief Interface for retrieving values given their names
-//! \details This class is used when no names or values are present. Typically a program uses
-//! g_nullNameValuePairs rather than creating its own NullNameValuePairs object.
-//! \details NullNameValuePairs always existed in cryptlib.cpp. Crypto++ 6.0 moved NullNameValuePairs
-//! into the header. This allowed the library to define g_nullNameValuePairs in the header rather
-//! than declaring it as extern and placing the definition in the source file. As an external definition
-//! the string g_nullNameValuePairs was subject to static initialization order fiasco problems.
-//! \sa NameValuePairs, g_nullNameValuePairs,
-//! NameValuePairs on the Crypto++ wiki
+/// \class NullNameValuePairs
+/// \brief Interface for retrieving values given their names
+/// \details This class is used when no names or values are present. Typically a program uses
+/// g_nullNameValuePairs rather than creating its own NullNameValuePairs object.
+/// \details NullNameValuePairs always existed in cryptlib.cpp. Crypto++ 6.0 moved NullNameValuePairs
+/// into the header. This allowed the library to define g_nullNameValuePairs in the header rather
+/// than declaring it as extern and placing the definition in the source file. As an external definition
+/// the string g_nullNameValuePairs was subject to static initialization order fiasco problems.
+/// \sa NameValuePairs, g_nullNameValuePairs,
+/// NameValuePairs on the Crypto++ wiki
class NullNameValuePairs : public NameValuePairs
{
public:
@@ -480,24 +480,24 @@ ANONYMOUS_NAMESPACE_END
// Doxygen cannot handle initialization
#if CRYPTOPP_DOXYGEN_PROCESSING
-//! \brief Default channel for BufferedTransformation
-//! \details DEFAULT_CHANNEL is equal to an empty string
-//! \details Crypto++ 6.0 placed DEFAULT_CHANNEL in the header, rather than declaring it as extern and
-//! placing the definition in the source file. As an external definition the string DEFAULT_CHANNEL
-//! was subject to static initialization order fiasco problems.
+/// \brief Default channel for BufferedTransformation
+/// \details DEFAULT_CHANNEL is equal to an empty string
+/// \details Crypto++ 6.0 placed DEFAULT_CHANNEL in the header, rather than declaring it as extern and
+/// placing the definition in the source file. As an external definition the string DEFAULT_CHANNEL
+/// was subject to static initialization order fiasco problems.
const std::string DEFAULT_CHANNEL;
-//! \brief Channel for additional authenticated data
-//! \details AAD_CHANNEL is equal to "AAD"
-//! \details Crypto++ 6.0 placed AAD_CHANNEL in the header, rather than declaring it as extern and
-//! placing the definition in the source file. As an external definition the string AAD_CHANNEL
-//! was subject to static initialization order fiasco problems.
+/// \brief Channel for additional authenticated data
+/// \details AAD_CHANNEL is equal to "AAD"
+/// \details Crypto++ 6.0 placed AAD_CHANNEL in the header, rather than declaring it as extern and
+/// placing the definition in the source file. As an external definition the string AAD_CHANNEL
+/// was subject to static initialization order fiasco problems.
const std::string AAD_CHANNEL;
-//! \brief An empty set of name-value pairs
-//! \details Crypto++ 6.0 placed g_nullNameValuePairs in the header, rather than declaring it as extern
-//! and placing the definition in the source file. As an external definition the g_nullNameValuePairs
-//! was subject to static initialization order fiasco problems.
+/// \brief An empty set of name-value pairs
+/// \details Crypto++ 6.0 placed g_nullNameValuePairs in the header, rather than declaring it as extern
+/// and placing the definition in the source file. As an external definition the g_nullNameValuePairs
+/// was subject to static initialization order fiasco problems.
const NameValuePairs g_nullNameValuePairs;
// Sun Studio 12.3 and earlier can't handle NameValuePairs initialization
@@ -517,528 +517,528 @@ static const NameValuePairs& g_nullNameValuePairs(s_nullNameValuePairs);
// Document additional name spaces which show up elsewhere in the sources.
#if CRYPTOPP_DOXYGEN_PROCESSING
-//! \brief Namespace containing value name definitions.
-//! \details Name is part of the CryptoPP namespace.
-//! \details The semantics of value names, types are:
-//!
-//! ThisObject:ClassName (ClassName, copy of this object or a subobject)
-//! ThisPointer:ClassName (const ClassName *, pointer to this object or a subobject)
-//!
+/// \brief Namespace containing value name definitions.
+/// \details Name is part of the CryptoPP namespace.
+/// \details The semantics of value names, types are:
+///
+/// ThisObject:ClassName (ClassName, copy of this object or a subobject)
+/// ThisPointer:ClassName (const ClassName *, pointer to this object or a subobject)
+///
DOCUMENTED_NAMESPACE_BEGIN(Name)
// more names defined in argnames.h
DOCUMENTED_NAMESPACE_END
-//! \brief Namespace containing weak and wounded algorithms.
-//! \details Weak is part of the CryptoPP namespace. Schemes and algorithms are moved into Weak
-//! when their security level is reduced to an unacceptable level by contemporary standards.
-//! \details To use an algorithm in the Weak namespace, you must \c \#define
-//! CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 before including a header for a weak or wounded
-//! algorithm. For example:
-//!
-//! \c \#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
-//! \c \#include
-//! ...
-//! CryptoPP::Weak::MD5 md5;
-//!
+/// \brief Namespace containing weak and wounded algorithms.
+/// \details Weak is part of the CryptoPP namespace. Schemes and algorithms are moved into Weak
+/// when their security level is reduced to an unacceptable level by contemporary standards.
+/// \details To use an algorithm in the Weak namespace, you must \c \#define
+/// CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 before including a header for a weak or wounded
+/// algorithm. For example:
+///
+/// \c \#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
+/// \c \#include
+/// ...
+/// CryptoPP::Weak::MD5 md5;
+///
DOCUMENTED_NAMESPACE_BEGIN(Weak)
// weak and wounded algorithms
DOCUMENTED_NAMESPACE_END
#endif
-//! \brief Namespace containing testing and benchmark classes.
-//! \details Source files for classes in the Test namespaces include
-//! test.cpp, validat#.cpp and bench#.cpp.
+/// \brief Namespace containing testing and benchmark classes.
+/// \details Source files for classes in the Test namespaces include
+/// test.cpp, validat#.cpp and bench#.cpp.
DOCUMENTED_NAMESPACE_BEGIN(Test)
// testing and benchmark classes
DOCUMENTED_NAMESPACE_END
// ********************************************************
-//! \class Clonable
-//! \brief Interface for cloning objects
-//! \note this is \a not implemented by most classes
-//! \sa ClonableImpl, NotCopyable
+/// \class Clonable
+/// \brief Interface for cloning objects
+/// \note this is \a not implemented by most classes
+/// \sa ClonableImpl, NotCopyable
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Clonable
{
public:
virtual ~Clonable() {}
- //! \brief Copies this object
- //! \return a copy of this object
- //! \throws NotImplemented
- //! \note this is \a not implemented by most classes
- //! \sa NotCopyable
+ /// \brief Copies this object
+ /// \return a copy of this object
+ /// \throws NotImplemented
+ /// \note this is \a not implemented by most classes
+ /// \sa NotCopyable
virtual Clonable* Clone() const {throw NotImplemented("Clone() is not implemented yet.");} // TODO: make this =0
};
-//! \class Algorithm
-//! \brief Interface for all crypto algorithms
+/// \class Algorithm
+/// \brief Interface for all crypto algorithms
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Algorithm : public Clonable
{
public:
virtual ~Algorithm() {}
- //! \brief Interface for all crypto algorithms
- //! \param checkSelfTestStatus determines whether the object can proceed if the self
- //! tests have not been run or failed.
- //! \details When FIPS 140-2 compliance is enabled and checkSelfTestStatus == true,
- //! this constructor throws SelfTestFailure if the self test hasn't been run or fails.
- //! \details FIPS 140-2 compliance is disabled by default. It is only used by certain
- //! versions of the library when the library is built as a DLL on Windows. Also see
- //! CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 in config.h.
+ /// \brief Interface for all crypto algorithms
+ /// \param checkSelfTestStatus determines whether the object can proceed if the self
+ /// tests have not been run or failed.
+ /// \details When FIPS 140-2 compliance is enabled and checkSelfTestStatus == true,
+ /// this constructor throws SelfTestFailure if the self test hasn't been run or fails.
+ /// \details FIPS 140-2 compliance is disabled by default. It is only used by certain
+ /// versions of the library when the library is built as a DLL on Windows. Also see
+ /// CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 in config.h.
Algorithm(bool checkSelfTestStatus = true);
- //! \brief Provides the name of this algorithm
- //! \return the standard algorithm name
- //! \details The standard algorithm name can be a name like \a AES or \a AES/GCM. Some algorithms
- //! do not have standard names yet. For example, there is no standard algorithm name for
- //! Shoup's ECIES.
- //! \note AlgorithmName is not universally implemented yet
+ /// \brief Provides the name of this algorithm
+ /// \return the standard algorithm name
+ /// \details The standard algorithm name can be a name like \a AES or \a AES/GCM. Some algorithms
+ /// do not have standard names yet. For example, there is no standard algorithm name for
+ /// Shoup's ECIES.
+ /// \note AlgorithmName is not universally implemented yet
virtual std::string AlgorithmName() const {return "unknown";}
};
-//! \class SimpleKeyingInterface
-//! \brief Interface for algorithms that take byte strings as keys
-//! \sa FixedKeyLength(), VariableKeyLength(), SameKeyLengthAs(), SimpleKeyingInterfaceImpl()
+/// \class SimpleKeyingInterface
+/// \brief Interface for algorithms that take byte strings as keys
+/// \sa FixedKeyLength(), VariableKeyLength(), SameKeyLengthAs(), SimpleKeyingInterfaceImpl()
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SimpleKeyingInterface
{
public:
virtual ~SimpleKeyingInterface() {}
- //! \brief Returns smallest valid key length
- //! \returns the minimum key length, in bytes
+ /// \brief Returns smallest valid key length
+ /// \returns the minimum key length, in bytes
virtual size_t MinKeyLength() const =0;
- //! \brief Returns largest valid key length
- //! \returns the maximum key length, in bytes
+ /// \brief Returns largest valid key length
+ /// \returns the maximum key length, in bytes
virtual size_t MaxKeyLength() const =0;
- //! \brief Returns default key length
- //! \returns the default (recommended) key length, in bytes
+ /// \brief Returns default key length
+ /// \returns the default (recommended) key length, in bytes
virtual size_t DefaultKeyLength() const =0;
- //! \brief Returns a valid key length for the algorithm
- //! \param keylength the size of the key, in bytes
- //! \returns the valid key length, in bytes
- //! \details keylength is provided in bytes, not bits. If keylength is less than MIN_KEYLENGTH,
- //! then the function returns MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH,
- //! then the function returns MAX_KEYLENGTH. if If keylength is a multiple of KEYLENGTH_MULTIPLE,
- //! then keylength is returned. Otherwise, the function returns a \a lower multiple of
- //! KEYLENGTH_MULTIPLE.
+ /// \brief Returns a valid key length for the algorithm
+ /// \param keylength the size of the key, in bytes
+ /// \returns the valid key length, in bytes
+ /// \details keylength is provided in bytes, not bits. If keylength is less than MIN_KEYLENGTH,
+ /// then the function returns MIN_KEYLENGTH. If keylength is greater than MAX_KEYLENGTH,
+ /// then the function returns MAX_KEYLENGTH. if If keylength is a multiple of KEYLENGTH_MULTIPLE,
+ /// then keylength is returned. Otherwise, the function returns a \a lower multiple of
+ /// KEYLENGTH_MULTIPLE.
virtual size_t GetValidKeyLength(size_t keylength) const =0;
- //! \brief Returns whether keylength is a valid key length
- //! \param keylength the requested keylength
- //! \return true if keylength is valid, false otherwise
- //! \details Internally the function calls GetValidKeyLength()
+ /// \brief Returns whether keylength is a valid key length
+ /// \param keylength the requested keylength
+ /// \return true if keylength is valid, false otherwise
+ /// \details Internally the function calls GetValidKeyLength()
virtual bool IsValidKeyLength(size_t keylength) const
{return keylength == GetValidKeyLength(keylength);}
- //! \brief Sets or reset the key of this object
- //! \param key the key to use when keying the object
- //! \param length the size of the key, in bytes
- //! \param params additional initialization parameters that cannot be passed
- //! directly through the constructor
+ /// \brief Sets or reset the key of this object
+ /// \param key the key to use when keying the object
+ /// \param length the size of the key, in bytes
+ /// \param params additional initialization parameters that cannot be passed
+ /// directly through the constructor
virtual void SetKey(const byte *key, size_t length, const NameValuePairs ¶ms = g_nullNameValuePairs);
- //! \brief Sets or reset the key of this object
- //! \param key the key to use when keying the object
- //! \param length the size of the key, in bytes
- //! \param rounds the number of rounds to apply the transformation function,
- //! if applicable
- //! \details SetKeyWithRounds() calls SetKey() with a NameValuePairs
- //! object that only specifies rounds. rounds is an integer parameter,
- //! and -1 means use the default number of rounds.
+ /// \brief Sets or reset the key of this object
+ /// \param key the key to use when keying the object
+ /// \param length the size of the key, in bytes
+ /// \param rounds the number of rounds to apply the transformation function,
+ /// if applicable
+ /// \details SetKeyWithRounds() calls SetKey() with a NameValuePairs
+ /// object that only specifies rounds. rounds is an integer parameter,
+ /// and -1 means use the default number of rounds.
void SetKeyWithRounds(const byte *key, size_t length, int rounds);
- //! \brief Sets or reset the key of this object
- //! \param key the key to use when keying the object
- //! \param length the size of the key, in bytes
- //! \param iv the intiialization vector to use when keying the object
- //! \param ivLength the size of the iv, in bytes
- //! \details SetKeyWithIV() calls SetKey() with a NameValuePairs
- //! that only specifies IV. The IV is a byte buffer with size ivLength.
- //! ivLength is an integer parameter, and -1 means use IVSize().
+ /// \brief Sets or reset the key of this object
+ /// \param key the key to use when keying the object
+ /// \param length the size of the key, in bytes
+ /// \param iv the intiialization vector to use when keying the object
+ /// \param ivLength the size of the iv, in bytes
+ /// \details SetKeyWithIV() calls SetKey() with a NameValuePairs
+ /// that only specifies IV. The IV is a byte buffer with size ivLength.
+ /// ivLength is an integer parameter, and -1 means use IVSize().
void SetKeyWithIV(const byte *key, size_t length, const byte *iv, size_t ivLength);
- //! \brief Sets or reset the key of this object
- //! \param key the key to use when keying the object
- //! \param length the size of the key, in bytes
- //! \param iv the intiialization vector to use when keying the object
- //! \details SetKeyWithIV() calls SetKey() with a NameValuePairs() object
- //! that only specifies iv. iv is a byte buffer, and it must have
- //! a size IVSize().
+ /// \brief Sets or reset the key of this object
+ /// \param key the key to use when keying the object
+ /// \param length the size of the key, in bytes
+ /// \param iv the intiialization vector to use when keying the object
+ /// \details SetKeyWithIV() calls SetKey() with a NameValuePairs() object
+ /// that only specifies iv. iv is a byte buffer, and it must have
+ /// a size IVSize().
void SetKeyWithIV(const byte *key, size_t length, const byte *iv)
{SetKeyWithIV(key, length, iv, IVSize());}
- //! \brief Secure IVs requirements as enumerated values.
- //! \details Provides secure IV requirements as a monotonically increasing enumerated values. Requirements can be
- //! compared using less than (<) and greater than (>). For example, UNIQUE_IV < RANDOM_IV
- //! and UNPREDICTABLE_RANDOM_IV > RANDOM_IV.
- //! \sa IsResynchronizable(), CanUseRandomIVs(), CanUsePredictableIVs(), CanUseStructuredIVs()
+ /// \brief Secure IVs requirements as enumerated values.
+ /// \details Provides secure IV requirements as a monotonically increasing enumerated values. Requirements can be
+ /// compared using less than (<) and greater than (>). For example, UNIQUE_IV < RANDOM_IV
+ /// and UNPREDICTABLE_RANDOM_IV > RANDOM_IV.
+ /// \sa IsResynchronizable(), CanUseRandomIVs(), CanUsePredictableIVs(), CanUseStructuredIVs()
enum IV_Requirement {
- //! \brief The IV must be unique
+ /// \brief The IV must be unique
UNIQUE_IV = 0,
- //! \brief The IV must be random and possibly predictable
+ /// \brief The IV must be random and possibly predictable
RANDOM_IV,
- //! \brief The IV must be random and unpredictable
+ /// \brief The IV must be random and unpredictable
UNPREDICTABLE_RANDOM_IV,
- //! \brief The IV is set by the object
+ /// \brief The IV is set by the object
INTERNALLY_GENERATED_IV,
- //! \brief The object does not use an IV
+ /// \brief The object does not use an IV
NOT_RESYNCHRONIZABLE
};
- //! \brief Minimal requirement for secure IVs
- //! \return the secure IV requirement of the algorithm
+ /// \brief Minimal requirement for secure IVs
+ /// \return the secure IV requirement of the algorithm
virtual IV_Requirement IVRequirement() const =0;
- //! \brief Determines if the object can be resynchronized
- //! \return true if the object can be resynchronized (i.e. supports initialization vectors), false otherwise
- //! \note If this function returns true, and no IV is passed to SetKey() and CanUseStructuredIVs()==true,
- //! an IV of all 0's will be assumed.
+ /// \brief Determines if the object can be resynchronized
+ /// \return true if the object can be resynchronized (i.e. supports initialization vectors), false otherwise
+ /// \note If this function returns true, and no IV is passed to SetKey() and CanUseStructuredIVs()==true,
+ /// an IV of all 0's will be assumed.
bool IsResynchronizable() const {return IVRequirement() < NOT_RESYNCHRONIZABLE;}
- //! \brief Determines if the object can use random IVs
- //! \return true if the object can use random IVs (in addition to ones returned by GetNextIV), false otherwise
+ /// \brief Determines if the object can use random IVs
+ /// \return true if the object can use random IVs (in addition to ones returned by GetNextIV), false otherwise
bool CanUseRandomIVs() const {return IVRequirement() <= UNPREDICTABLE_RANDOM_IV;}
- //! \brief Determines if the object can use random but possibly predictable IVs
- //! \return true if the object can use random but possibly predictable IVs (in addition to ones returned by
- //! GetNextIV), false otherwise
+ /// \brief Determines if the object can use random but possibly predictable IVs
+ /// \return true if the object can use random but possibly predictable IVs (in addition to ones returned by
+ /// GetNextIV), false otherwise
bool CanUsePredictableIVs() const {return IVRequirement() <= RANDOM_IV;}
- //! \brief Determines if the object can use structured IVs
- //! \returns true if the object can use structured IVs, false otherwise
- //! \details CanUseStructuredIVs() indicates whether the object can use structured IVs; for example a counter
- //! (in addition to ones returned by GetNextIV).
+ /// \brief Determines if the object can use structured IVs
+ /// \returns true if the object can use structured IVs, false otherwise
+ /// \details CanUseStructuredIVs() indicates whether the object can use structured IVs; for example a counter
+ /// (in addition to ones returned by GetNextIV).
bool CanUseStructuredIVs() const {return IVRequirement() <= UNIQUE_IV;}
- //! \brief Returns length of the IV accepted by this object
- //! \return the size of an IV, in bytes
- //! \throws NotImplemented() if the object does not support resynchronization
- //! \details The default implementation throws NotImplemented
+ /// \brief Returns length of the IV accepted by this object
+ /// \return the size of an IV, in bytes
+ /// \throws NotImplemented() if the object does not support resynchronization
+ /// \details The default implementation throws NotImplemented
virtual unsigned int IVSize() const
{throw NotImplemented(GetAlgorithm().AlgorithmName() + ": this object doesn't support resynchronization");}
- //! \brief Provides the default size of an IV
- //! \return default length of IVs accepted by this object, in bytes
+ /// \brief Provides the default size of an IV
+ /// \return default length of IVs accepted by this object, in bytes
unsigned int DefaultIVLength() const {return IVSize();}
- //! \brief Provides the minimum size of an IV
- //! \return minimal length of IVs accepted by this object, in bytes
- //! \throws NotImplemented() if the object does not support resynchronization
+ /// \brief Provides the minimum size of an IV
+ /// \return minimal length of IVs accepted by this object, in bytes
+ /// \throws NotImplemented() if the object does not support resynchronization
virtual unsigned int MinIVLength() const {return IVSize();}
- //! \brief Provides the maximum size of an IV
- //! \return maximal length of IVs accepted by this object, in bytes
- //! \throws NotImplemented() if the object does not support resynchronization
+ /// \brief Provides the maximum size of an IV
+ /// \return maximal length of IVs accepted by this object, in bytes
+ /// \throws NotImplemented() if the object does not support resynchronization
virtual unsigned int MaxIVLength() const {return IVSize();}
- //! \brief Resynchronize with an IV
- //! \param iv the initialization vector
- //! \param ivLength the size of the initialization vector, in bytes
- //! \details Resynchronize() resynchronizes with an IV provided by the caller. ivLength=-1 means use IVSize().
- //! \throws NotImplemented() if the object does not support resynchronization
+ /// \brief Resynchronize with an IV
+ /// \param iv the initialization vector
+ /// \param ivLength the size of the initialization vector, in bytes
+ /// \details Resynchronize() resynchronizes with an IV provided by the caller. ivLength=-1 means use IVSize().
+ /// \throws NotImplemented() if the object does not support resynchronization
virtual void Resynchronize(const byte *iv, int ivLength=-1) {
CRYPTOPP_UNUSED(iv); CRYPTOPP_UNUSED(ivLength);
throw NotImplemented(GetAlgorithm().AlgorithmName() + ": this object doesn't support resynchronization");
}
- //! \brief Retrieves a secure IV for the next message
- //! \param rng a RandomNumberGenerator to produce keying material
- //! \param iv a block of bytes to receive the IV
- //! \details The IV must be at least IVSize() in length.
- //! \details This method should be called after you finish encrypting one message and are ready
- //! to start the next one. After calling it, you must call SetKey() or Resynchronize().
- //! before using this object again.
- //! \details Internally, the base class implementation calls RandomNumberGenerator's GenerateBlock()
- //! \note This method is not implemented on decryption objects.
+ /// \brief Retrieves a secure IV for the next message
+ /// \param rng a RandomNumberGenerator to produce keying material
+ /// \param iv a block of bytes to receive the IV
+ /// \details The IV must be at least IVSize() in length.
+ /// \details This method should be called after you finish encrypting one message and are ready
+ /// to start the next one. After calling it, you must call SetKey() or Resynchronize().
+ /// before using this object again.
+ /// \details Internally, the base class implementation calls RandomNumberGenerator's GenerateBlock()
+ /// \note This method is not implemented on decryption objects.
virtual void GetNextIV(RandomNumberGenerator &rng, byte *iv);
protected:
- //! \brief Returns the base class Algorithm
- //! \return the base class Algorithm
+ /// \brief Returns the base class Algorithm
+ /// \return the base class Algorithm
virtual const Algorithm & GetAlgorithm() const =0;
- //! \brief Sets the key for this object without performing parameter validation
- //! \param key a byte buffer used to key the cipher
- //! \param length the length of the byte buffer
- //! \param params additional parameters passed as NameValuePairs
- //! \details key must be at least DEFAULT_KEYLENGTH in length.
+ /// \brief Sets the key for this object without performing parameter validation
+ /// \param key a byte buffer used to key the cipher
+ /// \param length the length of the byte buffer
+ /// \param params additional parameters passed as NameValuePairs
+ /// \details key must be at least DEFAULT_KEYLENGTH in length.
virtual void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) =0;
- //! \brief Validates the key length
- //! \param length the size of the keying material, in bytes
- //! \throws InvalidKeyLength if the key length is invalid
+ /// \brief Validates the key length
+ /// \param length the size of the keying material, in bytes
+ /// \throws InvalidKeyLength if the key length is invalid
void ThrowIfInvalidKeyLength(size_t length);
- //! \brief Validates the object
- //! \throws InvalidArgument if the IV is present
- //! \details Internally, the default implementation calls IsResynchronizable() and throws
- //! InvalidArgument if the function returns true.
- //! \note called when no IV is passed
+ /// \brief Validates the object
+ /// \throws InvalidArgument if the IV is present
+ /// \details Internally, the default implementation calls IsResynchronizable() and throws
+ /// InvalidArgument if the function returns true.
+ /// \note called when no IV is passed
void ThrowIfResynchronizable();
- //! \brief Validates the IV
- //! \param iv the IV with a length of IVSize, in bytes
- //! \throws InvalidArgument on failure
- //! \details Internally, the default implementation checks the iv. If iv is not NULL or nullptr,
- //! then the function succeeds. If iv is NULL, then IVRequirement is checked against
- //! UNPREDICTABLE_RANDOM_IV. If IVRequirement is UNPREDICTABLE_RANDOM_IV, then
- //! then the function succeeds. Otherwise, an exception is thrown.
+ /// \brief Validates the IV
+ /// \param iv the IV with a length of IVSize, in bytes
+ /// \throws InvalidArgument on failure
+ /// \details Internally, the default implementation checks the iv. If iv is not NULL or nullptr,
+ /// then the function succeeds. If iv is NULL, then IVRequirement is checked against
+ /// UNPREDICTABLE_RANDOM_IV. If IVRequirement is UNPREDICTABLE_RANDOM_IV, then
+ /// then the function succeeds. Otherwise, an exception is thrown.
void ThrowIfInvalidIV(const byte *iv);
- //! \brief Validates the IV length
- //! \param length the size of an IV, in bytes
- //! \throws InvalidArgument if the IV length is invalid
+ /// \brief Validates the IV length
+ /// \param length the size of an IV, in bytes
+ /// \throws InvalidArgument if the IV length is invalid
size_t ThrowIfInvalidIVLength(int length);
- //! \brief Retrieves and validates the IV
- //! \param params NameValuePairs with the IV supplied as a ConstByteArrayParameter
- //! \param size the length of the IV, in bytes
- //! \return a pointer to the first byte of the IV
- //! \throws InvalidArgument if the number of rounds are invalid
+ /// \brief Retrieves and validates the IV
+ /// \param params NameValuePairs with the IV supplied as a ConstByteArrayParameter
+ /// \param size the length of the IV, in bytes
+ /// \return a pointer to the first byte of the IV
+ /// \throws InvalidArgument if the number of rounds are invalid
const byte * GetIVAndThrowIfInvalid(const NameValuePairs ¶ms, size_t &size);
- //! \brief Validates the key length
- //! \param length the size of the keying material, in bytes
+ /// \brief Validates the key length
+ /// \param length the size of the keying material, in bytes
inline void AssertValidKeyLength(size_t length) const
{CRYPTOPP_UNUSED(length); CRYPTOPP_ASSERT(IsValidKeyLength(length));}
};
-//! \brief Interface for the data processing part of block ciphers
-//! \details Classes derived from BlockTransformation are block ciphers
-//! in ECB mode (for example the DES::Encryption class), which are stateless.
-//! These classes should not be used directly, but only in combination with
-//! a mode class (see CipherModeDocumentation in modes.h).
+/// \brief Interface for the data processing part of block ciphers
+/// \details Classes derived from BlockTransformation are block ciphers
+/// in ECB mode (for example the DES::Encryption class), which are stateless.
+/// These classes should not be used directly, but only in combination with
+/// a mode class (see CipherModeDocumentation in modes.h).
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BlockTransformation : public Algorithm
{
public:
virtual ~BlockTransformation() {}
- //! \brief Encrypt or decrypt a block
- //! \param inBlock the input message before processing
- //! \param outBlock the output message after processing
- //! \param xorBlock an optional XOR mask
- //! \details ProcessAndXorBlock encrypts or decrypts inBlock, xor with xorBlock, and write to outBlock.
- //! \details The size of the block is determined by the block cipher and its documentation. Use
- //! BLOCKSIZE at compile time, or BlockSize() at runtime.
- //! \note The message can be transformed in-place, or the buffers must \a not overlap
- //! \sa FixedBlockSize, BlockCipherFinal from seckey.h and BlockSize()
+ /// \brief Encrypt or decrypt a block
+ /// \param inBlock the input message before processing
+ /// \param outBlock the output message after processing
+ /// \param xorBlock an optional XOR mask
+ /// \details ProcessAndXorBlock encrypts or decrypts inBlock, xor with xorBlock, and write to outBlock.
+ /// \details The size of the block is determined by the block cipher and its documentation. Use
+ /// BLOCKSIZE at compile time, or BlockSize() at runtime.
+ /// \note The message can be transformed in-place, or the buffers must \a not overlap
+ /// \sa FixedBlockSize, BlockCipherFinal from seckey.h and BlockSize()
virtual void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const =0;
- //! \brief Encrypt or decrypt a block
- //! \param inBlock the input message before processing
- //! \param outBlock the output message after processing
- //! \details ProcessBlock encrypts or decrypts inBlock and write to outBlock.
- //! \details The size of the block is determined by the block cipher and its documentation.
- //! Use BLOCKSIZE at compile time, or BlockSize() at runtime.
- //! \sa FixedBlockSize, BlockCipherFinal from seckey.h and BlockSize()
- //! \note The message can be transformed in-place, or the buffers must \a not overlap
+ /// \brief Encrypt or decrypt a block
+ /// \param inBlock the input message before processing
+ /// \param outBlock the output message after processing
+ /// \details ProcessBlock encrypts or decrypts inBlock and write to outBlock.
+ /// \details The size of the block is determined by the block cipher and its documentation.
+ /// Use BLOCKSIZE at compile time, or BlockSize() at runtime.
+ /// \sa FixedBlockSize, BlockCipherFinal from seckey.h and BlockSize()
+ /// \note The message can be transformed in-place, or the buffers must \a not overlap
void ProcessBlock(const byte *inBlock, byte *outBlock) const
{ProcessAndXorBlock(inBlock, NULLPTR, outBlock);}
- //! \brief Encrypt or decrypt a block in place
- //! \param inoutBlock the input message before processing
- //! \details ProcessBlock encrypts or decrypts inoutBlock in-place.
- //! \details The size of the block is determined by the block cipher and its documentation.
- //! Use BLOCKSIZE at compile time, or BlockSize() at runtime.
- //! \sa FixedBlockSize, BlockCipherFinal from seckey.h and BlockSize()
+ /// \brief Encrypt or decrypt a block in place
+ /// \param inoutBlock the input message before processing
+ /// \details ProcessBlock encrypts or decrypts inoutBlock in-place.
+ /// \details The size of the block is determined by the block cipher and its documentation.
+ /// Use BLOCKSIZE at compile time, or BlockSize() at runtime.
+ /// \sa FixedBlockSize, BlockCipherFinal from seckey.h and BlockSize()
void ProcessBlock(byte *inoutBlock) const
{ProcessAndXorBlock(inoutBlock, NULLPTR, inoutBlock);}
- //! Provides the block size of the cipher
- //! \return the block size of the cipher, in bytes
+ /// Provides the block size of the cipher
+ /// \return the block size of the cipher, in bytes
virtual unsigned int BlockSize() const =0;
- //! \brief Provides input and output data alignment for optimal performance.
- //! \return the input data alignment that provides optimal performance
+ /// \brief Provides input and output data alignment for optimal performance.
+ /// \return the input data alignment that provides optimal performance
virtual unsigned int OptimalDataAlignment() const;
- //! returns true if this is a permutation (i.e. there is an inverse transformation)
+ /// returns true if this is a permutation (i.e. there is an inverse transformation)
virtual bool IsPermutation() const {return true;}
- //! \brief Determines if the cipher is being operated in its forward direction
- //! \returns true if DIR is ENCRYPTION, false otherwise
- //! \sa IsForwardTransformation(), IsPermutation(), GetCipherDirection()
+ /// \brief Determines if the cipher is being operated in its forward direction
+ /// \returns true if DIR is ENCRYPTION, false otherwise
+ /// \sa IsForwardTransformation(), IsPermutation(), GetCipherDirection()
virtual bool IsForwardTransformation() const =0;
- //! \brief Determines the number of blocks that can be processed in parallel
- //! \return the number of blocks that can be processed in parallel, for bit-slicing implementations
- //! \details Bit-slicing is often used to improve throughput and minimize timing attacks.
+ /// \brief Determines the number of blocks that can be processed in parallel
+ /// \return the number of blocks that can be processed in parallel, for bit-slicing implementations
+ /// \details Bit-slicing is often used to improve throughput and minimize timing attacks.
virtual unsigned int OptimalNumberOfParallelBlocks() const {return 1;}
- //! \brief Bit flags that control AdvancedProcessBlocks() behavior
+ /// \brief Bit flags that control AdvancedProcessBlocks() behavior
enum FlagsForAdvancedProcessBlocks {
- //! \brief inBlock is a counter
+ /// \brief inBlock is a counter
BT_InBlockIsCounter=1,
- //! \brief should not modify block pointers
+ /// \brief should not modify block pointers
BT_DontIncrementInOutPointers=2,
- //! \brief Xor inputs before transformation
+ /// \brief Xor inputs before transformation
BT_XorInput=4,
- //! \brief perform the transformation in reverse
+ /// \brief perform the transformation in reverse
BT_ReverseDirection=8,
- //! \brief Allow parallel transformations
+ /// \brief Allow parallel transformations
BT_AllowParallel=16};
- //! \brief Encrypt and xor multiple blocks using additional flags
- //! \param inBlocks the input message before processing
- //! \param xorBlocks an optional XOR mask
- //! \param outBlocks the output message after processing
- //! \param length the size of the blocks, in bytes
- //! \param flags additional flags to control processing
- //! \details Encrypt and xor multiple blocks according to FlagsForAdvancedProcessBlocks flags.
- //! \note If BT_InBlockIsCounter is set, then the last byte of inBlocks may be modified.
+ /// \brief Encrypt and xor multiple blocks using additional flags
+ /// \param inBlocks the input message before processing
+ /// \param xorBlocks an optional XOR mask
+ /// \param outBlocks the output message after processing
+ /// \param length the size of the blocks, in bytes
+ /// \param flags additional flags to control processing
+ /// \details Encrypt and xor multiple blocks according to FlagsForAdvancedProcessBlocks flags.
+ /// \note If BT_InBlockIsCounter is set, then the last byte of inBlocks may be modified.
virtual size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const;
- //! \brief Provides the direction of the cipher
- //! \return ENCRYPTION if IsForwardTransformation() is true, DECRYPTION otherwise
- //! \sa IsForwardTransformation(), IsPermutation()
+ /// \brief Provides the direction of the cipher
+ /// \return ENCRYPTION if IsForwardTransformation() is true, DECRYPTION otherwise
+ /// \sa IsForwardTransformation(), IsPermutation()
inline CipherDir GetCipherDirection() const {return IsForwardTransformation() ? ENCRYPTION : DECRYPTION;}
};
-//! \class StreamTransformation
-//! \brief Interface for the data processing portion of stream ciphers
-//! \sa StreamTransformationFilter()
+/// \class StreamTransformation
+/// \brief Interface for the data processing portion of stream ciphers
+/// \sa StreamTransformationFilter()
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE StreamTransformation : public Algorithm
{
public:
virtual ~StreamTransformation() {}
- //! \brief Provides a reference to this object
- //! \return A reference to this object
- //! \details Useful for passing a temporary object to a function that takes a non-const reference
+ /// \brief Provides a reference to this object
+ /// \return A reference to this object
+ /// \details Useful for passing a temporary object to a function that takes a non-const reference
StreamTransformation& Ref() {return *this;}
- //! \brief Provides the mandatory block size of the cipher
- //! \return The block size of the cipher if input must be processed in blocks, 1 otherwise
- //! \details Stream ciphers and some block ciphers modes of operation return 1. Modes that
- //! return 1 must be able to process a single byte at a time, like counter mode. If a
- //! mode of operation or block cipher cannot stream then it must not return 1.
- //! \details When filters operate the mode or cipher, ProcessData will be called with a
- //! string of bytes that is determined by MandatoryBlockSize and OptimalBlockSize. When a
- //! policy is set, like 16-byte strings for a 16-byte block cipher, the filter will buffer
- //! bytes until the specified number of bytes is available to the object.
- //! \sa ProcessData, ProcessLastBlock, MandatoryBlockSize, MinLastBlockSize, BlockPaddingSchemeDef, IsLastBlockSpecial
+ /// \brief Provides the mandatory block size of the cipher
+ /// \return The block size of the cipher if input must be processed in blocks, 1 otherwise
+ /// \details Stream ciphers and some block ciphers modes of operation return 1. Modes that
+ /// return 1 must be able to process a single byte at a time, like counter mode. If a
+ /// mode of operation or block cipher cannot stream then it must not return 1.
+ /// \details When filters operate the mode or cipher, ProcessData will be called with a
+ /// string of bytes that is determined by MandatoryBlockSize and OptimalBlockSize. When a
+ /// policy is set, like 16-byte strings for a 16-byte block cipher, the filter will buffer
+ /// bytes until the specified number of bytes is available to the object.
+ /// \sa ProcessData, ProcessLastBlock, MandatoryBlockSize, MinLastBlockSize, BlockPaddingSchemeDef, IsLastBlockSpecial
virtual unsigned int MandatoryBlockSize() const {return 1;}
- //! \brief Provides the input block size most efficient for this cipher
- //! \return The input block size that is most efficient for the cipher
- //! \details The base class implementation returns MandatoryBlockSize().
- //! \note Optimal input length is
- //! n * OptimalBlockSize() - GetOptimalBlockSizeUsed() for any n \> 0.
+ /// \brief Provides the input block size most efficient for this cipher
+ /// \return The input block size that is most efficient for the cipher
+ /// \details The base class implementation returns MandatoryBlockSize().
+ /// \note Optimal input length is
+ /// n * OptimalBlockSize() - GetOptimalBlockSizeUsed() for any n \> 0.
virtual unsigned int OptimalBlockSize() const {return MandatoryBlockSize();}
- //! \brief Provides the number of bytes used in the current block when processing at optimal block size.
- //! \return the number of bytes used in the current block when processing at the optimal block size
+ /// \brief Provides the number of bytes used in the current block when processing at optimal block size.
+ /// \return the number of bytes used in the current block when processing at the optimal block size
virtual unsigned int GetOptimalBlockSizeUsed() const {return 0;}
- //! \brief Provides input and output data alignment for optimal performance
- //! \return the input data alignment that provides optimal performance
+ /// \brief Provides input and output data alignment for optimal performance
+ /// \return the input data alignment that provides optimal performance
virtual unsigned int OptimalDataAlignment() const;
- //! \brief Encrypt or decrypt an array of bytes
- //! \param outString the output byte buffer
- //! \param inString the input byte buffer
- //! \param length the size of the input and output byte buffers, in bytes
- //! \details ProcessData is called with a string of bytes whose size depends on MandatoryBlockSize.
- //! Either inString == outString, or they must not overlap.
- //! \sa ProcessData, ProcessLastBlock, MandatoryBlockSize, MinLastBlockSize, BlockPaddingSchemeDef, IsLastBlockSpecial
+ /// \brief Encrypt or decrypt an array of bytes
+ /// \param outString the output byte buffer
+ /// \param inString the input byte buffer
+ /// \param length the size of the input and output byte buffers, in bytes
+ /// \details ProcessData is called with a string of bytes whose size depends on MandatoryBlockSize.
+ /// Either inString == outString, or they must not overlap.
+ /// \sa ProcessData, ProcessLastBlock, MandatoryBlockSize, MinLastBlockSize, BlockPaddingSchemeDef, IsLastBlockSpecial
virtual void ProcessData(byte *outString, const byte *inString, size_t length) =0;
- //! \brief Encrypt or decrypt the last block of data
- //! \param outString the output byte buffer
- //! \param outLength the size of the output byte buffer, in bytes
- //! \param inString the input byte buffer
- //! \param inLength the size of the input byte buffer, in bytes
- //! \returns the number of bytes used in outString
- //! \details ProcessLastBlock is used when the last block of data is special and requires handling
- //! by the cipher. The current implementation provides an output buffer with a size
- //! inLength+2*MandatoryBlockSize(). The return value allows the cipher to expand cipher
- //! text during encryption or shrink plain text during decryption.
- //! \details This member function is used by CBC-CTS and OCB modes.
- //! \sa ProcessData, ProcessLastBlock, MandatoryBlockSize, MinLastBlockSize, BlockPaddingSchemeDef, IsLastBlockSpecial
+ /// \brief Encrypt or decrypt the last block of data
+ /// \param outString the output byte buffer
+ /// \param outLength the size of the output byte buffer, in bytes
+ /// \param inString the input byte buffer
+ /// \param inLength the size of the input byte buffer, in bytes
+ /// \returns the number of bytes used in outString
+ /// \details ProcessLastBlock is used when the last block of data is special and requires handling
+ /// by the cipher. The current implementation provides an output buffer with a size
+ /// inLength+2*MandatoryBlockSize(). The return value allows the cipher to expand cipher
+ /// text during encryption or shrink plain text during decryption.
+ /// \details This member function is used by CBC-CTS and OCB modes.
+ /// \sa ProcessData, ProcessLastBlock, MandatoryBlockSize, MinLastBlockSize, BlockPaddingSchemeDef, IsLastBlockSpecial
virtual size_t ProcessLastBlock(byte *outString, size_t outLength, const byte *inString, size_t inLength);
- //! \brief Provides the size of the last block
- //! \returns the minimum size of the last block
- //! \details MinLastBlockSize() returns the minimum size of the last block. 0 indicates the last
- //! block is not special.
- //! \details MandatoryBlockSize() enlists one of two behaviors. First, if MandatoryBlockSize()
- //! returns 1, then the cipher can be streamed and ProcessData() is called with the tail bytes.
- //! Second, if MandatoryBlockSize() returns non-0, then the string of bytes is padded to
- //! MandatoryBlockSize() according to the padding mode. Then, ProcessData() is called with the
- //! padded string of bytes.
- //! \details Some authenticated encryption modes are not expressed well with MandatoryBlockSize()
- //! and MinLastBlockSize(). For example, AES/OCB uses 16-byte blocks (MandatoryBlockSize = 16)
- //! and the last block requires special processing (MinLastBlockSize = 0). However, 0 is a valid
- //! last block size for OCB and the special processing is custom padding, and not standard PKCS
- //! padding. In response an unambiguous IsLastBlockSpecial() was added.
- //! \sa ProcessData, ProcessLastBlock, MandatoryBlockSize, MinLastBlockSize, BlockPaddingSchemeDef, IsLastBlockSpecial
+ /// \brief Provides the size of the last block
+ /// \returns the minimum size of the last block
+ /// \details MinLastBlockSize() returns the minimum size of the last block. 0 indicates the last
+ /// block is not special.
+ /// \details MandatoryBlockSize() enlists one of two behaviors. First, if MandatoryBlockSize()
+ /// returns 1, then the cipher can be streamed and ProcessData() is called with the tail bytes.
+ /// Second, if MandatoryBlockSize() returns non-0, then the string of bytes is padded to
+ /// MandatoryBlockSize() according to the padding mode. Then, ProcessData() is called with the
+ /// padded string of bytes.
+ /// \details Some authenticated encryption modes are not expressed well with MandatoryBlockSize()
+ /// and MinLastBlockSize(). For example, AES/OCB uses 16-byte blocks (MandatoryBlockSize = 16)
+ /// and the last block requires special processing (MinLastBlockSize = 0). However, 0 is a valid
+ /// last block size for OCB and the special processing is custom padding, and not standard PKCS
+ /// padding. In response an unambiguous IsLastBlockSpecial() was added.
+ /// \sa ProcessData, ProcessLastBlock, MandatoryBlockSize, MinLastBlockSize, BlockPaddingSchemeDef, IsLastBlockSpecial
virtual unsigned int MinLastBlockSize() const {return 0;}
- //! \brief Determines if the last block receives special processing
- //! \returns true if the last block reveives special processing, false otherwise.
- //! \details Some authenticated encryption modes are not expressed well with
- //! MandatoryBlockSize() and MinLastBlockSize(). For example, AES/OCB uses
- //! 16-byte blocks (MandatoryBlockSize = 16) and the last block requires special processing
- //! (MinLastBlockSize = 0). However, 0 is a valid last block size for OCB and the special
- //! processing is custom padding, and not standard PKCS padding. In response an
- //! unambiguous IsLastBlockSpecial() was added.
- //! \details When IsLastBlockSpecial() returns false nothing special happens. All the former
- //! rules and behaviors apply. This is the default behavior of IsLastBlockSpecial().
- //! \details When IsLastBlockSpecial() returns true four things happen. First, MinLastBlockSize = 0
- //! means 0 is a valid block size that should be processed. Second, standard block cipher padding is
- //! \a not \a applied. Third, the caller supplies an outString is larger than inString by
- //! 2*MandatoryBlockSize(). That is, there's a reserve available when processing the last block.
- //! Fourth, the cipher is responsible for finalization like custom padding. The cipher will tell
- //! the library how many bytes were processed or used by returning the appropriate value from
- //! ProcessLastBlock().
- //! \details The return value of ProcessLastBlock() indicates how many bytes were written to
- //! outString. A filter pipelining data will send outString and up to outLength
- //! to an AttachedTransformation() for additional processing. Below is an example of the code
- //! used in StreamTransformationFilter::LastPut.
- //! if (m_cipher.IsLastBlockSpecial())
- //! {
- //! size_t reserve = 2*m_cipher.MandatoryBlockSize();
- //! space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, length+reserve);
- //! length = m_cipher.ProcessLastBlock(space, length+reserve, inString, length);
- //! AttachedTransformation()->Put(space, length);
- //! return;
- //! }
- //! \sa ProcessData, ProcessLastBlock, MandatoryBlockSize, MinLastBlockSize, BlockPaddingSchemeDef, IsLastBlockSpecial
- //! \since Crypto++ 6.0
+ /// \brief Determines if the last block receives special processing
+ /// \returns true if the last block reveives special processing, false otherwise.
+ /// \details Some authenticated encryption modes are not expressed well with
+ /// MandatoryBlockSize() and MinLastBlockSize(). For example, AES/OCB uses
+ /// 16-byte blocks (MandatoryBlockSize = 16) and the last block requires special processing
+ /// (MinLastBlockSize = 0). However, 0 is a valid last block size for OCB and the special
+ /// processing is custom padding, and not standard PKCS padding. In response an
+ /// unambiguous IsLastBlockSpecial() was added.
+ /// \details When IsLastBlockSpecial() returns false nothing special happens. All the former
+ /// rules and behaviors apply. This is the default behavior of IsLastBlockSpecial().
+ /// \details When IsLastBlockSpecial() returns true four things happen. First, MinLastBlockSize = 0
+ /// means 0 is a valid block size that should be processed. Second, standard block cipher padding is
+ /// \a not \a applied. Third, the caller supplies an outString is larger than inString by
+ /// 2*MandatoryBlockSize(). That is, there's a reserve available when processing the last block.
+ /// Fourth, the cipher is responsible for finalization like custom padding. The cipher will tell
+ /// the library how many bytes were processed or used by returning the appropriate value from
+ /// ProcessLastBlock().
+ /// \details The return value of ProcessLastBlock() indicates how many bytes were written to
+ /// outString. A filter pipelining data will send outString and up to outLength
+ /// to an AttachedTransformation() for additional processing. Below is an example of the code
+ /// used in StreamTransformationFilter::LastPut.
+ /// if (m_cipher.IsLastBlockSpecial())
+ /// {
+ /// size_t reserve = 2*m_cipher.MandatoryBlockSize();
+ /// space = HelpCreatePutSpace(*AttachedTransformation(), DEFAULT_CHANNEL, length+reserve);
+ /// length = m_cipher.ProcessLastBlock(space, length+reserve, inString, length);
+ /// AttachedTransformation()->Put(space, length);
+ /// return;
+ /// }
+ /// \sa ProcessData, ProcessLastBlock, MandatoryBlockSize, MinLastBlockSize, BlockPaddingSchemeDef, IsLastBlockSpecial
+ /// \since Crypto++ 6.0
virtual bool IsLastBlockSpecial() const {return false;}
- //! \brief Encrypt or decrypt a string of bytes
- //! \param inoutString the string to process
- //! \param length the size of the inoutString, in bytes
- //! \details Internally, the base class implementation calls ProcessData().
+ /// \brief Encrypt or decrypt a string of bytes
+ /// \param inoutString the string to process
+ /// \param length the size of the inoutString, in bytes
+ /// \details Internally, the base class implementation calls ProcessData().
inline void ProcessString(byte *inoutString, size_t length)
{ProcessData(inoutString, inoutString, length);}
- //! \brief Encrypt or decrypt a string of bytes
- //! \param outString the output string to process
- //! \param inString the input string to process
- //! \param length the size of the input and output strings, in bytes
- //! \details Internally, the base class implementation calls ProcessData().
+ /// \brief Encrypt or decrypt a string of bytes
+ /// \param outString the output string to process
+ /// \param inString the input string to process
+ /// \param length the size of the input and output strings, in bytes
+ /// \details Internally, the base class implementation calls ProcessData().
inline void ProcessString(byte *outString, const byte *inString, size_t length)
{ProcessData(outString, inString, length);}
- //! \brief Encrypt or decrypt a byte
- //! \param input the input byte to process
- //! \details Internally, the base class implementation calls ProcessData() with a size of 1.
+ /// \brief Encrypt or decrypt a byte
+ /// \param input the input byte to process
+ /// \details Internally, the base class implementation calls ProcessData() with a size of 1.
inline byte ProcessByte(byte input)
{ProcessData(&input, &input, 1); return input;}
- //! \brief Determines whether the cipher supports random access
- //! \returns true if the cipher supports random access, false otherwise
+ /// \brief Determines whether the cipher supports random access
+ /// \returns true if the cipher supports random access, false otherwise
virtual bool IsRandomAccess() const =0;
- //! \brief Seek to an absolute position
- //! \param pos position to seek
- //! \throws NotImplemented
- //! \details The base class implementation throws NotImplemented. The function
- //! \ref CRYPTOPP_ASSERT "asserts" IsRandomAccess() in debug builds.
+ /// \brief Seek to an absolute position
+ /// \param pos position to seek
+ /// \throws NotImplemented
+ /// \details The base class implementation throws NotImplemented. The function
+ /// \ref CRYPTOPP_ASSERT "asserts" IsRandomAccess() in debug builds.
virtual void Seek(lword pos)
{
CRYPTOPP_UNUSED(pos);
@@ -1046,236 +1046,236 @@ public:
throw NotImplemented("StreamTransformation: this object doesn't support random access");
}
- //! \brief Determines whether the cipher is self-inverting
- //! \returns true if the cipher is self-inverting, false otherwise
- //! \details IsSelfInverting determines whether this transformation is
- //! self-inverting (e.g. xor with a keystream).
+ /// \brief Determines whether the cipher is self-inverting
+ /// \returns true if the cipher is self-inverting, false otherwise
+ /// \details IsSelfInverting determines whether this transformation is
+ /// self-inverting (e.g. xor with a keystream).
virtual bool IsSelfInverting() const =0;
- //! \brief Determines if the cipher is being operated in its forward direction
- //! \returns true if DIR is ENCRYPTION, false otherwise
- //! \sa IsForwardTransformation(), IsPermutation(), GetCipherDirection()
+ /// \brief Determines if the cipher is being operated in its forward direction
+ /// \returns true if DIR is ENCRYPTION, false otherwise
+ /// \sa IsForwardTransformation(), IsPermutation(), GetCipherDirection()
virtual bool IsForwardTransformation() const =0;
};
-//! \class HashTransformation
-//! \brief Interface for hash functions and data processing part of MACs
-//! \details HashTransformation objects are stateful. They are created in an initial state,
-//! change state as Update() is called, and return to the initial
-//! state when Final() is called. This interface allows a large message to
-//! be hashed in pieces by calling Update() on each piece followed by
-//! calling Final().
-//! \sa HashFilter(), HashVerificationFilter()
+/// \class HashTransformation
+/// \brief Interface for hash functions and data processing part of MACs
+/// \details HashTransformation objects are stateful. They are created in an initial state,
+/// change state as Update() is called, and return to the initial
+/// state when Final() is called. This interface allows a large message to
+/// be hashed in pieces by calling Update() on each piece followed by
+/// calling Final().
+/// \sa HashFilter(), HashVerificationFilter()
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE HashTransformation : public Algorithm
{
public:
virtual ~HashTransformation() {}
- //! \brief Provides a reference to this object
- //! \return A reference to this object
- //! \details Useful for passing a temporary object to a function that takes a non-const reference
+ /// \brief Provides a reference to this object
+ /// \return A reference to this object
+ /// \details Useful for passing a temporary object to a function that takes a non-const reference
HashTransformation& Ref() {return *this;}
- //! \brief Updates a hash with additional input
- //! \param input the additional input as a buffer
- //! \param length the size of the buffer, in bytes
+ /// \brief Updates a hash with additional input
+ /// \param input the additional input as a buffer
+ /// \param length the size of the buffer, in bytes
virtual void Update(const byte *input, size_t length) =0;
- //! \brief Request space which can be written into by the caller
- //! \param size the requested size of the buffer
- //! \details The purpose of this method is to help avoid extra memory allocations.
- //! \details size is an \a IN and \a OUT parameter and used as a hint. When the call is made,
- //! size is the requested size of the buffer. When the call returns, size is the size of
- //! the array returned to the caller.
- //! \details The base class implementation sets size to 0 and returns NULL or nullptr.
- //! \note Some objects, like ArraySink, cannot create a space because its fixed.
+ /// \brief Request space which can be written into by the caller
+ /// \param size the requested size of the buffer
+ /// \details The purpose of this method is to help avoid extra memory allocations.
+ /// \details size is an \a IN and \a OUT parameter and used as a hint. When the call is made,
+ /// size is the requested size of the buffer. When the call returns, size is the size of
+ /// the array returned to the caller.
+ /// \details The base class implementation sets size to 0 and returns NULL or nullptr.
+ /// \note Some objects, like ArraySink, cannot create a space because its fixed.
virtual byte * CreateUpdateSpace(size_t &size) {size=0; return NULLPTR;}
- //! \brief Computes the hash of the current message
- //! \param digest a pointer to the buffer to receive the hash
- //! \details Final() restarts the hash for a new message.
- //! \pre COUNTOF(digest) == DigestSize() or COUNTOF(digest) == HASH::DIGESTSIZE ensures
- //! the output byte buffer is large enough for the digest.
+ /// \brief Computes the hash of the current message
+ /// \param digest a pointer to the buffer to receive the hash
+ /// \details Final() restarts the hash for a new message.
+ /// \pre COUNTOF(digest) == DigestSize() or COUNTOF(digest) == HASH::DIGESTSIZE ensures
+ /// the output byte buffer is large enough for the digest.
virtual void Final(byte *digest)
{TruncatedFinal(digest, DigestSize());}
- //! \brief Restart the hash
- //! \details Discards the current state, and restart for a new message
+ /// \brief Restart the hash
+ /// \details Discards the current state, and restart for a new message
virtual void Restart()
{TruncatedFinal(NULLPTR, 0);}
- //! Provides the digest size of the hash
- //! \return the digest size of the hash.
+ /// Provides the digest size of the hash
+ /// \return the digest size of the hash.
virtual unsigned int DigestSize() const =0;
- //! Provides the tag size of the hash
- //! \return the tag size of the hash.
- //! \details Same as DigestSize().
+ /// Provides the tag size of the hash
+ /// \return the tag size of the hash.
+ /// \details Same as DigestSize().
unsigned int TagSize() const {return DigestSize();}
- //! \brief Provides the block size of the compression function
- //! \return the block size of the compression function, in bytes
- //! \details BlockSize() will return 0 if the hash is not block based. For example,
- //! SHA3 is a recursive hash (not an iterative hash), and it does not have a block size.
+ /// \brief Provides the block size of the compression function
+ /// \return the block size of the compression function, in bytes
+ /// \details BlockSize() will return 0 if the hash is not block based. For example,
+ /// SHA3 is a recursive hash (not an iterative hash), and it does not have a block size.
virtual unsigned int BlockSize() const {return 0;}
- //! \brief Provides the input block size most efficient for this hash.
- //! \return The input block size that is most efficient for the cipher
- //! \details The base class implementation returns MandatoryBlockSize().
- //! \details Optimal input length is
- //! n * OptimalBlockSize() - GetOptimalBlockSizeUsed() for any n \> 0.
+ /// \brief Provides the input block size most efficient for this hash.
+ /// \return The input block size that is most efficient for the cipher
+ /// \details The base class implementation returns MandatoryBlockSize().
+ /// \details Optimal input length is
+ /// n * OptimalBlockSize() - GetOptimalBlockSizeUsed() for any n \> 0.
virtual unsigned int OptimalBlockSize() const {return 1;}
- //! \brief Provides input and output data alignment for optimal performance
- //! \return the input data alignment that provides optimal performance
+ /// \brief Provides input and output data alignment for optimal performance
+ /// \return the input data alignment that provides optimal performance
virtual unsigned int OptimalDataAlignment() const;
- //! \brief Updates the hash with additional input and computes the hash of the current message
- //! \param digest a pointer to the buffer to receive the hash
- //! \param input the additional input as a buffer
- //! \param length the size of the buffer, in bytes
- //! \details Use this if your input is in one piece and you don't want to call Update()
- //! and Final() separately
- //! \details CalculateDigest() restarts the hash for the next message.
- //! \pre COUNTOF(digest) == DigestSize() or COUNTOF(digest) == HASH::DIGESTSIZE ensures
- //! the output byte buffer is large enough for the digest.
+ /// \brief Updates the hash with additional input and computes the hash of the current message
+ /// \param digest a pointer to the buffer to receive the hash
+ /// \param input the additional input as a buffer
+ /// \param length the size of the buffer, in bytes
+ /// \details Use this if your input is in one piece and you don't want to call Update()
+ /// and Final() separately
+ /// \details CalculateDigest() restarts the hash for the next message.
+ /// \pre COUNTOF(digest) == DigestSize() or COUNTOF(digest) == HASH::DIGESTSIZE ensures
+ /// the output byte buffer is large enough for the digest.
virtual void CalculateDigest(byte *digest, const byte *input, size_t length)
{Update(input, length); Final(digest);}
- //! \brief Verifies the hash of the current message
- //! \param digest a pointer to the buffer of an \a existing hash
- //! \return \p true if the existing hash matches the computed hash, \p false otherwise
- //! \throws ThrowIfInvalidTruncatedSize() if the existing hash's size exceeds DigestSize()
- //! \details Verify() performs a bitwise compare on the buffers using VerifyBufsEqual(), which is
- //! a constant time comparison function. digestLength cannot exceed DigestSize().
- //! \details Verify() restarts the hash for the next message.
- //! \pre COUNTOF(digest) == DigestSize() or COUNTOF(digest) == HASH::DIGESTSIZE ensures
- //! the output byte buffer is large enough for the digest.
+ /// \brief Verifies the hash of the current message
+ /// \param digest a pointer to the buffer of an \a existing hash
+ /// \return \p true if the existing hash matches the computed hash, \p false otherwise
+ /// \throws ThrowIfInvalidTruncatedSize() if the existing hash's size exceeds DigestSize()
+ /// \details Verify() performs a bitwise compare on the buffers using VerifyBufsEqual(), which is
+ /// a constant time comparison function. digestLength cannot exceed DigestSize().
+ /// \details Verify() restarts the hash for the next message.
+ /// \pre COUNTOF(digest) == DigestSize() or COUNTOF(digest) == HASH::DIGESTSIZE ensures
+ /// the output byte buffer is large enough for the digest.
virtual bool Verify(const byte *digest)
{return TruncatedVerify(digest, DigestSize());}
- //! \brief Updates the hash with additional input and verifies the hash of the current message
- //! \param digest a pointer to the buffer of an \a existing hash
- //! \param input the additional input as a buffer
- //! \param length the size of the buffer, in bytes
- //! \return \p true if the existing hash matches the computed hash, \p false otherwise
- //! \throws ThrowIfInvalidTruncatedSize() if the existing hash's size exceeds DigestSize()
- //! \details Use this if your input is in one piece and you don't want to call Update()
- //! and Verify() separately
- //! \details VerifyDigest() performs a bitwise compare on the buffers using VerifyBufsEqual(),
- //! which is a constant time comparison function. digestLength cannot exceed DigestSize().
- //! \details VerifyDigest() restarts the hash for the next message.
- //! \pre COUNTOF(digest) == DigestSize() or COUNTOF(digest) == HASH::DIGESTSIZE ensures
- //! the output byte buffer is large enough for the digest.
+ /// \brief Updates the hash with additional input and verifies the hash of the current message
+ /// \param digest a pointer to the buffer of an \a existing hash
+ /// \param input the additional input as a buffer
+ /// \param length the size of the buffer, in bytes
+ /// \return \p true if the existing hash matches the computed hash, \p false otherwise
+ /// \throws ThrowIfInvalidTruncatedSize() if the existing hash's size exceeds DigestSize()
+ /// \details Use this if your input is in one piece and you don't want to call Update()
+ /// and Verify() separately
+ /// \details VerifyDigest() performs a bitwise compare on the buffers using VerifyBufsEqual(),
+ /// which is a constant time comparison function. digestLength cannot exceed DigestSize().
+ /// \details VerifyDigest() restarts the hash for the next message.
+ /// \pre COUNTOF(digest) == DigestSize() or COUNTOF(digest) == HASH::DIGESTSIZE ensures
+ /// the output byte buffer is large enough for the digest.
virtual bool VerifyDigest(const byte *digest, const byte *input, size_t length)
{Update(input, length); return Verify(digest);}
- //! \brief Computes the hash of the current message
- //! \param digest a pointer to the buffer to receive the hash
- //! \param digestSize the size of the truncated digest, in bytes
- //! \details TruncatedFinal() call Final() and then copies digestSize bytes to digest.
- //! The hash is restarted the hash for the next message.
+ /// \brief Computes the hash of the current message
+ /// \param digest a pointer to the buffer to receive the hash
+ /// \param digestSize the size of the truncated digest, in bytes
+ /// \details TruncatedFinal() call Final() and then copies digestSize bytes to digest.
+ /// The hash is restarted the hash for the next message.
virtual void TruncatedFinal(byte *digest, size_t digestSize) =0;
- //! \brief Updates the hash with additional input and computes the hash of the current message
- //! \param digest a pointer to the buffer to receive the hash
- //! \param digestSize the length of the truncated hash, in bytes
- //! \param input the additional input as a buffer
- //! \param length the size of the buffer, in bytes
- //! \details Use this if your input is in one piece and you don't want to call Update()
- //! and CalculateDigest() separately.
- //! \details CalculateTruncatedDigest() restarts the hash for the next message.
- //! \pre COUNTOF(digest) == DigestSize() or COUNTOF(digest) == HASH::DIGESTSIZE ensures
- //! the output byte buffer is large enough for the digest.
+ /// \brief Updates the hash with additional input and computes the hash of the current message
+ /// \param digest a pointer to the buffer to receive the hash
+ /// \param digestSize the length of the truncated hash, in bytes
+ /// \param input the additional input as a buffer
+ /// \param length the size of the buffer, in bytes
+ /// \details Use this if your input is in one piece and you don't want to call Update()
+ /// and CalculateDigest() separately.
+ /// \details CalculateTruncatedDigest() restarts the hash for the next message.
+ /// \pre COUNTOF(digest) == DigestSize() or COUNTOF(digest) == HASH::DIGESTSIZE ensures
+ /// the output byte buffer is large enough for the digest.
virtual void CalculateTruncatedDigest(byte *digest, size_t digestSize, const byte *input, size_t length)
{Update(input, length); TruncatedFinal(digest, digestSize);}
- //! \brief Verifies the hash of the current message
- //! \param digest a pointer to the buffer of an \a existing hash
- //! \param digestLength the size of the truncated hash, in bytes
- //! \return \p true if the existing hash matches the computed hash, \p false otherwise
- //! \throws ThrowIfInvalidTruncatedSize() if digestLength exceeds DigestSize()
- //! \details TruncatedVerify() is a truncated version of Verify(). It can operate on a
- //! buffer smaller than DigestSize(). However, digestLength cannot exceed DigestSize().
- //! \details Verify() performs a bitwise compare on the buffers using VerifyBufsEqual(), which is
- //! a constant time comparison function. digestLength cannot exceed DigestSize().
- //! \details TruncatedVerify() restarts the hash for the next message.
+ /// \brief Verifies the hash of the current message
+ /// \param digest a pointer to the buffer of an \a existing hash
+ /// \param digestLength the size of the truncated hash, in bytes
+ /// \return \p true if the existing hash matches the computed hash, \p false otherwise
+ /// \throws ThrowIfInvalidTruncatedSize() if digestLength exceeds DigestSize()
+ /// \details TruncatedVerify() is a truncated version of Verify(). It can operate on a
+ /// buffer smaller than DigestSize(). However, digestLength cannot exceed DigestSize().
+ /// \details Verify() performs a bitwise compare on the buffers using VerifyBufsEqual(), which is
+ /// a constant time comparison function. digestLength cannot exceed DigestSize().
+ /// \details TruncatedVerify() restarts the hash for the next message.
virtual bool TruncatedVerify(const byte *digest, size_t digestLength);
- //! \brief Updates the hash with additional input and verifies the hash of the current message
- //! \param digest a pointer to the buffer of an \a existing hash
- //! \param digestLength the size of the truncated hash, in bytes
- //! \param input the additional input as a buffer
- //! \param length the size of the buffer, in bytes
- //! \return \p true if the existing hash matches the computed hash, \p false otherwise
- //! \throws ThrowIfInvalidTruncatedSize() if digestLength exceeds DigestSize()
- //! \details Use this if your input is in one piece and you don't want to call Update()
- //! and TruncatedVerify() separately.
- //! \details VerifyTruncatedDigest() is a truncated version of VerifyDigest(). It can operate
- //! on a buffer smaller than DigestSize(). However, digestLength cannot exceed DigestSize().
- //! \details VerifyTruncatedDigest() restarts the hash for the next message.
- //! \pre COUNTOF(digest) == DigestSize() or COUNTOF(digest) == HASH::DIGESTSIZE ensures
- //! the output byte buffer is large enough for the digest.
+ /// \brief Updates the hash with additional input and verifies the hash of the current message
+ /// \param digest a pointer to the buffer of an \a existing hash
+ /// \param digestLength the size of the truncated hash, in bytes
+ /// \param input the additional input as a buffer
+ /// \param length the size of the buffer, in bytes
+ /// \return \p true if the existing hash matches the computed hash, \p false otherwise
+ /// \throws ThrowIfInvalidTruncatedSize() if digestLength exceeds DigestSize()
+ /// \details Use this if your input is in one piece and you don't want to call Update()
+ /// and TruncatedVerify() separately.
+ /// \details VerifyTruncatedDigest() is a truncated version of VerifyDigest(). It can operate
+ /// on a buffer smaller than DigestSize(). However, digestLength cannot exceed DigestSize().
+ /// \details VerifyTruncatedDigest() restarts the hash for the next message.
+ /// \pre COUNTOF(digest) == DigestSize() or COUNTOF(digest) == HASH::DIGESTSIZE ensures
+ /// the output byte buffer is large enough for the digest.
virtual bool VerifyTruncatedDigest(const byte *digest, size_t digestLength, const byte *input, size_t length)
{Update(input, length); return TruncatedVerify(digest, digestLength);}
protected:
- //! \brief Validates a truncated digest size
- //! \param size the requested digest size
- //! \throws InvalidArgument if the algorithm's digest size cannot be truncated to the requested size
- //! \details Throws an exception when the truncated digest size is greater than DigestSize()
+ /// \brief Validates a truncated digest size
+ /// \param size the requested digest size
+ /// \throws InvalidArgument if the algorithm's digest size cannot be truncated to the requested size
+ /// \details Throws an exception when the truncated digest size is greater than DigestSize()
void ThrowIfInvalidTruncatedSize(size_t size) const;
};
-//! \brief Interface for one direction (encryption or decryption) of a block cipher
-//! \details These objects usually should not be used directly. See BlockTransformation for more details.
+/// \brief Interface for one direction (encryption or decryption) of a block cipher
+/// \details These objects usually should not be used directly. See BlockTransformation for more details.
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BlockCipher : public SimpleKeyingInterface, public BlockTransformation
{
protected:
const Algorithm & GetAlgorithm() const {return *this;}
};
-//! \brief Interface for one direction (encryption or decryption) of a stream cipher or cipher mode
-//! \details These objects usually should not be used directly. See StreamTransformation for more details.
+/// \brief Interface for one direction (encryption or decryption) of a stream cipher or cipher mode
+/// \details These objects usually should not be used directly. See StreamTransformation for more details.
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SymmetricCipher : public SimpleKeyingInterface, public StreamTransformation
{
protected:
const Algorithm & GetAlgorithm() const {return *this;}
};
-//! \brief Interface for message authentication codes
-//! \details These objects usually should not be used directly. See HashTransformation for more details.
+/// \brief Interface for message authentication codes
+/// \details These objects usually should not be used directly. See HashTransformation for more details.
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE MessageAuthenticationCode : public SimpleKeyingInterface, public HashTransformation
{
protected:
const Algorithm & GetAlgorithm() const {return *this;}
};
-//! \class AuthenticatedSymmetricCipher
-//! \brief Interface for authenticated encryption modes of operation
-//! \details AuthenticatedSymmetricCipher() provides the interface for one direction
-//! (encryption or decryption) of a stream cipher or block cipher mode with authentication. The
-//! StreamTransformation() part of this interface is used to encrypt or decrypt the data. The
-//! MessageAuthenticationCode() part of the interface is used to input additional authenticated
-//! data (AAD), which is MAC'ed but not encrypted. The MessageAuthenticationCode() part is also
-//! used to generate and verify the MAC.
-//! \details Crypto++ provides four authenticated encryption modes of operation - CCM, EAX, GCM
-//! and OCB mode. All modes implement AuthenticatedSymmetricCipher() and the motivation for
-//! the API, like calling AAD a "header", can be found in Bellare, Rogaway and
-//! Wagner's The EAX Mode of
-//! Operation. The EAX paper suggested a basic API to help standardize AEAD schemes in
-//! software and promote adoption of the modes.
-//! \sa Authenticated
-//! Encryption on the Crypto++ wiki.
-//! \since Crypto++ 5.6.0
+/// \class AuthenticatedSymmetricCipher
+/// \brief Interface for authenticated encryption modes of operation
+/// \details AuthenticatedSymmetricCipher() provides the interface for one direction
+/// (encryption or decryption) of a stream cipher or block cipher mode with authentication. The
+/// StreamTransformation() part of this interface is used to encrypt or decrypt the data. The
+/// MessageAuthenticationCode() part of the interface is used to input additional authenticated
+/// data (AAD), which is MAC'ed but not encrypted. The MessageAuthenticationCode() part is also
+/// used to generate and verify the MAC.
+/// \details Crypto++ provides four authenticated encryption modes of operation - CCM, EAX, GCM
+/// and OCB mode. All modes implement AuthenticatedSymmetricCipher() and the motivation for
+/// the API, like calling AAD a "header", can be found in Bellare, Rogaway and
+/// Wagner's The EAX Mode of
+/// Operation. The EAX paper suggested a basic API to help standardize AEAD schemes in
+/// software and promote adoption of the modes.
+/// \sa Authenticated
+/// Encryption on the Crypto++ wiki.
+/// \since Crypto++ 5.6.0
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedSymmetricCipher : public MessageAuthenticationCode, public StreamTransformation
{
public:
virtual ~AuthenticatedSymmetricCipher() {}
- //! \brief Exception thrown when the object is in the wrong state for the operation
- //! \details this indicates that a member function was called in the wrong state, for example trying to encrypt
- //! a message before having set the key or IV
+ /// \brief Exception thrown when the object is in the wrong state for the operation
+ /// \details this indicates that a member function was called in the wrong state, for example trying to encrypt
+ /// a message before having set the key or IV
class BadState : public Exception
{
public:
@@ -1283,40 +1283,40 @@ public:
explicit BadState(const std::string &name, const char *function, const char *state) : Exception(OTHER_ERROR, name + ": " + function + " was called before " + state) {}
};
- //! \brief Provides the maximum length of AAD that can be input
- //! \return the maximum length of AAD that can be input before the encrypted data
+ /// \brief Provides the maximum length of AAD that can be input
+ /// \return the maximum length of AAD that can be input before the encrypted data
virtual lword MaxHeaderLength() const =0;
- //! \brief Provides the maximum length of encrypted data
- //! \return the maximum length of encrypted data
+ /// \brief Provides the maximum length of encrypted data
+ /// \return the maximum length of encrypted data
virtual lword MaxMessageLength() const =0;
- //! \brief Provides the the maximum length of AAD
- //! \return the maximum length of AAD that can be input after the encrypted data
+ /// \brief Provides the the maximum length of AAD
+ /// \return the maximum length of AAD that can be input after the encrypted data
virtual lword MaxFooterLength() const {return 0;}
- //! \brief Determines if data lengths must be specified prior to inputting data
- //! \return true if the data lengths are required before inputting data, false otherwise
- //! \details if this function returns true, SpecifyDataLengths() must be called before attempting to input data.
- //! This is the case for some schemes, such as CCM.
- //! \sa SpecifyDataLengths()
+ /// \brief Determines if data lengths must be specified prior to inputting data
+ /// \return true if the data lengths are required before inputting data, false otherwise
+ /// \details if this function returns true, SpecifyDataLengths() must be called before attempting to input data.
+ /// This is the case for some schemes, such as CCM.
+ /// \sa SpecifyDataLengths()
virtual bool NeedsPrespecifiedDataLengths() const {return false;}
- //! \brief Prespecifies the data lengths
- //! \details this function only needs to be called if NeedsPrespecifiedDataLengths() returns true
- //! \sa NeedsPrespecifiedDataLengths()
+ /// \brief Prespecifies the data lengths
+ /// \details this function only needs to be called if NeedsPrespecifiedDataLengths() returns true
+ /// \sa NeedsPrespecifiedDataLengths()
void SpecifyDataLengths(lword headerLength, lword messageLength, lword footerLength=0);
- //! \brief Encrypts and calculates a MAC in one call
- //! \details EncryptAndAuthenticate() encrypts and generates the MAC in one call. The function will truncate MAC if
- //! macSize < TagSize().
+ /// \brief Encrypts and calculates a MAC in one call
+ /// \details EncryptAndAuthenticate() encrypts and generates the MAC in one call. The function will truncate MAC if
+ /// macSize < TagSize().
virtual void EncryptAndAuthenticate(byte *ciphertext, byte *mac, size_t macSize, const byte *iv, int ivLength, const byte *header, size_t headerLength, const byte *message, size_t messageLength);
- //! \brief Decrypts and verifies a MAC in one call
- //! \return true if the MAC is valid and the decoding succeeded, false otherwise
- //! \details DecryptAndVerify() decrypts and verifies the MAC in one call. The function returns true iff MAC is valid.
- //! DecryptAndVerify() will assume MAC is truncated if macLength < TagSize().
+ /// \brief Decrypts and verifies a MAC in one call
+ /// \return true if the MAC is valid and the decoding succeeded, false otherwise
+ /// \details DecryptAndVerify() decrypts and verifies the MAC in one call. The function returns true iff MAC is valid.
+ /// DecryptAndVerify() will assume MAC is truncated if macLength < TagSize().
virtual bool DecryptAndVerify(byte *message, const byte *mac, size_t macLength, const byte *iv, int ivLength, const byte *header, size_t headerLength, const byte *ciphertext, size_t ciphertextLength);
- //! \brief Provides the name of this algorithm
- //! \return the standard algorithm name
- //! \details The standard algorithm name can be a name like \a AES or \a AES/GCM. Some algorithms
- //! do not have standard names yet. For example, there is no standard algorithm name for
- //! Shoup's ECIES.
+ /// \brief Provides the name of this algorithm
+ /// \return the standard algorithm name
+ /// \details The standard algorithm name can be a name like \a AES or \a AES/GCM. Some algorithms
+ /// do not have standard names yet. For example, there is no standard algorithm name for
+ /// Shoup's ECIES.
virtual std::string AlgorithmName() const =0;
protected:
@@ -1326,86 +1326,86 @@ protected:
{CRYPTOPP_UNUSED(headerLength); CRYPTOPP_UNUSED(messageLength); CRYPTOPP_UNUSED(footerLength);}
};
-//! \class RandomNumberGenerator
-//! \brief Interface for random number generators
-//! \details The library provides a number of random number generators, from software based to hardware based generators.
-//! \details All generated values are uniformly distributed over the range specified.
+/// \class RandomNumberGenerator
+/// \brief Interface for random number generators
+/// \details The library provides a number of random number generators, from software based to hardware based generators.
+/// \details All generated values are uniformly distributed over the range specified.
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE RandomNumberGenerator : public Algorithm
{
public:
virtual ~RandomNumberGenerator() {}
- //! \brief Update RNG state with additional unpredictable values
- //! \param input the entropy to add to the generator
- //! \param length the size of the input buffer
- //! \throws NotImplemented
- //! \details A generator may or may not accept additional entropy. Call CanIncorporateEntropy() to test for the
- //! ability to use additional entropy.
- //! \details If a derived class does not override IncorporateEntropy(), then the base class throws
- //! NotImplemented.
+ /// \brief Update RNG state with additional unpredictable values
+ /// \param input the entropy to add to the generator
+ /// \param length the size of the input buffer
+ /// \throws NotImplemented
+ /// \details A generator may or may not accept additional entropy. Call CanIncorporateEntropy() to test for the
+ /// ability to use additional entropy.
+ /// \details If a derived class does not override IncorporateEntropy(), then the base class throws
+ /// NotImplemented.
virtual void IncorporateEntropy(const byte *input, size_t length)
{
CRYPTOPP_UNUSED(input); CRYPTOPP_UNUSED(length);
throw NotImplemented("RandomNumberGenerator: IncorporateEntropy not implemented");
}
- //! \brief Determines if a generator can accept additional entropy
- //! \return true if IncorporateEntropy() is implemented
+ /// \brief Determines if a generator can accept additional entropy
+ /// \return true if IncorporateEntropy() is implemented
virtual bool CanIncorporateEntropy() const {return false;}
- //! \brief Generate new random byte and return it
- //! \return a random 8-bit byte
- //! \details Default implementation calls GenerateBlock() with one byte.
- //! \details All generated values are uniformly distributed over the range specified within the
- //! the constraints of a particular generator.
+ /// \brief Generate new random byte and return it
+ /// \return a random 8-bit byte
+ /// \details Default implementation calls GenerateBlock() with one byte.
+ /// \details All generated values are uniformly distributed over the range specified within the
+ /// the constraints of a particular generator.
virtual byte GenerateByte();
- //! \brief Generate new random bit and return it
- //! \return a random bit
- //! \details The default implementation calls GenerateByte() and return its lowest bit.
- //! \details All generated values are uniformly distributed over the range specified within the
- //! the constraints of a particular generator.
+ /// \brief Generate new random bit and return it
+ /// \return a random bit
+ /// \details The default implementation calls GenerateByte() and return its lowest bit.
+ /// \details All generated values are uniformly distributed over the range specified within the
+ /// the constraints of a particular generator.
virtual unsigned int GenerateBit();
- //! \brief Generate a random 32 bit word in the range min to max, inclusive
- //! \param min the lower bound of the range
- //! \param max the upper bound of the range
- //! \return a random 32-bit word
- //! \details The default implementation calls Crop() on the difference between max and
- //! min, and then returns the result added to min.
- //! \details All generated values are uniformly distributed over the range specified within the
- //! the constraints of a particular generator.
+ /// \brief Generate a random 32 bit word in the range min to max, inclusive
+ /// \param min the lower bound of the range
+ /// \param max the upper bound of the range
+ /// \return a random 32-bit word
+ /// \details The default implementation calls Crop() on the difference between max and
+ /// min, and then returns the result added to min.
+ /// \details All generated values are uniformly distributed over the range specified within the
+ /// the constraints of a particular generator.
virtual word32 GenerateWord32(word32 min=0, word32 max=0xffffffffUL);
- //! \brief Generate random array of bytes
- //! \param output the byte buffer
- //! \param size the length of the buffer, in bytes
- //! \details All generated values are uniformly distributed over the range specified within the
- //! the constraints of a particular generator.
- //! \note A derived generator \a must override either GenerateBlock() or
- //! GenerateIntoBufferedTransformation(). They can override both, or have one call the other.
+ /// \brief Generate random array of bytes
+ /// \param output the byte buffer
+ /// \param size the length of the buffer, in bytes
+ /// \details All generated values are uniformly distributed over the range specified within the
+ /// the constraints of a particular generator.
+ /// \note A derived generator \a must override either GenerateBlock() or
+ /// GenerateIntoBufferedTransformation(). They can override both, or have one call the other.
virtual void GenerateBlock(byte *output, size_t size);
- //! \brief Generate random bytes into a BufferedTransformation
- //! \param target the BufferedTransformation object which receives the bytes
- //! \param channel the channel on which the bytes should be pumped
- //! \param length the number of bytes to generate
- //! \details The default implementation calls GenerateBlock() and pumps the result into
- //! the DEFAULT_CHANNEL of the target.
- //! \details All generated values are uniformly distributed over the range specified within the
- //! the constraints of a particular generator.
- //! \note A derived generator \a must override either GenerateBlock() or
- //! GenerateIntoBufferedTransformation(). They can override both, or have one call the other.
+ /// \brief Generate random bytes into a BufferedTransformation
+ /// \param target the BufferedTransformation object which receives the bytes
+ /// \param channel the channel on which the bytes should be pumped
+ /// \param length the number of bytes to generate
+ /// \details The default implementation calls GenerateBlock() and pumps the result into
+ /// the DEFAULT_CHANNEL of the target.
+ /// \details All generated values are uniformly distributed over the range specified within the
+ /// the constraints of a particular generator.
+ /// \note A derived generator \a must override either GenerateBlock() or
+ /// GenerateIntoBufferedTransformation(). They can override both, or have one call the other.
virtual void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword length);
- //! \brief Generate and discard n bytes
- //! \param n the number of bytes to generate and discard
+ /// \brief Generate and discard n bytes
+ /// \param n the number of bytes to generate and discard
virtual void DiscardBytes(size_t n);
- //! \brief Randomly shuffle the specified array
- //! \param begin an iterator to the first element in the array
- //! \param end an iterator beyond the last element in the array
- //! \details The resulting permutation is uniformly distributed.
+ /// \brief Randomly shuffle the specified array
+ /// \param begin an iterator to the first element in the array
+ /// \param end an iterator beyond the last element in the array
+ /// \details The resulting permutation is uniformly distributed.
template void Shuffle(IT begin, IT end)
{
// TODO: What happens if there are more than 2^32 elements?
@@ -1414,743 +1414,743 @@ public:
}
};
-//! \brief Random Number Generator that does not produce random numbers
-//! \return reference that can be passed to functions that require a RandomNumberGenerator
-//! \details NullRNG() returns a reference that can be passed to functions that require a
-//! RandomNumberGenerator but don't actually use it. The NullRNG() throws NotImplemented
-//! when a generation function is called.
-//! \sa ClassNullRNG, PK_SignatureScheme::IsProbabilistic()
+/// \brief Random Number Generator that does not produce random numbers
+/// \return reference that can be passed to functions that require a RandomNumberGenerator
+/// \details NullRNG() returns a reference that can be passed to functions that require a
+/// RandomNumberGenerator but don't actually use it. The NullRNG() throws NotImplemented
+/// when a generation function is called.
+/// \sa ClassNullRNG, PK_SignatureScheme::IsProbabilistic()
CRYPTOPP_DLL RandomNumberGenerator & CRYPTOPP_API NullRNG();
-//! \class WaitObjectContainer
+/// \class WaitObjectContainer
class WaitObjectContainer;
-//! \class CallStack
+/// \class CallStack
class CallStack;
-//! \brief Interface for objects that can be waited on.
+/// \brief Interface for objects that can be waited on.
class CRYPTOPP_NO_VTABLE Waitable
{
public:
virtual ~Waitable() {}
- //! \brief Maximum number of wait objects that this object can return
- //! \return the maximum number of wait objects
+ /// \brief Maximum number of wait objects that this object can return
+ /// \return the maximum number of wait objects
virtual unsigned int GetMaxWaitObjectCount() const =0;
- //! \brief Retrieves waitable objects
- //! \param container the wait container to receive the references to the objects.
- //! \param callStack CallStack() object used to select waitable objects
- //! \details GetWaitObjects() is usually called in one of two ways. First, it can
- //! be called like something.GetWaitObjects(c, CallStack("my func after X", 0));.
- //! Second, if in an outer GetWaitObjects() method that itself takes a callStack
- //! parameter, it can be called like
- //! innerThing.GetWaitObjects(c, CallStack("MyClass::GetWaitObjects at X", &callStack));.
+ /// \brief Retrieves waitable objects
+ /// \param container the wait container to receive the references to the objects.
+ /// \param callStack CallStack() object used to select waitable objects
+ /// \details GetWaitObjects() is usually called in one of two ways. First, it can
+ /// be called like something.GetWaitObjects(c, CallStack("my func after X", 0));.
+ /// Second, if in an outer GetWaitObjects() method that itself takes a callStack
+ /// parameter, it can be called like
+ /// innerThing.GetWaitObjects(c, CallStack("MyClass::GetWaitObjects at X", &callStack));.
virtual void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack) =0;
- //! \brief Wait on this object
- //! \return true if the wait succeeded, false otherwise
- //! \details Wait() is the same as creating an empty container, calling GetWaitObjects(), and then calling
- //! Wait() on the container.
+ /// \brief Wait on this object
+ /// \return true if the wait succeeded, false otherwise
+ /// \details Wait() is the same as creating an empty container, calling GetWaitObjects(), and then calling
+ /// Wait() on the container.
bool Wait(unsigned long milliseconds, CallStack const& callStack);
};
-//! \brief Interface for buffered transformations
-//! \details BufferedTransformation is a generalization of BlockTransformation,
-//! StreamTransformation and HashTransformation.
-//! \details A buffered transformation is an object that takes a stream of bytes as input (this may
-//! be done in stages), does some computation on them, and then places the result into an internal
-//! buffer for later retrieval. Any partial result already in the output buffer is not modified
-//! by further input.
-//! \details If a method takes a "blocking" parameter, and you pass false for it, then the method
-//! will return before all input has been processed if the input cannot be processed without waiting
-//! (for network buffers to become available, for example). In this case the method will return true
-//! or a non-zero integer value. When this happens you must continue to call the method with the same
-//! parameters until it returns false or zero, before calling any other method on it or attached
-//! /p BufferedTransformation. The integer return value in this case is approximately
-//! the number of bytes left to be processed, and can be used to implement a progress bar.
-//! \details For functions that take a "propagation" parameter, propagation != 0 means pass on
-//! the signal to attached BufferedTransformation objects, with propagation decremented at each
-//! step until it reaches 0. -1 means unlimited propagation.
-//! \details \a All of the retrieval functions, like Get() and GetWord32(), return the actual
-//! number of bytes retrieved, which is the lesser of the request number and MaxRetrievable().
-//! \details \a Most of the input functions, like Put() and PutWord32(), return the number of
-//! bytes remaining to be processed. A 0 value means all bytes were processed, and a non-0 value
-//! means bytes remain to be processed.
-//! \nosubgrouping
+/// \brief Interface for buffered transformations
+/// \details BufferedTransformation is a generalization of BlockTransformation,
+/// StreamTransformation and HashTransformation.
+/// \details A buffered transformation is an object that takes a stream of bytes as input (this may
+/// be done in stages), does some computation on them, and then places the result into an internal
+/// buffer for later retrieval. Any partial result already in the output buffer is not modified
+/// by further input.
+/// \details If a method takes a "blocking" parameter, and you pass false for it, then the method
+/// will return before all input has been processed if the input cannot be processed without waiting
+/// (for network buffers to become available, for example). In this case the method will return true
+/// or a non-zero integer value. When this happens you must continue to call the method with the same
+/// parameters until it returns false or zero, before calling any other method on it or attached
+/// /p BufferedTransformation. The integer return value in this case is approximately
+/// the number of bytes left to be processed, and can be used to implement a progress bar.
+/// \details For functions that take a "propagation" parameter, propagation != 0 means pass on
+/// the signal to attached BufferedTransformation objects, with propagation decremented at each
+/// step until it reaches 0. -1 means unlimited propagation.
+/// \details \a All of the retrieval functions, like Get() and GetWord32(), return the actual
+/// number of bytes retrieved, which is the lesser of the request number and MaxRetrievable().
+/// \details \a Most of the input functions, like Put() and PutWord32(), return the number of
+/// bytes remaining to be processed. A 0 value means all bytes were processed, and a non-0 value
+/// means bytes remain to be processed.
+/// \nosubgrouping
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE BufferedTransformation : public Algorithm, public Waitable
{
public:
virtual ~BufferedTransformation() {}
- //! \brief Construct a BufferedTransformation
+ /// \brief Construct a BufferedTransformation
BufferedTransformation() : Algorithm(false) {}
- //! \brief Provides a reference to this object
- //! \return A reference to this object
- //! \details Useful for passing a temporary object to a function that takes a non-const reference
+ /// \brief Provides a reference to this object
+ /// \return A reference to this object
+ /// \details Useful for passing a temporary object to a function that takes a non-const reference
BufferedTransformation& Ref() {return *this;}
- //! \name INPUT
+ /// \name INPUT
//@{
- //! \brief Input a byte for processing
- //! \param inByte the 8-bit byte (octet) to be processed.
- //! \param blocking specifies whether the object should block when processing input.
- //! \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
- //! bytes were processed.
- //! \details Put(byte) calls Put(byte*, size_t).
+ /// \brief Input a byte for processing
+ /// \param inByte the 8-bit byte (octet) to be processed.
+ /// \param blocking specifies whether the object should block when processing input.
+ /// \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
+ /// bytes were processed.
+ /// \details Put(byte) calls Put(byte*, size_t).
size_t Put(byte inByte, bool blocking=true)
{return Put(&inByte, 1, blocking);}
- //! \brief Input a byte buffer for processing
- //! \param inString the byte buffer to process
- //! \param length the size of the string, in bytes
- //! \param blocking specifies whether the object should block when processing input
- //! \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
- //! bytes were processed.
- //! \details Internally, Put() calls Put2().
+ /// \brief Input a byte buffer for processing
+ /// \param inString the byte buffer to process
+ /// \param length the size of the string, in bytes
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
+ /// bytes were processed.
+ /// \details Internally, Put() calls Put2().
size_t Put(const byte *inString, size_t length, bool blocking=true)
{return Put2(inString, length, 0, blocking);}
- //! Input a 16-bit word for processing.
- //! \param value the 16-bit value to be processed
- //! \param order the ByteOrder of the value to be processed.
- //! \param blocking specifies whether the object should block when processing input
- //! \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
- //! bytes were processed.
+ /// Input a 16-bit word for processing.
+ /// \param value the 16-bit value to be processed
+ /// \param order the ByteOrder of the value to be processed.
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
+ /// bytes were processed.
size_t PutWord16(word16 value, ByteOrder order=BIG_ENDIAN_ORDER, bool blocking=true);
- //! Input a 32-bit word for processing.
- //! \param value the 32-bit value to be processed.
- //! \param order the ByteOrder of the value to be processed.
- //! \param blocking specifies whether the object should block when processing input.
- //! \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
- //! bytes were processed.
+ /// Input a 32-bit word for processing.
+ /// \param value the 32-bit value to be processed.
+ /// \param order the ByteOrder of the value to be processed.
+ /// \param blocking specifies whether the object should block when processing input.
+ /// \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
+ /// bytes were processed.
size_t PutWord32(word32 value, ByteOrder order=BIG_ENDIAN_ORDER, bool blocking=true);
- //! \brief Request space which can be written into by the caller
- //! \param size the requested size of the buffer
- //! \return byte pointer to the space to input data
- //! \details The purpose of this method is to help avoid extra memory allocations.
- //! \details size is an \a IN and \a OUT parameter and used as a hint. When the call is made,
- //! size is the requested size of the buffer. When the call returns, size is the size of
- //! the array returned to the caller.
- //! \details The base class implementation sets size to 0 and returns NULL.
- //! \note Some objects, like ArraySink, cannot create a space because its fixed. In the case of
- //! an ArraySink, the pointer to the array is returned and the size is remaining size.
+ /// \brief Request space which can be written into by the caller
+ /// \param size the requested size of the buffer
+ /// \return byte pointer to the space to input data
+ /// \details The purpose of this method is to help avoid extra memory allocations.
+ /// \details size is an \a IN and \a OUT parameter and used as a hint. When the call is made,
+ /// size is the requested size of the buffer. When the call returns, size is the size of
+ /// the array returned to the caller.
+ /// \details The base class implementation sets size to 0 and returns NULL.
+ /// \note Some objects, like ArraySink, cannot create a space because its fixed. In the case of
+ /// an ArraySink, the pointer to the array is returned and the size is remaining size.
virtual byte * CreatePutSpace(size_t &size)
{size=0; return NULLPTR;}
- //! \brief Determines whether input can be modified by the callee
- //! \return true if input can be modified, false otherwise
- //! \details The base class implementation returns false.
+ /// \brief Determines whether input can be modified by the callee
+ /// \return true if input can be modified, false otherwise
+ /// \details The base class implementation returns false.
virtual bool CanModifyInput() const
{return false;}
- //! \brief Input multiple bytes that may be modified by callee.
- //! \param inString the byte buffer to process
- //! \param length the size of the string, in bytes
- //! \param blocking specifies whether the object should block when processing input
- //! \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
- //! bytes were processed.
+ /// \brief Input multiple bytes that may be modified by callee.
+ /// \param inString the byte buffer to process
+ /// \param length the size of the string, in bytes
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
+ /// bytes were processed.
size_t PutModifiable(byte *inString, size_t length, bool blocking=true)
{return PutModifiable2(inString, length, 0, blocking);}
- //! \brief Signals the end of messages to the object
- //! \param propagation the number of attached transformations the MessageEnd() signal should be passed
- //! \param blocking specifies whether the object should block when processing input
- //! \details propagation count includes this object. Setting propagation to 1 means this
- //! object only. Setting propagation to -1 means unlimited propagation.
+ /// \brief Signals the end of messages to the object
+ /// \param propagation the number of attached transformations the MessageEnd() signal should be passed
+ /// \param blocking specifies whether the object should block when processing input
+ /// \details propagation count includes this object. Setting propagation to 1 means this
+ /// object only. Setting propagation to -1 means unlimited propagation.
bool MessageEnd(int propagation=-1, bool blocking=true)
{return !!Put2(NULLPTR, 0, propagation < 0 ? -1 : propagation+1, blocking);}
- //! \brief Input multiple bytes for processing and signal the end of a message
- //! \param inString the byte buffer to process
- //! \param length the size of the string, in bytes
- //! \param propagation the number of attached transformations the MessageEnd() signal should be passed
- //! \param blocking specifies whether the object should block when processing input
- //! \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
- //! bytes were processed.
- //! \details Internally, PutMessageEnd() calls Put2() with a modified propagation to
- //! ensure all attached transformations finish processing the message.
- //! \details propagation count includes this object. Setting propagation to 1 means this
- //! object only. Setting propagation to -1 means unlimited propagation.
+ /// \brief Input multiple bytes for processing and signal the end of a message
+ /// \param inString the byte buffer to process
+ /// \param length the size of the string, in bytes
+ /// \param propagation the number of attached transformations the MessageEnd() signal should be passed
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
+ /// bytes were processed.
+ /// \details Internally, PutMessageEnd() calls Put2() with a modified propagation to
+ /// ensure all attached transformations finish processing the message.
+ /// \details propagation count includes this object. Setting propagation to 1 means this
+ /// object only. Setting propagation to -1 means unlimited propagation.
size_t PutMessageEnd(const byte *inString, size_t length, int propagation=-1, bool blocking=true)
{return Put2(inString, length, propagation < 0 ? -1 : propagation+1, blocking);}
- //! \brief Input multiple bytes for processing
- //! \param inString the byte buffer to process
- //! \param length the size of the string, in bytes
- //! \param messageEnd means how many filters to signal MessageEnd() to, including this one
- //! \param blocking specifies whether the object should block when processing input
- //! \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
- //! bytes were processed.
- //! \details Derived classes must implement Put2().
+ /// \brief Input multiple bytes for processing
+ /// \param inString the byte buffer to process
+ /// \param length the size of the string, in bytes
+ /// \param messageEnd means how many filters to signal MessageEnd() to, including this one
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
+ /// bytes were processed.
+ /// \details Derived classes must implement Put2().
virtual size_t Put2(const byte *inString, size_t length, int messageEnd, bool blocking) =0;
- //! \brief Input multiple bytes that may be modified by callee.
- //! \param inString the byte buffer to process.
- //! \param length the size of the string, in bytes.
- //! \param messageEnd means how many filters to signal MessageEnd() to, including this one.
- //! \param blocking specifies whether the object should block when processing input.
- //! \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
- //! bytes were processed.
- //! \details Internally, PutModifiable2() calls Put2().
+ /// \brief Input multiple bytes that may be modified by callee.
+ /// \param inString the byte buffer to process.
+ /// \param length the size of the string, in bytes.
+ /// \param messageEnd means how many filters to signal MessageEnd() to, including this one.
+ /// \param blocking specifies whether the object should block when processing input.
+ /// \return the number of bytes that remain in the block (i.e., bytes not processed). 0 indicates all
+ /// bytes were processed.
+ /// \details Internally, PutModifiable2() calls Put2().
virtual size_t PutModifiable2(byte *inString, size_t length, int messageEnd, bool blocking)
{return Put2(inString, length, messageEnd, blocking);}
- //! \class BlockingInputOnly
- //! \brief Exception thrown by objects that have \a not implemented nonblocking input processing
- //! \details BlockingInputOnly inherits from NotImplemented
+ /// \class BlockingInputOnly
+ /// \brief Exception thrown by objects that have \a not implemented nonblocking input processing
+ /// \details BlockingInputOnly inherits from NotImplemented
struct BlockingInputOnly : public NotImplemented
{BlockingInputOnly(const std::string &s) : NotImplemented(s + ": Nonblocking input is not implemented by this object.") {}};
//@}
- //! \name WAITING
+ /// \name WAITING
//@{
- //! \brief Retrieves the maximum number of waitable objects
+ /// \brief Retrieves the maximum number of waitable objects
unsigned int GetMaxWaitObjectCount() const;
- //! \brief Retrieves waitable objects
- //! \param container the wait container to receive the references to the objects
- //! \param callStack CallStack() object used to select waitable objects
- //! \details GetWaitObjects is usually called in one of two ways. First, it can
- //! be called like something.GetWaitObjects(c, CallStack("my func after X", 0));.
- //! Second, if in an outer GetWaitObjects() method that itself takes a callStack
- //! parameter, it can be called like
- //! innerThing.GetWaitObjects(c, CallStack("MyClass::GetWaitObjects at X", &callStack));.
+ /// \brief Retrieves waitable objects
+ /// \param container the wait container to receive the references to the objects
+ /// \param callStack CallStack() object used to select waitable objects
+ /// \details GetWaitObjects is usually called in one of two ways. First, it can
+ /// be called like something.GetWaitObjects(c, CallStack("my func after X", 0));.
+ /// Second, if in an outer GetWaitObjects() method that itself takes a callStack
+ /// parameter, it can be called like
+ /// innerThing.GetWaitObjects(c, CallStack("MyClass::GetWaitObjects at X", &callStack));.
void GetWaitObjects(WaitObjectContainer &container, CallStack const& callStack);
//@} // WAITING
- //! \name SIGNALS
+ /// \name SIGNALS
//@{
- //! \brief Initialize or reinitialize this object, without signal propagation
- //! \param parameters a set of NameValuePairs to initialize this object
- //! \throws NotImplemented
- //! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
- //! number of arbitrarily typed arguments. The function avoids the need for multiple constructors providing
- //! all possible combintations of configurable parameters.
- //! \details IsolatedInitialize() does not call Initialize() on attached transformations. If initialization
- //! should be propagated, then use the Initialize() function.
- //! \details If a derived class does not override IsolatedInitialize(), then the base class throws
- //! NotImplemented.
+ /// \brief Initialize or reinitialize this object, without signal propagation
+ /// \param parameters a set of NameValuePairs to initialize this object
+ /// \throws NotImplemented
+ /// \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
+ /// number of arbitrarily typed arguments. The function avoids the need for multiple constructors providing
+ /// all possible combintations of configurable parameters.
+ /// \details IsolatedInitialize() does not call Initialize() on attached transformations. If initialization
+ /// should be propagated, then use the Initialize() function.
+ /// \details If a derived class does not override IsolatedInitialize(), then the base class throws
+ /// NotImplemented.
virtual void IsolatedInitialize(const NameValuePairs ¶meters) {
CRYPTOPP_UNUSED(parameters);
throw NotImplemented("BufferedTransformation: this object can't be reinitialized");
}
- //! \brief Flushes data buffered by this object, without signal propagation
- //! \param hardFlush indicates whether all data should be flushed
- //! \param blocking specifies whether the object should block when processing input
- //! \note hardFlush must be used with care
+ /// \brief Flushes data buffered by this object, without signal propagation
+ /// \param hardFlush indicates whether all data should be flushed
+ /// \param blocking specifies whether the object should block when processing input
+ /// \note hardFlush must be used with care
virtual bool IsolatedFlush(bool hardFlush, bool blocking) =0;
- //! \brief Marks the end of a series of messages, without signal propagation
- //! \param blocking specifies whether the object should block when completing the processing on
- //! the current series of messages
+ /// \brief Marks the end of a series of messages, without signal propagation
+ /// \param blocking specifies whether the object should block when completing the processing on
+ /// the current series of messages
virtual bool IsolatedMessageSeriesEnd(bool blocking)
{CRYPTOPP_UNUSED(blocking); return false;}
- //! \brief Initialize or reinitialize this object, with signal propagation
- //! \param parameters a set of NameValuePairs to initialize or reinitialize this object
- //! \param propagation the number of attached transformations the Initialize() signal should be passed
- //! \details Initialize() is used to initialize or reinitialize an object using a variable number of
- //! arbitrarily typed arguments. The function avoids the need for multiple constructors providing
- //! all possible combintations of configurable parameters.
- //! \details propagation count includes this object. Setting propagation to 1 means this
- //! object only. Setting propagation to -1 means unlimited propagation.
+ /// \brief Initialize or reinitialize this object, with signal propagation
+ /// \param parameters a set of NameValuePairs to initialize or reinitialize this object
+ /// \param propagation the number of attached transformations the Initialize() signal should be passed
+ /// \details Initialize() is used to initialize or reinitialize an object using a variable number of
+ /// arbitrarily typed arguments. The function avoids the need for multiple constructors providing
+ /// all possible combintations of configurable parameters.
+ /// \details propagation count includes this object. Setting propagation to 1 means this
+ /// object only. Setting propagation to -1 means unlimited propagation.
virtual void Initialize(const NameValuePairs ¶meters=g_nullNameValuePairs, int propagation=-1);
- //! \brief Flush buffered input and/or output, with signal propagation
- //! \param hardFlush is used to indicate whether all data should be flushed
- //! \param propagation the number of attached transformations the Flush() signal should be passed
- //! \param blocking specifies whether the object should block when processing input
- //! \details propagation count includes this object. Setting propagation to 1 means this
- //! object only. Setting propagation to -1 means unlimited propagation.
- //! \note Hard flushes must be used with care. It means try to process and output everything, even if
- //! there may not be enough data to complete the action. For example, hard flushing a HexDecoder
- //! would cause an error if you do it after inputing an odd number of hex encoded characters.
- //! \note For some types of filters, like ZlibDecompressor, hard flushes can only
- //! be done at "synchronization points". These synchronization points are positions in the data
- //! stream that are created by hard flushes on the corresponding reverse filters, in this
- //! example ZlibCompressor. This is useful when zlib compressed data is moved across a
- //! network in packets and compression state is preserved across packets, as in the SSH2 protocol.
+ /// \brief Flush buffered input and/or output, with signal propagation
+ /// \param hardFlush is used to indicate whether all data should be flushed
+ /// \param propagation the number of attached transformations the Flush() signal should be passed
+ /// \param blocking specifies whether the object should block when processing input
+ /// \details propagation count includes this object. Setting propagation to 1 means this
+ /// object only. Setting propagation to -1 means unlimited propagation.
+ /// \note Hard flushes must be used with care. It means try to process and output everything, even if
+ /// there may not be enough data to complete the action. For example, hard flushing a HexDecoder
+ /// would cause an error if you do it after inputing an odd number of hex encoded characters.
+ /// \note For some types of filters, like ZlibDecompressor, hard flushes can only
+ /// be done at "synchronization points". These synchronization points are positions in the data
+ /// stream that are created by hard flushes on the corresponding reverse filters, in this
+ /// example ZlibCompressor. This is useful when zlib compressed data is moved across a
+ /// network in packets and compression state is preserved across packets, as in the SSH2 protocol.
virtual bool Flush(bool hardFlush, int propagation=-1, bool blocking=true);
- //! \brief Marks the end of a series of messages, with signal propagation
- //! \param propagation the number of attached transformations the MessageSeriesEnd() signal should be passed
- //! \param blocking specifies whether the object should block when processing input
- //! \details Each object that receives the signal will perform its processing, decrement
- //! propagation, and then pass the signal on to attached transformations if the value is not 0.
- //! \details propagation count includes this object. Setting propagation to 1 means this
- //! object only. Setting propagation to -1 means unlimited propagation.
- //! \note There should be a MessageEnd() immediately before MessageSeriesEnd().
+ /// \brief Marks the end of a series of messages, with signal propagation
+ /// \param propagation the number of attached transformations the MessageSeriesEnd() signal should be passed
+ /// \param blocking specifies whether the object should block when processing input
+ /// \details Each object that receives the signal will perform its processing, decrement
+ /// propagation, and then pass the signal on to attached transformations if the value is not 0.
+ /// \details propagation count includes this object. Setting propagation to 1 means this
+ /// object only. Setting propagation to -1 means unlimited propagation.
+ /// \note There should be a MessageEnd() immediately before MessageSeriesEnd().
virtual bool MessageSeriesEnd(int propagation=-1, bool blocking=true);
- //! \brief Set propagation of automatically generated and transferred signals
- //! \param propagation then new value
- //! \details Setting propagation to 0 means do not automatically generate signals. Setting
- //! propagation to -1 means unlimited propagation.
+ /// \brief Set propagation of automatically generated and transferred signals
+ /// \param propagation then new value
+ /// \details Setting propagation to 0 means do not automatically generate signals. Setting
+ /// propagation to -1 means unlimited propagation.
virtual void SetAutoSignalPropagation(int propagation)
{CRYPTOPP_UNUSED(propagation);}
- //! \brief Retrieve automatic signal propagation value
- //! \return the number of attached transformations the signal is propagated to. 0 indicates
- //! the signal is only witnessed by this object
+ /// \brief Retrieve automatic signal propagation value
+ /// \return the number of attached transformations the signal is propagated to. 0 indicates
+ /// the signal is only witnessed by this object
virtual int GetAutoSignalPropagation() const {return 0;}
public:
- //! \name RETRIEVAL OF ONE MESSAGE
+ /// \name RETRIEVAL OF ONE MESSAGE
//@{
- //! \brief Provides the number of bytes ready for retrieval
- //! \return the number of bytes ready for retrieval
- //! \details All retrieval functions return the actual number of bytes retrieved, which is
- //! the lesser of the request number and MaxRetrievable()
+ /// \brief Provides the number of bytes ready for retrieval
+ /// \return the number of bytes ready for retrieval
+ /// \details All retrieval functions return the actual number of bytes retrieved, which is
+ /// the lesser of the request number and MaxRetrievable()
virtual lword MaxRetrievable() const;
- //! \brief Determines whether bytes are ready for retrieval
- //! \returns true if bytes are available for retrieval, false otherwise
+ /// \brief Determines whether bytes are ready for retrieval
+ /// \returns true if bytes are available for retrieval, false otherwise
virtual bool AnyRetrievable() const;
- //! \brief Retrieve a 8-bit byte
- //! \param outByte the 8-bit value to be retrieved
- //! \return the number of bytes consumed during the call.
- //! \details Use the return value of Get to detect short reads.
+ /// \brief Retrieve a 8-bit byte
+ /// \param outByte the 8-bit value to be retrieved
+ /// \return the number of bytes consumed during the call.
+ /// \details Use the return value of Get to detect short reads.
virtual size_t Get(byte &outByte);
- //! \brief Retrieve a block of bytes
- //! \param outString a block of bytes
- //! \param getMax the number of bytes to Get
- //! \return the number of bytes consumed during the call.
- //! \details Use the return value of Get to detect short reads.
+ /// \brief Retrieve a block of bytes
+ /// \param outString a block of bytes
+ /// \param getMax the number of bytes to Get
+ /// \return the number of bytes consumed during the call.
+ /// \details Use the return value of Get to detect short reads.
virtual size_t Get(byte *outString, size_t getMax);
- //! \brief Peek a 8-bit byte
- //! \param outByte the 8-bit value to be retrieved
- //! \return the number of bytes read during the call.
- //! \details Peek does not remove bytes from the object. Use the return value of
- //! Get() to detect short reads.
+ /// \brief Peek a 8-bit byte
+ /// \param outByte the 8-bit value to be retrieved
+ /// \return the number of bytes read during the call.
+ /// \details Peek does not remove bytes from the object. Use the return value of
+ /// Get() to detect short reads.
virtual size_t Peek(byte &outByte) const;
- //! \brief Peek a block of bytes
- //! \param outString a block of bytes
- //! \param peekMax the number of bytes to Peek
- //! \return the number of bytes read during the call.
- //! \details Peek does not remove bytes from the object. Use the return value of
- //! Get() to detect short reads.
+ /// \brief Peek a block of bytes
+ /// \param outString a block of bytes
+ /// \param peekMax the number of bytes to Peek
+ /// \return the number of bytes read during the call.
+ /// \details Peek does not remove bytes from the object. Use the return value of
+ /// Get() to detect short reads.
virtual size_t Peek(byte *outString, size_t peekMax) const;
- //! \brief Retrieve a 16-bit word
- //! \param value the 16-bit value to be retrieved
- //! \param order the ByteOrder of the value to be processed.
- //! \return the number of bytes consumed during the call.
- //! \details Use the return value of GetWord16() to detect short reads.
+ /// \brief Retrieve a 16-bit word
+ /// \param value the 16-bit value to be retrieved
+ /// \param order the ByteOrder of the value to be processed.
+ /// \return the number of bytes consumed during the call.
+ /// \details Use the return value of GetWord16() to detect short reads.
size_t GetWord16(word16 &value, ByteOrder order=BIG_ENDIAN_ORDER);
- //! \brief Retrieve a 32-bit word
- //! \param value the 32-bit value to be retrieved
- //! \param order the ByteOrder of the value to be processed.
- //! \return the number of bytes consumed during the call.
- //! \details Use the return value of GetWord16() to detect short reads.
+ /// \brief Retrieve a 32-bit word
+ /// \param value the 32-bit value to be retrieved
+ /// \param order the ByteOrder of the value to be processed.
+ /// \return the number of bytes consumed during the call.
+ /// \details Use the return value of GetWord16() to detect short reads.
size_t GetWord32(word32 &value, ByteOrder order=BIG_ENDIAN_ORDER);
- //! \brief Peek a 16-bit word
- //! \param value the 16-bit value to be retrieved
- //! \param order the ByteOrder of the value to be processed.
- //! \return the number of bytes consumed during the call.
- //! \details Peek does not consume bytes in the stream. Use the return value
- //! of GetWord16() to detect short reads.
+ /// \brief Peek a 16-bit word
+ /// \param value the 16-bit value to be retrieved
+ /// \param order the ByteOrder of the value to be processed.
+ /// \return the number of bytes consumed during the call.
+ /// \details Peek does not consume bytes in the stream. Use the return value
+ /// of GetWord16() to detect short reads.
size_t PeekWord16(word16 &value, ByteOrder order=BIG_ENDIAN_ORDER) const;
- //! \brief Peek a 32-bit word
- //! \param value the 32-bit value to be retrieved
- //! \param order the ByteOrder of the value to be processed.
- //! \return the number of bytes consumed during the call.
- //! \details Peek does not consume bytes in the stream. Use the return value
- //! of GetWord16() to detect short reads.
+ /// \brief Peek a 32-bit word
+ /// \param value the 32-bit value to be retrieved
+ /// \param order the ByteOrder of the value to be processed.
+ /// \return the number of bytes consumed during the call.
+ /// \details Peek does not consume bytes in the stream. Use the return value
+ /// of GetWord16() to detect short reads.
size_t PeekWord32(word32 &value, ByteOrder order=BIG_ENDIAN_ORDER) const;
- //! move transferMax bytes of the buffered output to target as input
+ /// move transferMax bytes of the buffered output to target as input
- //! \brief Transfer bytes from this object to another BufferedTransformation
- //! \param target the destination BufferedTransformation
- //! \param transferMax the number of bytes to transfer
- //! \param channel the channel on which the transfer should occur
- //! \return the number of bytes transferred during the call.
- //! \details TransferTo removes bytes from this object and moves them to the destination.
- //! \details The function always returns transferMax. If an accurate count is needed, then use TransferTo2().
+ /// \brief Transfer bytes from this object to another BufferedTransformation
+ /// \param target the destination BufferedTransformation
+ /// \param transferMax the number of bytes to transfer
+ /// \param channel the channel on which the transfer should occur
+ /// \return the number of bytes transferred during the call.
+ /// \details TransferTo removes bytes from this object and moves them to the destination.
+ /// \details The function always returns transferMax. If an accurate count is needed, then use TransferTo2().
lword TransferTo(BufferedTransformation &target, lword transferMax=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL)
{TransferTo2(target, transferMax, channel); return transferMax;}
- //! \brief Discard skipMax bytes from the output buffer
- //! \param skipMax the number of bytes to discard
- //! \details Skip() discards bytes from the output buffer, which is the AttachedTransformation(), if present.
- //! The function always returns the parameter skipMax.
- //! \details If you want to skip bytes from a Source, then perform the following.
- //!
- //! StringSource ss(str, false, new Redirector(TheBitBucket()));
- //! ss.Pump(10); // Skip 10 bytes from Source
- //! ss.Detach(new FilterChain(...));
- //! ss.PumpAll();
- //!
+ /// \brief Discard skipMax bytes from the output buffer
+ /// \param skipMax the number of bytes to discard
+ /// \details Skip() discards bytes from the output buffer, which is the AttachedTransformation(), if present.
+ /// The function always returns the parameter skipMax.
+ /// \details If you want to skip bytes from a Source, then perform the following.
+ ///
+ /// StringSource ss(str, false, new Redirector(TheBitBucket()));
+ /// ss.Pump(10); // Skip 10 bytes from Source
+ /// ss.Detach(new FilterChain(...));
+ /// ss.PumpAll();
+ ///
virtual lword Skip(lword skipMax=LWORD_MAX);
- //! copy copyMax bytes of the buffered output to target as input
+ /// copy copyMax bytes of the buffered output to target as input
- //! \brief Copy bytes from this object to another BufferedTransformation
- //! \param target the destination BufferedTransformation
- //! \param copyMax the number of bytes to copy
- //! \param channel the channel on which the transfer should occur
- //! \return the number of bytes copied during the call.
- //! \details CopyTo copies bytes from this object to the destination. The bytes are not removed from this object.
- //! \details The function always returns copyMax. If an accurate count is needed, then use CopyRangeTo2().
+ /// \brief Copy bytes from this object to another BufferedTransformation
+ /// \param target the destination BufferedTransformation
+ /// \param copyMax the number of bytes to copy
+ /// \param channel the channel on which the transfer should occur
+ /// \return the number of bytes copied during the call.
+ /// \details CopyTo copies bytes from this object to the destination. The bytes are not removed from this object.
+ /// \details The function always returns copyMax. If an accurate count is needed, then use CopyRangeTo2().
lword CopyTo(BufferedTransformation &target, lword copyMax=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL) const
{return CopyRangeTo(target, 0, copyMax, channel);}
- //! \brief Copy bytes from this object using an index to another BufferedTransformation
- //! \param target the destination BufferedTransformation
- //! \param position the 0-based index of the byte stream to begin the copying
- //! \param copyMax the number of bytes to copy
- //! \param channel the channel on which the transfer should occur
- //! \return the number of bytes copied during the call.
- //! \details CopyTo copies bytes from this object to the destination. The bytes remain in this
- //! object. Copying begins at the index position in the current stream, and not from an absolute
- //! position in the stream.
- //! \details The function returns the new position in the stream after transferring the bytes starting at the index.
+ /// \brief Copy bytes from this object using an index to another BufferedTransformation
+ /// \param target the destination BufferedTransformation
+ /// \param position the 0-based index of the byte stream to begin the copying
+ /// \param copyMax the number of bytes to copy
+ /// \param channel the channel on which the transfer should occur
+ /// \return the number of bytes copied during the call.
+ /// \details CopyTo copies bytes from this object to the destination. The bytes remain in this
+ /// object. Copying begins at the index position in the current stream, and not from an absolute
+ /// position in the stream.
+ /// \details The function returns the new position in the stream after transferring the bytes starting at the index.
lword CopyRangeTo(BufferedTransformation &target, lword position, lword copyMax=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL) const
{lword i = position; CopyRangeTo2(target, i, i+copyMax, channel); return i-position;}
//@}
- //! \name RETRIEVAL OF MULTIPLE MESSAGES
+ /// \name RETRIEVAL OF MULTIPLE MESSAGES
//@{
- //! \brief Provides the number of bytes ready for retrieval
- //! \return the number of bytes ready for retrieval
+ /// \brief Provides the number of bytes ready for retrieval
+ /// \return the number of bytes ready for retrieval
virtual lword TotalBytesRetrievable() const;
- //! \brief Provides the number of meesages processed by this object
- //! \return the number of meesages processed by this object
- //! \details NumberOfMessages returns number of times MessageEnd() has been
- //! received minus messages retrieved or skipped
+ /// \brief Provides the number of meesages processed by this object
+ /// \return the number of meesages processed by this object
+ /// \details NumberOfMessages returns number of times MessageEnd() has been
+ /// received minus messages retrieved or skipped
virtual unsigned int NumberOfMessages() const;
- //! \brief Determines if any messages are available for retrieval
- //! \returns true if NumberOfMessages() > 0, false otherwise
- //! \details AnyMessages returns true if NumberOfMessages() > 0
+ /// \brief Determines if any messages are available for retrieval
+ /// \returns true if NumberOfMessages() > 0, false otherwise
+ /// \details AnyMessages returns true if NumberOfMessages() > 0
virtual bool AnyMessages() const;
- //! \brief Start retrieving the next message
- //! \return true if a message is ready for retrieval
- //! \details GetNextMessage() returns true if a message is ready for retrieval; false
- //! if no more messages exist or this message is not completely retrieved.
+ /// \brief Start retrieving the next message
+ /// \return true if a message is ready for retrieval
+ /// \details GetNextMessage() returns true if a message is ready for retrieval; false
+ /// if no more messages exist or this message is not completely retrieved.
virtual bool GetNextMessage();
- //! \brief Skip a number of meessages
- //! \return 0 if the requested number of messages was skipped, non-0 otherwise
- //! \details SkipMessages() skips count number of messages. If there is an AttachedTransformation()
- //! then SkipMessages() is called on the attached transformation. If there is no attached
- //! transformation, then count number of messages are sent to TheBitBucket() using TransferMessagesTo().
+ /// \brief Skip a number of meessages
+ /// \return 0 if the requested number of messages was skipped, non-0 otherwise
+ /// \details SkipMessages() skips count number of messages. If there is an AttachedTransformation()
+ /// then SkipMessages() is called on the attached transformation. If there is no attached
+ /// transformation, then count number of messages are sent to TheBitBucket() using TransferMessagesTo().
virtual unsigned int SkipMessages(unsigned int count=UINT_MAX);
- //! \brief Transfer messages from this object to another BufferedTransformation
- //! \param target the destination BufferedTransformation
- //! \param count the number of messages to transfer
- //! \param channel the channel on which the transfer should occur
- //! \return the number of bytes that remain in the current transfer block (i.e., bytes not transferred)
- //! \details TransferMessagesTo2() removes messages from this object and moves them to the destination.
- //! If all bytes are not transferred for a message, then processing stops and the number of remaining
- //! bytes is returned. TransferMessagesTo() does not proceed to the next message.
- //! \details A return value of 0 indicates all messages were successfully transferred.
+ /// \brief Transfer messages from this object to another BufferedTransformation
+ /// \param target the destination BufferedTransformation
+ /// \param count the number of messages to transfer
+ /// \param channel the channel on which the transfer should occur
+ /// \return the number of bytes that remain in the current transfer block (i.e., bytes not transferred)
+ /// \details TransferMessagesTo2() removes messages from this object and moves them to the destination.
+ /// If all bytes are not transferred for a message, then processing stops and the number of remaining
+ /// bytes is returned. TransferMessagesTo() does not proceed to the next message.
+ /// \details A return value of 0 indicates all messages were successfully transferred.
unsigned int TransferMessagesTo(BufferedTransformation &target, unsigned int count=UINT_MAX, const std::string &channel=DEFAULT_CHANNEL)
{TransferMessagesTo2(target, count, channel); return count;}
- //! \brief Copy messages from this object to another BufferedTransformation
- //! \param target the destination BufferedTransformation
- //! \param count the number of messages to transfer
- //! \param channel the channel on which the transfer should occur
- //! \return the number of bytes that remain in the current transfer block (i.e., bytes not transferred)
- //! \details CopyMessagesTo copies messages from this object and copies them to the destination.
- //! If all bytes are not transferred for a message, then processing stops and the number of remaining
- //! bytes is returned. CopyMessagesTo() does not proceed to the next message.
- //! \details A return value of 0 indicates all messages were successfully copied.
+ /// \brief Copy messages from this object to another BufferedTransformation
+ /// \param target the destination BufferedTransformation
+ /// \param count the number of messages to transfer
+ /// \param channel the channel on which the transfer should occur
+ /// \return the number of bytes that remain in the current transfer block (i.e., bytes not transferred)
+ /// \details CopyMessagesTo copies messages from this object and copies them to the destination.
+ /// If all bytes are not transferred for a message, then processing stops and the number of remaining
+ /// bytes is returned. CopyMessagesTo() does not proceed to the next message.
+ /// \details A return value of 0 indicates all messages were successfully copied.
unsigned int CopyMessagesTo(BufferedTransformation &target, unsigned int count=UINT_MAX, const std::string &channel=DEFAULT_CHANNEL) const;
- //! \brief Skip all messages in the series
+ /// \brief Skip all messages in the series
virtual void SkipAll();
- //! \brief Transfer all bytes from this object to another BufferedTransformation
- //! \param target the destination BufferedTransformation
- //! \param channel the channel on which the transfer should occur
- //! \details TransferMessagesTo2() removes messages from this object and moves them to the destination.
- //! Internally TransferAllTo() calls TransferAllTo2().
+ /// \brief Transfer all bytes from this object to another BufferedTransformation
+ /// \param target the destination BufferedTransformation
+ /// \param channel the channel on which the transfer should occur
+ /// \details TransferMessagesTo2() removes messages from this object and moves them to the destination.
+ /// Internally TransferAllTo() calls TransferAllTo2().
void TransferAllTo(BufferedTransformation &target, const std::string &channel=DEFAULT_CHANNEL)
{TransferAllTo2(target, channel);}
- //! \brief Copy messages from this object to another BufferedTransformation
- //! \param target the destination BufferedTransformation
- //! \param channel the channel on which the transfer should occur
- //! \details CopyAllTo copies messages from this object and copies them to the destination.
+ /// \brief Copy messages from this object to another BufferedTransformation
+ /// \param target the destination BufferedTransformation
+ /// \param channel the channel on which the transfer should occur
+ /// \details CopyAllTo copies messages from this object and copies them to the destination.
void CopyAllTo(BufferedTransformation &target, const std::string &channel=DEFAULT_CHANNEL) const;
- //! \brief Retrieve the next message in a series
- //! \return true if a message was retreved, false otherwise
- //! \details Internally, the base class implementation returns false.
+ /// \brief Retrieve the next message in a series
+ /// \return true if a message was retreved, false otherwise
+ /// \details Internally, the base class implementation returns false.
virtual bool GetNextMessageSeries() {return false;}
- //! \brief Provides the number of messages in a series
- //! \return the number of messages in this series
+ /// \brief Provides the number of messages in a series
+ /// \return the number of messages in this series
virtual unsigned int NumberOfMessagesInThisSeries() const {return NumberOfMessages();}
- //! \brief Provides the number of messages in a series
- //! \return the number of messages in this series
+ /// \brief Provides the number of messages in a series
+ /// \return the number of messages in this series
virtual unsigned int NumberOfMessageSeries() const {return 0;}
//@}
- //! \name NON-BLOCKING TRANSFER OF OUTPUT
+ /// \name NON-BLOCKING TRANSFER OF OUTPUT
//@{
// upon return, byteCount contains number of bytes that have finished being transferred,
// and returns the number of bytes left in the current transfer block
- //! \brief Transfer bytes from this object to another BufferedTransformation
- //! \param target the destination BufferedTransformation
- //! \param byteCount the number of bytes to transfer
- //! \param channel the channel on which the transfer should occur
- //! \param blocking specifies whether the object should block when processing input
- //! \return the number of bytes that remain in the transfer block (i.e., bytes not transferred)
- //! \details TransferTo() removes bytes from this object and moves them to the destination.
- //! Transfer begins at the index position in the current stream, and not from an absolute
- //! position in the stream.
- //! \details byteCount is an \a IN and \a OUT parameter. When the call is made,
- //! byteCount is the requested size of the transfer. When the call returns, byteCount is
- //! the number of bytes that were transferred.
+ /// \brief Transfer bytes from this object to another BufferedTransformation
+ /// \param target the destination BufferedTransformation
+ /// \param byteCount the number of bytes to transfer
+ /// \param channel the channel on which the transfer should occur
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return the number of bytes that remain in the transfer block (i.e., bytes not transferred)
+ /// \details TransferTo() removes bytes from this object and moves them to the destination.
+ /// Transfer begins at the index position in the current stream, and not from an absolute
+ /// position in the stream.
+ /// \details byteCount is an \a IN and \a OUT parameter. When the call is made,
+ /// byteCount is the requested size of the transfer. When the call returns, byteCount is
+ /// the number of bytes that were transferred.
virtual size_t TransferTo2(BufferedTransformation &target, lword &byteCount, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) =0;
// upon return, begin contains the start position of data yet to be finished copying,
// and returns the number of bytes left in the current transfer block
- //! \brief Copy bytes from this object to another BufferedTransformation
- //! \param target the destination BufferedTransformation
- //! \param begin the 0-based index of the first byte to copy in the stream
- //! \param end the 0-based index of the last byte to copy in the stream
- //! \param channel the channel on which the transfer should occur
- //! \param blocking specifies whether the object should block when processing input
- //! \return the number of bytes that remain in the copy block (i.e., bytes not copied)
- //! \details CopyRangeTo2 copies bytes from this object to the destination. The bytes are not
- //! removed from this object. Copying begins at the index position in the current stream, and
- //! not from an absolute position in the stream.
- //! \details begin is an \a IN and \a OUT parameter. When the call is made, begin is the
- //! starting position of the copy. When the call returns, begin is the position of the first
- //! byte that was \a not copied (which may be different than end). begin can be used for
- //! subsequent calls to CopyRangeTo2().
+ /// \brief Copy bytes from this object to another BufferedTransformation
+ /// \param target the destination BufferedTransformation
+ /// \param begin the 0-based index of the first byte to copy in the stream
+ /// \param end the 0-based index of the last byte to copy in the stream
+ /// \param channel the channel on which the transfer should occur
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return the number of bytes that remain in the copy block (i.e., bytes not copied)
+ /// \details CopyRangeTo2 copies bytes from this object to the destination. The bytes are not
+ /// removed from this object. Copying begins at the index position in the current stream, and
+ /// not from an absolute position in the stream.
+ /// \details begin is an \a IN and \a OUT parameter. When the call is made, begin is the
+ /// starting position of the copy. When the call returns, begin is the position of the first
+ /// byte that was \a not copied (which may be different than end). begin can be used for
+ /// subsequent calls to CopyRangeTo2().
virtual size_t CopyRangeTo2(BufferedTransformation &target, lword &begin, lword end=LWORD_MAX, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true) const =0;
// upon return, messageCount contains number of messages that have finished being transferred,
// and returns the number of bytes left in the current transfer block
- //! \brief Transfer messages from this object to another BufferedTransformation
- //! \param target the destination BufferedTransformation
- //! \param messageCount the number of messages to transfer
- //! \param channel the channel on which the transfer should occur
- //! \param blocking specifies whether the object should block when processing input
- //! \return the number of bytes that remain in the current transfer block (i.e., bytes not transferred)
- //! \details TransferMessagesTo2() removes messages from this object and moves them to the destination.
- //! \details messageCount is an \a IN and \a OUT parameter. When the call is made, messageCount is the
- //! the number of messages requested to be transferred. When the call returns, messageCount is the
- //! number of messages actually transferred.
+ /// \brief Transfer messages from this object to another BufferedTransformation
+ /// \param target the destination BufferedTransformation
+ /// \param messageCount the number of messages to transfer
+ /// \param channel the channel on which the transfer should occur
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return the number of bytes that remain in the current transfer block (i.e., bytes not transferred)
+ /// \details TransferMessagesTo2() removes messages from this object and moves them to the destination.
+ /// \details messageCount is an \a IN and \a OUT parameter. When the call is made, messageCount is the
+ /// the number of messages requested to be transferred. When the call returns, messageCount is the
+ /// number of messages actually transferred.
size_t TransferMessagesTo2(BufferedTransformation &target, unsigned int &messageCount, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true);
// returns the number of bytes left in the current transfer block
- //! \brief Transfer all bytes from this object to another BufferedTransformation
- //! \param target the destination BufferedTransformation
- //! \param channel the channel on which the transfer should occur
- //! \param blocking specifies whether the object should block when processing input
- //! \return the number of bytes that remain in the current transfer block (i.e., bytes not transferred)
- //! \details TransferMessagesTo2() removes messages from this object and moves them to the destination.
+ /// \brief Transfer all bytes from this object to another BufferedTransformation
+ /// \param target the destination BufferedTransformation
+ /// \param channel the channel on which the transfer should occur
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return the number of bytes that remain in the current transfer block (i.e., bytes not transferred)
+ /// \details TransferMessagesTo2() removes messages from this object and moves them to the destination.
size_t TransferAllTo2(BufferedTransformation &target, const std::string &channel=DEFAULT_CHANNEL, bool blocking=true);
//@}
- //! \name CHANNELS
+ /// \name CHANNELS
//@{
- //! \brief Exception thrown when a filter does not support named channels
+ /// \brief Exception thrown when a filter does not support named channels
struct NoChannelSupport : public NotImplemented
{NoChannelSupport(const std::string &name) : NotImplemented(name + ": this object doesn't support multiple channels") {}};
- //! \brief Exception thrown when a filter does not recognize a named channel
+ /// \brief Exception thrown when a filter does not recognize a named channel
struct InvalidChannelName : public InvalidArgument
{InvalidChannelName(const std::string &name, const std::string &channel) : InvalidArgument(name + ": unexpected channel name \"" + channel + "\"") {}};
- //! \brief Input a byte for processing on a channel
- //! \param channel the channel to process the data.
- //! \param inByte the 8-bit byte (octet) to be processed.
- //! \param blocking specifies whether the object should block when processing input.
- //! \return 0 indicates all bytes were processed during the call. Non-0 indicates the
- //! number of bytes that were not processed.
+ /// \brief Input a byte for processing on a channel
+ /// \param channel the channel to process the data.
+ /// \param inByte the 8-bit byte (octet) to be processed.
+ /// \param blocking specifies whether the object should block when processing input.
+ /// \return 0 indicates all bytes were processed during the call. Non-0 indicates the
+ /// number of bytes that were not processed.
size_t ChannelPut(const std::string &channel, byte inByte, bool blocking=true)
{return ChannelPut(channel, &inByte, 1, blocking);}
- //! \brief Input a byte buffer for processing on a channel
- //! \param channel the channel to process the data
- //! \param inString the byte buffer to process
- //! \param length the size of the string, in bytes
- //! \param blocking specifies whether the object should block when processing input
- //! \return 0 indicates all bytes were processed during the call. Non-0 indicates the
- //! number of bytes that were not processed.
+ /// \brief Input a byte buffer for processing on a channel
+ /// \param channel the channel to process the data
+ /// \param inString the byte buffer to process
+ /// \param length the size of the string, in bytes
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return 0 indicates all bytes were processed during the call. Non-0 indicates the
+ /// number of bytes that were not processed.
size_t ChannelPut(const std::string &channel, const byte *inString, size_t length, bool blocking=true)
{return ChannelPut2(channel, inString, length, 0, blocking);}
- //! \brief Input multiple bytes that may be modified by callee on a channel
- //! \param channel the channel to process the data.
- //! \param inString the byte buffer to process
- //! \param length the size of the string, in bytes
- //! \param blocking specifies whether the object should block when processing input
- //! \return 0 indicates all bytes were processed during the call. Non-0 indicates the
- //! number of bytes that were not processed.
+ /// \brief Input multiple bytes that may be modified by callee on a channel
+ /// \param channel the channel to process the data.
+ /// \param inString the byte buffer to process
+ /// \param length the size of the string, in bytes
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return 0 indicates all bytes were processed during the call. Non-0 indicates the
+ /// number of bytes that were not processed.
size_t ChannelPutModifiable(const std::string &channel, byte *inString, size_t length, bool blocking=true)
{return ChannelPutModifiable2(channel, inString, length, 0, blocking);}
- //! \brief Input a 16-bit word for processing on a channel.
- //! \param channel the channel to process the data.
- //! \param value the 16-bit value to be processed.
- //! \param order the ByteOrder of the value to be processed.
- //! \param blocking specifies whether the object should block when processing input.
- //! \return 0 indicates all bytes were processed during the call. Non-0 indicates the
- //! number of bytes that were not processed.
+ /// \brief Input a 16-bit word for processing on a channel.
+ /// \param channel the channel to process the data.
+ /// \param value the 16-bit value to be processed.
+ /// \param order the ByteOrder of the value to be processed.
+ /// \param blocking specifies whether the object should block when processing input.
+ /// \return 0 indicates all bytes were processed during the call. Non-0 indicates the
+ /// number of bytes that were not processed.
size_t ChannelPutWord16(const std::string &channel, word16 value, ByteOrder order=BIG_ENDIAN_ORDER, bool blocking=true);
- //! \brief Input a 32-bit word for processing on a channel.
- //! \param channel the channel to process the data.
- //! \param value the 32-bit value to be processed.
- //! \param order the ByteOrder of the value to be processed.
- //! \param blocking specifies whether the object should block when processing input.
- //! \return 0 indicates all bytes were processed during the call. Non-0 indicates the
- //! number of bytes that were not processed.
+ /// \brief Input a 32-bit word for processing on a channel.
+ /// \param channel the channel to process the data.
+ /// \param value the 32-bit value to be processed.
+ /// \param order the ByteOrder of the value to be processed.
+ /// \param blocking specifies whether the object should block when processing input.
+ /// \return 0 indicates all bytes were processed during the call. Non-0 indicates the
+ /// number of bytes that were not processed.
size_t ChannelPutWord32(const std::string &channel, word32 value, ByteOrder order=BIG_ENDIAN_ORDER, bool blocking=true);
- //! \brief Signal the end of a message
- //! \param channel the channel to process the data.
- //! \param propagation the number of attached transformations the ChannelMessageEnd() signal should be passed
- //! \param blocking specifies whether the object should block when processing input
- //! \return 0 indicates all bytes were processed during the call. Non-0 indicates the
- //! number of bytes that were not processed.
- //! \details propagation count includes this object. Setting propagation to 1 means this
- //! object only. Setting propagation to -1 means unlimited propagation.
+ /// \brief Signal the end of a message
+ /// \param channel the channel to process the data.
+ /// \param propagation the number of attached transformations the ChannelMessageEnd() signal should be passed
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return 0 indicates all bytes were processed during the call. Non-0 indicates the
+ /// number of bytes that were not processed.
+ /// \details propagation count includes this object. Setting propagation to 1 means this
+ /// object only. Setting propagation to -1 means unlimited propagation.
bool ChannelMessageEnd(const std::string &channel, int propagation=-1, bool blocking=true)
{return !!ChannelPut2(channel, NULLPTR, 0, propagation < 0 ? -1 : propagation+1, blocking);}
- //! \brief Input multiple bytes for processing and signal the end of a message
- //! \param channel the channel to process the data.
- //! \param inString the byte buffer to process
- //! \param length the size of the string, in bytes
- //! \param propagation the number of attached transformations the ChannelPutMessageEnd() signal should be passed
- //! \param blocking specifies whether the object should block when processing input
- //! \return the number of bytes that remain in the block (i.e., bytes not processed)
- //! \details propagation count includes this object. Setting propagation to 1 means this
- //! object only. Setting propagation to -1 means unlimited propagation.
+ /// \brief Input multiple bytes for processing and signal the end of a message
+ /// \param channel the channel to process the data.
+ /// \param inString the byte buffer to process
+ /// \param length the size of the string, in bytes
+ /// \param propagation the number of attached transformations the ChannelPutMessageEnd() signal should be passed
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return the number of bytes that remain in the block (i.e., bytes not processed)
+ /// \details propagation count includes this object. Setting propagation to 1 means this
+ /// object only. Setting propagation to -1 means unlimited propagation.
size_t ChannelPutMessageEnd(const std::string &channel, const byte *inString, size_t length, int propagation=-1, bool blocking=true)
{return ChannelPut2(channel, inString, length, propagation < 0 ? -1 : propagation+1, blocking);}
- //! \brief Request space which can be written into by the caller
- //! \param channel the channel to process the data
- //! \param size the requested size of the buffer
- //! \return a pointer to a memroy block with length size
- //! \details The purpose of this method is to help avoid extra memory allocations.
- //! \details size is an \a IN and \a OUT parameter and used as a hint. When the call is made,
- //! size is the requested size of the buffer. When the call returns, size is the size of
- //! the array returned to the caller.
- //! \details The base class implementation sets size to 0 and returns NULL.
- //! \note Some objects, like ArraySink(), cannot create a space because its fixed. In the case of
- //! an ArraySink(), the pointer to the array is returned and the size is remaining size.
+ /// \brief Request space which can be written into by the caller
+ /// \param channel the channel to process the data
+ /// \param size the requested size of the buffer
+ /// \return a pointer to a memroy block with length size
+ /// \details The purpose of this method is to help avoid extra memory allocations.
+ /// \details size is an \a IN and \a OUT parameter and used as a hint. When the call is made,
+ /// size is the requested size of the buffer. When the call returns, size is the size of
+ /// the array returned to the caller.
+ /// \details The base class implementation sets size to 0 and returns NULL.
+ /// \note Some objects, like ArraySink(), cannot create a space because its fixed. In the case of
+ /// an ArraySink(), the pointer to the array is returned and the size is remaining size.
virtual byte * ChannelCreatePutSpace(const std::string &channel, size_t &size);
- //! \brief Input multiple bytes for processing on a channel.
- //! \param channel the channel to process the data.
- //! \param inString the byte buffer to process.
- //! \param length the size of the string, in bytes.
- //! \param messageEnd means how many filters to signal MessageEnd() to, including this one.
- //! \param blocking specifies whether the object should block when processing input.
- //! \return the number of bytes that remain in the block (i.e., bytes not processed)
+ /// \brief Input multiple bytes for processing on a channel.
+ /// \param channel the channel to process the data.
+ /// \param inString the byte buffer to process.
+ /// \param length the size of the string, in bytes.
+ /// \param messageEnd means how many filters to signal MessageEnd() to, including this one.
+ /// \param blocking specifies whether the object should block when processing input.
+ /// \return the number of bytes that remain in the block (i.e., bytes not processed)
virtual size_t ChannelPut2(const std::string &channel, const byte *inString, size_t length, int messageEnd, bool blocking);
- //! \brief Input multiple bytes that may be modified by callee on a channel
- //! \param channel the channel to process the data
- //! \param inString the byte buffer to process
- //! \param length the size of the string, in bytes
- //! \param messageEnd means how many filters to signal MessageEnd() to, including this one
- //! \param blocking specifies whether the object should block when processing input
- //! \return the number of bytes that remain in the block (i.e., bytes not processed)
+ /// \brief Input multiple bytes that may be modified by callee on a channel
+ /// \param channel the channel to process the data
+ /// \param inString the byte buffer to process
+ /// \param length the size of the string, in bytes
+ /// \param messageEnd means how many filters to signal MessageEnd() to, including this one
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return the number of bytes that remain in the block (i.e., bytes not processed)
virtual size_t ChannelPutModifiable2(const std::string &channel, byte *inString, size_t length, int messageEnd, bool blocking);
- //! \brief Flush buffered input and/or output on a channel
- //! \param channel the channel to flush the data
- //! \param hardFlush is used to indicate whether all data should be flushed
- //! \param propagation the number of attached transformations the ChannelFlush() signal should be passed
- //! \param blocking specifies whether the object should block when processing input
- //! \return true of the Flush was successful
- //! \details propagation count includes this object. Setting propagation to 1 means this
- //! object only. Setting propagation to -1 means unlimited propagation.
+ /// \brief Flush buffered input and/or output on a channel
+ /// \param channel the channel to flush the data
+ /// \param hardFlush is used to indicate whether all data should be flushed
+ /// \param propagation the number of attached transformations the ChannelFlush() signal should be passed
+ /// \param blocking specifies whether the object should block when processing input
+ /// \return true of the Flush was successful
+ /// \details propagation count includes this object. Setting propagation to 1 means this
+ /// object only. Setting propagation to -1 means unlimited propagation.
virtual bool ChannelFlush(const std::string &channel, bool hardFlush, int propagation=-1, bool blocking=true);
- //! \brief Marks the end of a series of messages on a channel
- //! \param channel the channel to signal the end of a series of messages
- //! \param propagation the number of attached transformations the ChannelMessageSeriesEnd() signal should be passed
- //! \param blocking specifies whether the object should block when processing input
- //! \details Each object that receives the signal will perform its processing, decrement
- //! propagation, and then pass the signal on to attached transformations if the value is not 0.
- //! \details propagation count includes this object. Setting propagation to 1 means this
- //! object only. Setting propagation to -1 means unlimited propagation.
- //! \note There should be a MessageEnd() immediately before MessageSeriesEnd().
+ /// \brief Marks the end of a series of messages on a channel
+ /// \param channel the channel to signal the end of a series of messages
+ /// \param propagation the number of attached transformations the ChannelMessageSeriesEnd() signal should be passed
+ /// \param blocking specifies whether the object should block when processing input
+ /// \details Each object that receives the signal will perform its processing, decrement
+ /// propagation, and then pass the signal on to attached transformations if the value is not 0.
+ /// \details propagation count includes this object. Setting propagation to 1 means this
+ /// object only. Setting propagation to -1 means unlimited propagation.
+ /// \note There should be a MessageEnd() immediately before MessageSeriesEnd().
virtual bool ChannelMessageSeriesEnd(const std::string &channel, int propagation=-1, bool blocking=true);
- //! \brief Sets the default retrieval channel
- //! \param channel the channel to signal the end of a series of messages
- //! \note this function may not be implemented in all objects that should support it.
+ /// \brief Sets the default retrieval channel
+ /// \param channel the channel to signal the end of a series of messages
+ /// \note this function may not be implemented in all objects that should support it.
virtual void SetRetrievalChannel(const std::string &channel);
//@}
- //! \name ATTACHMENT
- //! \details Some BufferedTransformation objects (e.g. Filter objects) allow other BufferedTransformation objects to be
- //! attached. When this is done, the first object instead of buffering its output, sends that output to the attached
- //! object as input. The entire attachment chain is deleted when the anchor object is destructed.
+ /// \name ATTACHMENT
+ /// \details Some BufferedTransformation objects (e.g. Filter objects) allow other BufferedTransformation objects to be
+ /// attached. When this is done, the first object instead of buffering its output, sends that output to the attached
+ /// object as input. The entire attachment chain is deleted when the anchor object is destructed.
//@{
- //! \brief Determines whether the object allows attachment
- //! \return true if the object allows an attachment, false otherwise
- //! \details Sources and Filters will returns true, while Sinks and other objects will return false.
+ /// \brief Determines whether the object allows attachment
+ /// \return true if the object allows an attachment, false otherwise
+ /// \details Sources and Filters will returns true, while Sinks and other objects will return false.
virtual bool Attachable() {return false;}
- //! \brief Returns the object immediately attached to this object
- //! \return the attached transformation
- //! \details AttachedTransformation() returns NULL if there is no attachment. The non-const
- //! version of AttachedTransformation() always returns NULL.
+ /// \brief Returns the object immediately attached to this object
+ /// \return the attached transformation
+ /// \details AttachedTransformation() returns NULL if there is no attachment. The non-const
+ /// version of AttachedTransformation() always returns NULL.
virtual BufferedTransformation *AttachedTransformation() {CRYPTOPP_ASSERT(!Attachable()); return NULLPTR;}
- //! \brief Returns the object immediately attached to this object
- //! \return the attached transformation
- //! \details AttachedTransformation() returns NULL if there is no attachment. The non-const
- //! version of AttachedTransformation() always returns NULL.
+ /// \brief Returns the object immediately attached to this object
+ /// \return the attached transformation
+ /// \details AttachedTransformation() returns NULL if there is no attachment. The non-const
+ /// version of AttachedTransformation() always returns NULL.
virtual const BufferedTransformation *AttachedTransformation() const
{return const_cast(this)->AttachedTransformation();}
- //! \brief Delete the current attachment chain and attach a new one
- //! \param newAttachment the new BufferedTransformation to attach
- //! \throws NotImplemented
- //! \details Detach() deletes the current attachment chain and replace it with an optional newAttachment
- //! \details If a derived class does not override Detach(), then the base class throws
- //! NotImplemented.
+ /// \brief Delete the current attachment chain and attach a new one
+ /// \param newAttachment the new BufferedTransformation to attach
+ /// \throws NotImplemented
+ /// \details Detach() deletes the current attachment chain and replace it with an optional newAttachment
+ /// \details If a derived class does not override Detach(), then the base class throws
+ /// NotImplemented.
virtual void Detach(BufferedTransformation *newAttachment = NULLPTR) {
CRYPTOPP_UNUSED(newAttachment); CRYPTOPP_ASSERT(!Attachable());
throw NotImplemented("BufferedTransformation: this object is not attachable");
}
- //! \brief Add newAttachment to the end of attachment chain
- //! \param newAttachment the attachment to add to the end of the chain
+ /// \brief Add newAttachment to the end of attachment chain
+ /// \param newAttachment the attachment to add to the end of the chain
virtual void Attach(BufferedTransformation *newAttachment);
//@}
protected:
- //! \brief Decrements the propagation count while clamping at 0
- //! \return the decremented propagation or 0
+ /// \brief Decrements the propagation count while clamping at 0
+ /// \return the decremented propagation or 0
static int DecrementPropagation(int propagation)
{return propagation != 0 ? propagation - 1 : 0;}
@@ -2158,16 +2158,16 @@ private:
byte m_buf[4]; // for ChannelPutWord16 and ChannelPutWord32, to ensure buffer isn't deallocated before non-blocking operation completes
};
-//! \brief An input discarding BufferedTransformation
-//! \return a reference to a BufferedTransformation object that discards all input
+/// \brief An input discarding BufferedTransformation
+/// \return a reference to a BufferedTransformation object that discards all input
CRYPTOPP_DLL BufferedTransformation & TheBitBucket();
-//! \class CryptoMaterial
-//! \brief Interface for crypto material, such as public and private keys, and crypto parameters
+/// \class CryptoMaterial
+/// \brief Interface for crypto material, such as public and private keys, and crypto parameters
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CryptoMaterial : public NameValuePairs
{
public:
- //! Exception thrown when invalid crypto material is detected
+ /// Exception thrown when invalid crypto material is detected
class CRYPTOPP_DLL InvalidMaterial : public InvalidDataFormat
{
public:
@@ -2176,97 +2176,97 @@ public:
virtual ~CryptoMaterial() {}
- //! \brief Assign values to this object
- //! \details This function can be used to create a public key from a private key.
+ /// \brief Assign values to this object
+ /// \details This function can be used to create a public key from a private key.
virtual void AssignFrom(const NameValuePairs &source) =0;
- //! \brief Check this object for errors
- //! \param rng a RandomNumberGenerator for objects which use randomized testing
- //! \param level the level of thoroughness
- //! \returns true if the tests succeed, false otherwise
- //! \details There are four levels of thoroughness:
- //!
- //! - 0 - using this object won't cause a crash or exception
- //!
- 1 - this object will probably function, and encrypt, sign, other operations correctly
- //!
- 2 - ensure this object will function correctly, and perform reasonable security checks
- //!
- 3 - perform reasonable security checks, and do checks that may take a long time
- //!
- //! \details Level 0 does not require a RandomNumberGenerator. A NullRNG() can be used for level 0.
- //! Level 1 may not check for weak keys and such. Levels 2 and 3 are recommended.
- //! \sa ThrowIfInvalid()
+ /// \brief Check this object for errors
+ /// \param rng a RandomNumberGenerator for objects which use randomized testing
+ /// \param level the level of thoroughness
+ /// \returns true if the tests succeed, false otherwise
+ /// \details There are four levels of thoroughness:
+ ///
+ /// - 0 - using this object won't cause a crash or exception
+ ///
- 1 - this object will probably function, and encrypt, sign, other operations correctly
+ ///
- 2 - ensure this object will function correctly, and perform reasonable security checks
+ ///
- 3 - perform reasonable security checks, and do checks that may take a long time
+ ///
+ /// \details Level 0 does not require a RandomNumberGenerator. A NullRNG() can be used for level 0.
+ /// Level 1 may not check for weak keys and such. Levels 2 and 3 are recommended.
+ /// \sa ThrowIfInvalid()
virtual bool Validate(RandomNumberGenerator &rng, unsigned int level) const =0;
- //! \brief Check this object for errors
- //! \param rng a RandomNumberGenerator for objects which use randomized testing
- //! \param level the level of thoroughness
- //! \throws InvalidMaterial
- //! \details Internally, ThrowIfInvalid() calls Validate() and throws InvalidMaterial() if validation fails.
- //! \sa Validate()
+ /// \brief Check this object for errors
+ /// \param rng a RandomNumberGenerator for objects which use randomized testing
+ /// \param level the level of thoroughness
+ /// \throws InvalidMaterial
+ /// \details Internally, ThrowIfInvalid() calls Validate() and throws InvalidMaterial() if validation fails.
+ /// \sa Validate()
virtual void ThrowIfInvalid(RandomNumberGenerator &rng, unsigned int level) const
{if (!Validate(rng, level)) throw InvalidMaterial("CryptoMaterial: this object contains invalid values");}
- //! \brief Saves a key to a BufferedTransformation
- //! \param bt the destination BufferedTransformation
- //! \throws NotImplemented
- //! \details Save() writes the material to a BufferedTransformation.
- //! \details If the material is a key, then the key is written with ASN.1 DER encoding. The key
- //! includes an object identifier with an algorthm id, like a subjectPublicKeyInfo.
- //! \details A "raw" key without the "key info" can be saved using a key's DEREncode() method.
- //! \details If a derived class does not override Save(), then the base class throws
- //! NotImplemented().
+ /// \brief Saves a key to a BufferedTransformation
+ /// \param bt the destination BufferedTransformation
+ /// \throws NotImplemented
+ /// \details Save() writes the material to a BufferedTransformation.
+ /// \details If the material is a key, then the key is written with ASN.1 DER encoding. The key
+ /// includes an object identifier with an algorthm id, like a subjectPublicKeyInfo.
+ /// \details A "raw" key without the "key info" can be saved using a key's DEREncode() method.
+ /// \details If a derived class does not override Save(), then the base class throws
+ /// NotImplemented().
virtual void Save(BufferedTransformation &bt) const
{CRYPTOPP_UNUSED(bt); throw NotImplemented("CryptoMaterial: this object does not support saving");}
- //! \brief Loads a key from a BufferedTransformation
- //! \param bt the source BufferedTransformation
- //! \throws KeyingErr
- //! \details Load() attempts to read material from a BufferedTransformation. If the
- //! material is a key that was generated outside the library, then the following
- //! usually applies:
- //!
- //! - the key should be ASN.1 BER encoded
- //!
- the key should be a "key info"
- //!
- //! \details "key info" means the key should have an object identifier with an algorthm id,
- //! like a subjectPublicKeyInfo.
- //! \details To read a "raw" key without the "key info", then call the key's BERDecode() method.
- //! \note Load() generally does not check that the key is valid. Call Validate(), if needed.
+ /// \brief Loads a key from a BufferedTransformation
+ /// \param bt the source BufferedTransformation
+ /// \throws KeyingErr
+ /// \details Load() attempts to read material from a BufferedTransformation. If the
+ /// material is a key that was generated outside the library, then the following
+ /// usually applies:
+ ///
+ /// - the key should be ASN.1 BER encoded
+ ///
- the key should be a "key info"
+ ///
+ /// \details "key info" means the key should have an object identifier with an algorthm id,
+ /// like a subjectPublicKeyInfo.
+ /// \details To read a "raw" key without the "key info", then call the key's BERDecode() method.
+ /// \note Load() generally does not check that the key is valid. Call Validate(), if needed.
virtual void Load(BufferedTransformation &bt)
{CRYPTOPP_UNUSED(bt); throw NotImplemented("CryptoMaterial: this object does not support loading");}
- //! \brief Determines whether the object supports precomputation
- //! \return true if the object supports precomputation, false otherwise
- //! \sa Precompute()
+ /// \brief Determines whether the object supports precomputation
+ /// \return true if the object supports precomputation, false otherwise
+ /// \sa Precompute()
virtual bool SupportsPrecomputation() const {return false;}
- //! \brief Perform precomputation
- //! \param precomputationStorage the suggested number of objects for the precompute table
- //! \throws NotImplemented
- //! \details The exact semantics of Precompute() varies, but it typically means calculate
- //! a table of n objects that can be used later to speed up computation.
- //! \details If a derived class does not override Precompute(), then the base class throws
- //! NotImplemented.
- //! \sa SupportsPrecomputation(), LoadPrecomputation(), SavePrecomputation()
+ /// \brief Perform precomputation
+ /// \param precomputationStorage the suggested number of objects for the precompute table
+ /// \throws NotImplemented
+ /// \details The exact semantics of Precompute() varies, but it typically means calculate
+ /// a table of n objects that can be used later to speed up computation.
+ /// \details If a derived class does not override Precompute(), then the base class throws
+ /// NotImplemented.
+ /// \sa SupportsPrecomputation(), LoadPrecomputation(), SavePrecomputation()
virtual void Precompute(unsigned int precomputationStorage) {
CRYPTOPP_UNUSED(precomputationStorage); CRYPTOPP_ASSERT(!SupportsPrecomputation());
throw NotImplemented("CryptoMaterial: this object does not support precomputation");
}
- //! \brief Retrieve previously saved precomputation
- //! \param storedPrecomputation BufferedTransformation with the saved precomputation
- //! \throws NotImplemented
- //! \sa SupportsPrecomputation(), Precompute()
+ /// \brief Retrieve previously saved precomputation
+ /// \param storedPrecomputation BufferedTransformation with the saved precomputation
+ /// \throws NotImplemented
+ /// \sa SupportsPrecomputation(), Precompute()
virtual void LoadPrecomputation(BufferedTransformation &storedPrecomputation)
{CRYPTOPP_UNUSED(storedPrecomputation); CRYPTOPP_ASSERT(!SupportsPrecomputation()); throw NotImplemented("CryptoMaterial: this object does not support precomputation");}
- //! \brief Save precomputation for later use
- //! \param storedPrecomputation BufferedTransformation to write the precomputation
- //! \throws NotImplemented
- //! \sa SupportsPrecomputation(), Precompute()
+ /// \brief Save precomputation for later use
+ /// \param storedPrecomputation BufferedTransformation to write the precomputation
+ /// \throws NotImplemented
+ /// \sa SupportsPrecomputation(), Precompute()
virtual void SavePrecomputation(BufferedTransformation &storedPrecomputation) const
{CRYPTOPP_UNUSED(storedPrecomputation); CRYPTOPP_ASSERT(!SupportsPrecomputation()); throw NotImplemented("CryptoMaterial: this object does not support precomputation");}
- //! \brief Perform a quick sanity check
- //! \details DoQuickSanityCheck() is for internal library use, and it should not be called by library users.
+ /// \brief Perform a quick sanity check
+ /// \details DoQuickSanityCheck() is for internal library use, and it should not be called by library users.
void DoQuickSanityCheck() const {ThrowIfInvalid(NullRNG(), 0);}
#if (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
@@ -2275,76 +2275,76 @@ public:
#endif
};
-//! \class GeneratableCryptoMaterial
-//! \brief Interface for generatable crypto material, such as private keys and crypto parameters
+/// \class GeneratableCryptoMaterial
+/// \brief Interface for generatable crypto material, such as private keys and crypto parameters
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE GeneratableCryptoMaterial : virtual public CryptoMaterial
{
public:
virtual ~GeneratableCryptoMaterial() {}
- //! \brief Generate a random key or crypto parameters
- //! \param rng a RandomNumberGenerator to produce keying material
- //! \param params additional initialization parameters
- //! \throws KeyingErr if a key can't be generated or algorithm parameters are invalid
- //! \details If a derived class does not override GenerateRandom(), then the base class throws
- //! NotImplemented.
+ /// \brief Generate a random key or crypto parameters
+ /// \param rng a RandomNumberGenerator to produce keying material
+ /// \param params additional initialization parameters
+ /// \throws KeyingErr if a key can't be generated or algorithm parameters are invalid
+ /// \details If a derived class does not override GenerateRandom(), then the base class throws
+ /// NotImplemented.
virtual void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶ms = g_nullNameValuePairs) {
CRYPTOPP_UNUSED(rng); CRYPTOPP_UNUSED(params);
throw NotImplemented("GeneratableCryptoMaterial: this object does not support key/parameter generation");
}
- //! \brief Generate a random key or crypto parameters
- //! \param rng a RandomNumberGenerator to produce keying material
- //! \param keySize the size of the key, in bits
- //! \throws KeyingErr if a key can't be generated or algorithm parameters are invalid
- //! \details GenerateRandomWithKeySize calls GenerateRandom() with a NameValuePairs
- //! object with only "KeySize"
+ /// \brief Generate a random key or crypto parameters
+ /// \param rng a RandomNumberGenerator to produce keying material
+ /// \param keySize the size of the key, in bits
+ /// \throws KeyingErr if a key can't be generated or algorithm parameters are invalid
+ /// \details GenerateRandomWithKeySize calls GenerateRandom() with a NameValuePairs
+ /// object with only "KeySize"
void GenerateRandomWithKeySize(RandomNumberGenerator &rng, unsigned int keySize);
};
-//! \brief Interface for public keys
+/// \brief Interface for public keys
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PublicKey : virtual public CryptoMaterial
{
};
-//! \brief Interface for private keys
+/// \brief Interface for private keys
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PrivateKey : public GeneratableCryptoMaterial
{
};
-//! \brief Interface for crypto prameters
+/// \brief Interface for crypto prameters
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CryptoParameters : public GeneratableCryptoMaterial
{
};
-//! \brief Interface for asymmetric algorithms
+/// \brief Interface for asymmetric algorithms
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AsymmetricAlgorithm : public Algorithm
{
public:
virtual ~AsymmetricAlgorithm() {}
- //! \brief Retrieves a reference to CryptoMaterial
- //! \return a reference to the crypto material
+ /// \brief Retrieves a reference to CryptoMaterial
+ /// \return a reference to the crypto material
virtual CryptoMaterial & AccessMaterial() =0;
- //! \brief Retrieves a reference to CryptoMaterial
- //! \return a const reference to the crypto material
+ /// \brief Retrieves a reference to CryptoMaterial
+ /// \return a const reference to the crypto material
virtual const CryptoMaterial & GetMaterial() const =0;
- //! \brief Loads this object from a BufferedTransformation
- //! \param bt a BufferedTransformation object
- //! \deprecated for backwards compatibility, calls AccessMaterial().Load(bt)
+ /// \brief Loads this object from a BufferedTransformation
+ /// \param bt a BufferedTransformation object
+ /// \deprecated for backwards compatibility, calls AccessMaterial().Load(bt)
void BERDecode(BufferedTransformation &bt)
{AccessMaterial().Load(bt);}
- //! \brief Saves this object to a BufferedTransformation
- //! \param bt a BufferedTransformation object
- //! \deprecated for backwards compatibility, calls GetMaterial().Save(bt)
+ /// \brief Saves this object to a BufferedTransformation
+ /// \param bt a BufferedTransformation object
+ /// \deprecated for backwards compatibility, calls GetMaterial().Save(bt)
void DEREncode(BufferedTransformation &bt) const
{GetMaterial().Save(bt);}
};
-//! \brief Interface for asymmetric algorithms using public keys
+/// \brief Interface for asymmetric algorithms using public keys
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PublicKeyAlgorithm : public AsymmetricAlgorithm
{
public:
@@ -2352,213 +2352,213 @@ public:
// VC60 workaround: no co-variant return type
- //! \brief Retrieves a reference to a Public Key
- //! \return a reference to the public key
+ /// \brief Retrieves a reference to a Public Key
+ /// \return a reference to the public key
CryptoMaterial & AccessMaterial()
{return AccessPublicKey();}
- //! \brief Retrieves a reference to a Public Key
- //! \return a const reference the public key
+ /// \brief Retrieves a reference to a Public Key
+ /// \return a const reference the public key
const CryptoMaterial & GetMaterial() const
{return GetPublicKey();}
- //! \brief Retrieves a reference to a Public Key
- //! \return a reference to the public key
+ /// \brief Retrieves a reference to a Public Key
+ /// \return a reference to the public key
virtual PublicKey & AccessPublicKey() =0;
- //! \brief Retrieves a reference to a Public Key
- //! \return a const reference the public key
+ /// \brief Retrieves a reference to a Public Key
+ /// \return a const reference the public key
virtual const PublicKey & GetPublicKey() const
{return const_cast(this)->AccessPublicKey();}
};
-//! \brief Interface for asymmetric algorithms using private keys
+/// \brief Interface for asymmetric algorithms using private keys
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PrivateKeyAlgorithm : public AsymmetricAlgorithm
{
public:
virtual ~PrivateKeyAlgorithm() {}
- //! \brief Retrieves a reference to a Private Key
- //! \return a reference the private key
+ /// \brief Retrieves a reference to a Private Key
+ /// \return a reference the private key
CryptoMaterial & AccessMaterial() {return AccessPrivateKey();}
- //! \brief Retrieves a reference to a Private Key
- //! \return a const reference the private key
+ /// \brief Retrieves a reference to a Private Key
+ /// \return a const reference the private key
const CryptoMaterial & GetMaterial() const {return GetPrivateKey();}
- //! \brief Retrieves a reference to a Private Key
- //! \return a reference the private key
+ /// \brief Retrieves a reference to a Private Key
+ /// \return a reference the private key
virtual PrivateKey & AccessPrivateKey() =0;
- //! \brief Retrieves a reference to a Private Key
- //! \return a const reference the private key
+ /// \brief Retrieves a reference to a Private Key
+ /// \return a const reference the private key
virtual const PrivateKey & GetPrivateKey() const {return const_cast(this)->AccessPrivateKey();}
};
-//! \brief Interface for key agreement algorithms
+/// \brief Interface for key agreement algorithms
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE KeyAgreementAlgorithm : public AsymmetricAlgorithm
{
public:
virtual ~KeyAgreementAlgorithm() {}
- //! \brief Retrieves a reference to Crypto Parameters
- //! \return a reference the crypto parameters
+ /// \brief Retrieves a reference to Crypto Parameters
+ /// \return a reference the crypto parameters
CryptoMaterial & AccessMaterial() {return AccessCryptoParameters();}
- //! \brief Retrieves a reference to Crypto Parameters
- //! \return a const reference the crypto parameters
+ /// \brief Retrieves a reference to Crypto Parameters
+ /// \return a const reference the crypto parameters
const CryptoMaterial & GetMaterial() const {return GetCryptoParameters();}
- //! \brief Retrieves a reference to Crypto Parameters
- //! \return a reference the crypto parameters
+ /// \brief Retrieves a reference to Crypto Parameters
+ /// \return a reference the crypto parameters
virtual CryptoParameters & AccessCryptoParameters() =0;
- //! \brief Retrieves a reference to Crypto Parameters
- //! \return a const reference the crypto parameters
+ /// \brief Retrieves a reference to Crypto Parameters
+ /// \return a const reference the crypto parameters
virtual const CryptoParameters & GetCryptoParameters() const {return const_cast(this)->AccessCryptoParameters();}
};
-//! \brief Interface for public-key encryptors and decryptors
-//! \details This class provides an interface common to encryptors and decryptors
-//! for querying their plaintext and ciphertext lengths.
+/// \brief Interface for public-key encryptors and decryptors
+/// \details This class provides an interface common to encryptors and decryptors
+/// for querying their plaintext and ciphertext lengths.
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_CryptoSystem
{
public:
virtual ~PK_CryptoSystem() {}
- //! \brief Provides the maximum length of plaintext for a given ciphertext length
- //! \return the maximum size of the plaintext, in bytes
- //! \details This function returns 0 if ciphertextLength is not valid (too long or too short).
+ /// \brief Provides the maximum length of plaintext for a given ciphertext length
+ /// \return the maximum size of the plaintext, in bytes
+ /// \details This function returns 0 if ciphertextLength is not valid (too long or too short).
virtual size_t MaxPlaintextLength(size_t ciphertextLength) const =0;
- //! \brief Calculate the length of ciphertext given length of plaintext
- //! \return the maximum size of the ciphertext, in bytes
- //! \details This function returns 0 if plaintextLength is not valid (too long).
+ /// \brief Calculate the length of ciphertext given length of plaintext
+ /// \return the maximum size of the ciphertext, in bytes
+ /// \details This function returns 0 if plaintextLength is not valid (too long).
virtual size_t CiphertextLength(size_t plaintextLength) const =0;
- //! \brief Determines whether this object supports the use of a named parameter
- //! \param name the name of the parameter
- //! \return true if the parameter name is supported, false otherwise
- //! \details Some possible parameter names: EncodingParameters(), KeyDerivationParameters()
- //! and others Parameters listed in argnames.h
+ /// \brief Determines whether this object supports the use of a named parameter
+ /// \param name the name of the parameter
+ /// \return true if the parameter name is supported, false otherwise
+ /// \details Some possible parameter names: EncodingParameters(), KeyDerivationParameters()
+ /// and others Parameters listed in argnames.h
virtual bool ParameterSupported(const char *name) const =0;
- //! \brief Provides the fixed ciphertext length, if one exists
- //! \return the fixed ciphertext length if one exists, otherwise 0
- //! \details "Fixed" here means length of ciphertext does not depend on length of plaintext.
- //! In this case, it usually does depend on the key length.
+ /// \brief Provides the fixed ciphertext length, if one exists
+ /// \return the fixed ciphertext length if one exists, otherwise 0
+ /// \details "Fixed" here means length of ciphertext does not depend on length of plaintext.
+ /// In this case, it usually does depend on the key length.
virtual size_t FixedCiphertextLength() const {return 0;}
- //! \brief Provides the maximum plaintext length given a fixed ciphertext length
- //! \return maximum plaintext length given the fixed ciphertext length, if one exists,
- //! otherwise return 0.
- //! \details FixedMaxPlaintextLength(0 returns the maximum plaintext length given the fixed ciphertext
- //! length, if one exists, otherwise return 0.
+ /// \brief Provides the maximum plaintext length given a fixed ciphertext length
+ /// \return maximum plaintext length given the fixed ciphertext length, if one exists,
+ /// otherwise return 0.
+ /// \details FixedMaxPlaintextLength(0 returns the maximum plaintext length given the fixed ciphertext
+ /// length, if one exists, otherwise return 0.
virtual size_t FixedMaxPlaintextLength() const {return 0;}
};
-//! \class PK_Encryptor
-//! \brief Interface for public-key encryptors
+/// \class PK_Encryptor
+/// \brief Interface for public-key encryptors
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Encryptor : public PK_CryptoSystem, public PublicKeyAlgorithm
{
public:
- //! \brief Exception thrown when trying to encrypt plaintext of invalid length
+ /// \brief Exception thrown when trying to encrypt plaintext of invalid length
class CRYPTOPP_DLL InvalidPlaintextLength : public Exception
{
public:
InvalidPlaintextLength() : Exception(OTHER_ERROR, "PK_Encryptor: invalid plaintext length") {}
};
- //! \brief Encrypt a byte string
- //! \param rng a RandomNumberGenerator derived class
- //! \param plaintext the plaintext byte buffer
- //! \param plaintextLength the size of the plaintext byte buffer
- //! \param ciphertext a byte buffer to hold the encrypted string
- //! \param parameters a set of NameValuePairs to initialize this object
- //! \pre CiphertextLength(plaintextLength) != 0 ensures the plaintext isn't too large
- //! \pre COUNTOF(ciphertext) == CiphertextLength(plaintextLength) ensures the output
- //! byte buffer is large enough.
- //! \sa PK_Decryptor
+ /// \brief Encrypt a byte string
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param plaintext the plaintext byte buffer
+ /// \param plaintextLength the size of the plaintext byte buffer
+ /// \param ciphertext a byte buffer to hold the encrypted string
+ /// \param parameters a set of NameValuePairs to initialize this object
+ /// \pre CiphertextLength(plaintextLength) != 0 ensures the plaintext isn't too large
+ /// \pre COUNTOF(ciphertext) == CiphertextLength(plaintextLength) ensures the output
+ /// byte buffer is large enough.
+ /// \sa PK_Decryptor
virtual void Encrypt(RandomNumberGenerator &rng,
const byte *plaintext, size_t plaintextLength,
byte *ciphertext, const NameValuePairs ¶meters = g_nullNameValuePairs) const =0;
- //! \brief Create a new encryption filter
- //! \param rng a RandomNumberGenerator derived class
- //! \param attachment an attached transformation
- //! \param parameters a set of NameValuePairs to initialize this object
- //! \details \p attachment can be \p NULL. The caller is responsible for deleting the returned pointer.
- //! Encoding parameters should be passed in the "EP" channel.
+ /// \brief Create a new encryption filter
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param attachment an attached transformation
+ /// \param parameters a set of NameValuePairs to initialize this object
+ /// \details \p attachment can be \p NULL. The caller is responsible for deleting the returned pointer.
+ /// Encoding parameters should be passed in the "EP" channel.
virtual BufferedTransformation * CreateEncryptionFilter(RandomNumberGenerator &rng,
BufferedTransformation *attachment=NULLPTR, const NameValuePairs ¶meters = g_nullNameValuePairs) const;
};
-//! \class PK_Decryptor
-//! \brief Interface for public-key decryptors
+/// \class PK_Decryptor
+/// \brief Interface for public-key decryptors
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Decryptor : public PK_CryptoSystem, public PrivateKeyAlgorithm
{
public:
virtual ~PK_Decryptor() {}
- //! \brief Decrypt a byte string
- //! \param rng a RandomNumberGenerator derived class
- //! \param ciphertext the encrypted byte buffer
- //! \param ciphertextLength the size of the encrypted byte buffer
- //! \param plaintext a byte buffer to hold the decrypted string
- //! \param parameters a set of NameValuePairs to initialize this object
- //! \return the result of the decryption operation
- //! \details If DecodingResult::isValidCoding is true, then DecodingResult::messageLength
- //! is valid and holds the the actual length of the plaintext recovered. The result is undefined
- //! if decryption failed. If DecodingResult::isValidCoding is false, then DecodingResult::messageLength
- //! is undefined.
- //! \pre COUNTOF(plaintext) == MaxPlaintextLength(ciphertextLength) ensures the output
- //! byte buffer is large enough
- //! \sa PK_Encryptor
+ /// \brief Decrypt a byte string
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param ciphertext the encrypted byte buffer
+ /// \param ciphertextLength the size of the encrypted byte buffer
+ /// \param plaintext a byte buffer to hold the decrypted string
+ /// \param parameters a set of NameValuePairs to initialize this object
+ /// \return the result of the decryption operation
+ /// \details If DecodingResult::isValidCoding is true, then DecodingResult::messageLength
+ /// is valid and holds the the actual length of the plaintext recovered. The result is undefined
+ /// if decryption failed. If DecodingResult::isValidCoding is false, then DecodingResult::messageLength
+ /// is undefined.
+ /// \pre COUNTOF(plaintext) == MaxPlaintextLength(ciphertextLength) ensures the output
+ /// byte buffer is large enough
+ /// \sa PK_Encryptor
virtual DecodingResult Decrypt(RandomNumberGenerator &rng,
const byte *ciphertext, size_t ciphertextLength,
byte *plaintext, const NameValuePairs ¶meters = g_nullNameValuePairs) const =0;
- //! \brief Create a new decryption filter
- //! \param rng a RandomNumberGenerator derived class
- //! \param attachment an attached transformation
- //! \param parameters a set of NameValuePairs to initialize this object
- //! \return the newly created decryption filter
- //! \note the caller is responsible for deleting the returned pointer
+ /// \brief Create a new decryption filter
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param attachment an attached transformation
+ /// \param parameters a set of NameValuePairs to initialize this object
+ /// \return the newly created decryption filter
+ /// \note the caller is responsible for deleting the returned pointer
virtual BufferedTransformation * CreateDecryptionFilter(RandomNumberGenerator &rng,
BufferedTransformation *attachment=NULLPTR, const NameValuePairs ¶meters = g_nullNameValuePairs) const;
- //! \brief Decrypt a fixed size ciphertext
- //! \param rng a RandomNumberGenerator derived class
- //! \param ciphertext the encrypted byte buffer
- //! \param plaintext a byte buffer to hold the decrypted string
- //! \param parameters a set of NameValuePairs to initialize this object
- //! \return the result of the decryption operation
- //! \details If DecodingResult::isValidCoding is true, then DecodingResult::messageLength
- //! is valid and holds the the actual length of the plaintext recovered. The result is undefined
- //! if decryption failed. If DecodingResult::isValidCoding is false, then DecodingResult::messageLength
- //! is undefined.
- //! \pre COUNTOF(plaintext) == MaxPlaintextLength(ciphertextLength) ensures the output
- //! byte buffer is large enough
- //! \sa PK_Encryptor
+ /// \brief Decrypt a fixed size ciphertext
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param ciphertext the encrypted byte buffer
+ /// \param plaintext a byte buffer to hold the decrypted string
+ /// \param parameters a set of NameValuePairs to initialize this object
+ /// \return the result of the decryption operation
+ /// \details If DecodingResult::isValidCoding is true, then DecodingResult::messageLength
+ /// is valid and holds the the actual length of the plaintext recovered. The result is undefined
+ /// if decryption failed. If DecodingResult::isValidCoding is false, then DecodingResult::messageLength
+ /// is undefined.
+ /// \pre COUNTOF(plaintext) == MaxPlaintextLength(ciphertextLength) ensures the output
+ /// byte buffer is large enough
+ /// \sa PK_Encryptor
DecodingResult FixedLengthDecrypt(RandomNumberGenerator &rng, const byte *ciphertext, byte *plaintext, const NameValuePairs ¶meters = g_nullNameValuePairs) const
{return Decrypt(rng, ciphertext, FixedCiphertextLength(), plaintext, parameters);}
};
-//! \class PK_SignatureScheme
-//! \brief Interface for public-key signers and verifiers
-//! \details This class provides an interface common to signers and verifiers for querying scheme properties
-//! \sa DL_SignatureSchemeBase, TF_SignatureSchemeBase, DL_SignerBase, TF_SignerBase
+/// \class PK_SignatureScheme
+/// \brief Interface for public-key signers and verifiers
+/// \details This class provides an interface common to signers and verifiers for querying scheme properties
+/// \sa DL_SignatureSchemeBase, TF_SignatureSchemeBase, DL_SignerBase, TF_SignerBase
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_SignatureScheme
{
public:
- //! \class InvalidKeyLength
- //! \brief Exception throw when the private or public key has a length that can't be used
- //! \details InvalidKeyLength() may be thrown by any function in this class if the private
- //! or public key has a length that can't be used
+ /// \class InvalidKeyLength
+ /// \brief Exception throw when the private or public key has a length that can't be used
+ /// \details InvalidKeyLength() may be thrown by any function in this class if the private
+ /// or public key has a length that can't be used
class CRYPTOPP_DLL InvalidKeyLength : public Exception
{
public:
InvalidKeyLength(const std::string &message) : Exception(OTHER_ERROR, message) {}
};
- //! \class KeyTooShort
- //! \brief Exception throw when the private or public key is too short to sign or verify
- //! \details KeyTooShort() may be thrown by any function in this class if the private or public
- //! key is too short to sign or verify anything
+ /// \class KeyTooShort
+ /// \brief Exception throw when the private or public key is too short to sign or verify
+ /// \details KeyTooShort() may be thrown by any function in this class if the private or public
+ /// key is too short to sign or verify anything
class CRYPTOPP_DLL KeyTooShort : public InvalidKeyLength
{
public:
@@ -2567,68 +2567,68 @@ public:
virtual ~PK_SignatureScheme() {}
- //! \brief Provides the signature length if it only depends on the key
- //! \return the signature length if it only depends on the key, in bytes
- //! \details SignatureLength() returns the signature length if it only depends on the key, otherwise 0.
+ /// \brief Provides the signature length if it only depends on the key
+ /// \return the signature length if it only depends on the key, in bytes
+ /// \details SignatureLength() returns the signature length if it only depends on the key, otherwise 0.
virtual size_t SignatureLength() const =0;
- //! \brief Provides the maximum signature length produced given the length of the recoverable message part
- //! \param recoverablePartLength the length of the recoverable message part, in bytes
- //! \return the maximum signature length produced for a given length of recoverable message part, in bytes
- //! \details MaxSignatureLength() returns the maximum signature length produced given the length of the
- //! recoverable message part.
+ /// \brief Provides the maximum signature length produced given the length of the recoverable message part
+ /// \param recoverablePartLength the length of the recoverable message part, in bytes
+ /// \return the maximum signature length produced for a given length of recoverable message part, in bytes
+ /// \details MaxSignatureLength() returns the maximum signature length produced given the length of the
+ /// recoverable message part.
virtual size_t MaxSignatureLength(size_t recoverablePartLength = 0) const
{CRYPTOPP_UNUSED(recoverablePartLength); return SignatureLength();}
- //! \brief Provides the length of longest message that can be recovered
- //! \return the length of longest message that can be recovered, in bytes
- //! \details MaxRecoverableLength() returns the length of longest message that can be recovered, or 0 if
- //! this signature scheme does not support message recovery.
+ /// \brief Provides the length of longest message that can be recovered
+ /// \return the length of longest message that can be recovered, in bytes
+ /// \details MaxRecoverableLength() returns the length of longest message that can be recovered, or 0 if
+ /// this signature scheme does not support message recovery.
virtual size_t MaxRecoverableLength() const =0;
- //! \brief Provides the length of longest message that can be recovered from a signature of given length
- //! \param signatureLength the length of the signature, in bytes
- //! \return the length of longest message that can be recovered from a signature of given length, in bytes
- //! \details MaxRecoverableLengthFromSignatureLength() returns the length of longest message that can be
- //! recovered from a signature of given length, or 0 if this signature scheme does not support message
- //! recovery.
+ /// \brief Provides the length of longest message that can be recovered from a signature of given length
+ /// \param signatureLength the length of the signature, in bytes
+ /// \return the length of longest message that can be recovered from a signature of given length, in bytes
+ /// \details MaxRecoverableLengthFromSignatureLength() returns the length of longest message that can be
+ /// recovered from a signature of given length, or 0 if this signature scheme does not support message
+ /// recovery.
virtual size_t MaxRecoverableLengthFromSignatureLength(size_t signatureLength) const =0;
- //! \brief Determines whether a signature scheme requires a random number generator
- //! \return true if the signature scheme requires a RandomNumberGenerator() to sign
- //! \details if IsProbabilistic() returns false, then NullRNG() can be passed to functions that take
- //! RandomNumberGenerator().
+ /// \brief Determines whether a signature scheme requires a random number generator
+ /// \return true if the signature scheme requires a RandomNumberGenerator() to sign
+ /// \details if IsProbabilistic() returns false, then NullRNG() can be passed to functions that take
+ /// RandomNumberGenerator().
virtual bool IsProbabilistic() const =0;
- //! \brief Determines whether the non-recoverable message part can be signed
- //! \return true if the non-recoverable message part can be signed
+ /// \brief Determines whether the non-recoverable message part can be signed
+ /// \return true if the non-recoverable message part can be signed
virtual bool AllowNonrecoverablePart() const =0;
- //! \brief Determines whether the signature must be input before the message
- //! \return true if the signature must be input before the message during verifcation
- //! \details if SignatureUpfront() returns true, then you must input the signature before the message
- //! during verification. Otherwise you can input the signature at anytime.
+ /// \brief Determines whether the signature must be input before the message
+ /// \return true if the signature must be input before the message during verifcation
+ /// \details if SignatureUpfront() returns true, then you must input the signature before the message
+ /// during verification. Otherwise you can input the signature at anytime.
virtual bool SignatureUpfront() const {return false;}
- //! \brief Determines whether the recoverable part must be input before the non-recoverable part
- //! \return true if the recoverable part must be input before the non-recoverable part during signing
- //! \details RecoverablePartFirst() determines whether you must input the recoverable part before the
- //! non-recoverable part during signing
+ /// \brief Determines whether the recoverable part must be input before the non-recoverable part
+ /// \return true if the recoverable part must be input before the non-recoverable part during signing
+ /// \details RecoverablePartFirst() determines whether you must input the recoverable part before the
+ /// non-recoverable part during signing
virtual bool RecoverablePartFirst() const =0;
};
-//! \class PK_MessageAccumulator
-//! \brief Interface for accumulating messages to be signed or verified
-//! \details Only Update() should be called from the PK_MessageAccumulator() class. No other functions
-//! inherited from HashTransformation, like DigestSize() and TruncatedFinal(), should be called.
+/// \class PK_MessageAccumulator
+/// \brief Interface for accumulating messages to be signed or verified
+/// \details Only Update() should be called from the PK_MessageAccumulator() class. No other functions
+/// inherited from HashTransformation, like DigestSize() and TruncatedFinal(), should be called.
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_MessageAccumulator : public HashTransformation
{
public:
- //! \warning DigestSize() should not be called on PK_MessageAccumulator
+ /// \warning DigestSize() should not be called on PK_MessageAccumulator
unsigned int DigestSize() const
{throw NotImplemented("PK_MessageAccumulator: DigestSize() should not be called");}
- //! \warning TruncatedFinal() should not be called on PK_MessageAccumulator
+ /// \warning TruncatedFinal() should not be called on PK_MessageAccumulator
void TruncatedFinal(byte *digest, size_t digestSize)
{
CRYPTOPP_UNUSED(digest); CRYPTOPP_UNUSED(digestSize);
@@ -2636,286 +2636,286 @@ public:
}
};
-//! \class PK_Signer
-//! \brief Interface for public-key signers
+/// \class PK_Signer
+/// \brief Interface for public-key signers
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Signer : public PK_SignatureScheme, public PrivateKeyAlgorithm
{
public:
virtual ~PK_Signer() {}
- //! \brief Create a new HashTransformation to accumulate the message to be signed
- //! \param rng a RandomNumberGenerator derived class
- //! \return a pointer to a PK_MessageAccumulator
- //! \details NewSignatureAccumulator() can be used with all signing methods. Sign() will autimatically delete the
- //! accumulator pointer. The caller is responsible for deletion if a method is called that takes a reference.
+ /// \brief Create a new HashTransformation to accumulate the message to be signed
+ /// \param rng a RandomNumberGenerator derived class
+ /// \return a pointer to a PK_MessageAccumulator
+ /// \details NewSignatureAccumulator() can be used with all signing methods. Sign() will autimatically delete the
+ /// accumulator pointer. The caller is responsible for deletion if a method is called that takes a reference.
virtual PK_MessageAccumulator * NewSignatureAccumulator(RandomNumberGenerator &rng) const =0;
- //! \brief Input a recoverable message to an accumulator
- //! \param messageAccumulator a reference to a PK_MessageAccumulator
- //! \param recoverableMessage a pointer to the recoverable message part to be signed
- //! \param recoverableMessageLength the size of the recoverable message part
+ /// \brief Input a recoverable message to an accumulator
+ /// \param messageAccumulator a reference to a PK_MessageAccumulator
+ /// \param recoverableMessage a pointer to the recoverable message part to be signed
+ /// \param recoverableMessageLength the size of the recoverable message part
virtual void InputRecoverableMessage(PK_MessageAccumulator &messageAccumulator, const byte *recoverableMessage, size_t recoverableMessageLength) const =0;
- //! \brief Sign and delete the messageAccumulator
- //! \param rng a RandomNumberGenerator derived class
- //! \param messageAccumulator a pointer to a PK_MessageAccumulator derived class
- //! \param signature a block of bytes for the signature
- //! \return actual signature length
- //! \details Sign() deletes the messageAccumulator, even if an exception is thrown.
- //! \pre COUNTOF(signature) == MaxSignatureLength()
+ /// \brief Sign and delete the messageAccumulator
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param messageAccumulator a pointer to a PK_MessageAccumulator derived class
+ /// \param signature a block of bytes for the signature
+ /// \return actual signature length
+ /// \details Sign() deletes the messageAccumulator, even if an exception is thrown.
+ /// \pre COUNTOF(signature) == MaxSignatureLength()
virtual size_t Sign(RandomNumberGenerator &rng, PK_MessageAccumulator *messageAccumulator, byte *signature) const;
- //! \brief Sign and restart messageAccumulator
- //! \param rng a RandomNumberGenerator derived class
- //! \param messageAccumulator a pointer to a PK_MessageAccumulator derived class
- //! \param signature a block of bytes for the signature
- //! \param restart flag indicating whether the messageAccumulator should be restarted
- //! \return actual signature length
- //! \pre COUNTOF(signature) == MaxSignatureLength()
+ /// \brief Sign and restart messageAccumulator
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param messageAccumulator a pointer to a PK_MessageAccumulator derived class
+ /// \param signature a block of bytes for the signature
+ /// \param restart flag indicating whether the messageAccumulator should be restarted
+ /// \return actual signature length
+ /// \pre COUNTOF(signature) == MaxSignatureLength()
virtual size_t SignAndRestart(RandomNumberGenerator &rng, PK_MessageAccumulator &messageAccumulator, byte *signature, bool restart=true) const =0;
- //! \brief Sign a message
- //! \param rng a RandomNumberGenerator derived class
- //! \param message a pointer to the message
- //! \param messageLen the size of the message to be signed
- //! \param signature a block of bytes for the signature
- //! \return actual signature length
- //! \pre COUNTOF(signature) == MaxSignatureLength()
+ /// \brief Sign a message
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param message a pointer to the message
+ /// \param messageLen the size of the message to be signed
+ /// \param signature a block of bytes for the signature
+ /// \return actual signature length
+ /// \pre COUNTOF(signature) == MaxSignatureLength()
virtual size_t SignMessage(RandomNumberGenerator &rng, const byte *message, size_t messageLen, byte *signature) const;
- //! \brief Sign a recoverable message
- //! \param rng a RandomNumberGenerator derived class
- //! \param recoverableMessage a pointer to the recoverable message part to be signed
- //! \param recoverableMessageLength the size of the recoverable message part
- //! \param nonrecoverableMessage a pointer to the non-recoverable message part to be signed
- //! \param nonrecoverableMessageLength the size of the non-recoverable message part
- //! \param signature a block of bytes for the signature
- //! \return actual signature length
- //! \pre COUNTOF(signature) == MaxSignatureLength(recoverableMessageLength)
+ /// \brief Sign a recoverable message
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param recoverableMessage a pointer to the recoverable message part to be signed
+ /// \param recoverableMessageLength the size of the recoverable message part
+ /// \param nonrecoverableMessage a pointer to the non-recoverable message part to be signed
+ /// \param nonrecoverableMessageLength the size of the non-recoverable message part
+ /// \param signature a block of bytes for the signature
+ /// \return actual signature length
+ /// \pre COUNTOF(signature) == MaxSignatureLength(recoverableMessageLength)
virtual size_t SignMessageWithRecovery(RandomNumberGenerator &rng, const byte *recoverableMessage, size_t recoverableMessageLength,
const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength, byte *signature) const;
};
-//! \class PK_Verifier
-//! \brief Interface for public-key signature verifiers
-//! \details The Recover* functions throw NotImplemented if the signature scheme does not support
-//! message recovery.
-//! \details The Verify* functions throw InvalidDataFormat if the scheme does support message
-//! recovery and the signature contains a non-empty recoverable message part. The
-//! Recover* functions should be used in that case.
+/// \class PK_Verifier
+/// \brief Interface for public-key signature verifiers
+/// \details The Recover* functions throw NotImplemented if the signature scheme does not support
+/// message recovery.
+/// \details The Verify* functions throw InvalidDataFormat if the scheme does support message
+/// recovery and the signature contains a non-empty recoverable message part. The
+/// Recover* functions should be used in that case.
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Verifier : public PK_SignatureScheme, public PublicKeyAlgorithm
{
public:
virtual ~PK_Verifier() {}
- //! \brief Create a new HashTransformation to accumulate the message to be verified
- //! \return a pointer to a PK_MessageAccumulator
- //! \details NewVerificationAccumulator() can be used with all verification methods. Verify() will autimatically delete
- //! the accumulator pointer. The caller is responsible for deletion if a method is called that takes a reference.
+ /// \brief Create a new HashTransformation to accumulate the message to be verified
+ /// \return a pointer to a PK_MessageAccumulator
+ /// \details NewVerificationAccumulator() can be used with all verification methods. Verify() will autimatically delete
+ /// the accumulator pointer. The caller is responsible for deletion if a method is called that takes a reference.
virtual PK_MessageAccumulator * NewVerificationAccumulator() const =0;
- //! \brief Input signature into a message accumulator
- //! \param messageAccumulator a pointer to a PK_MessageAccumulator derived class
- //! \param signature the signature on the message
- //! \param signatureLength the size of the signature
+ /// \brief Input signature into a message accumulator
+ /// \param messageAccumulator a pointer to a PK_MessageAccumulator derived class
+ /// \param signature the signature on the message
+ /// \param signatureLength the size of the signature
virtual void InputSignature(PK_MessageAccumulator &messageAccumulator, const byte *signature, size_t signatureLength) const =0;
- //! \brief Check whether messageAccumulator contains a valid signature and message
- //! \param messageAccumulator a pointer to a PK_MessageAccumulator derived class
- //! \return true if the signature is valid, false otherwise
- //! \details Verify() deletes the messageAccumulator, even if an exception is thrown.
+ /// \brief Check whether messageAccumulator contains a valid signature and message
+ /// \param messageAccumulator a pointer to a PK_MessageAccumulator derived class
+ /// \return true if the signature is valid, false otherwise
+ /// \details Verify() deletes the messageAccumulator, even if an exception is thrown.
virtual bool Verify(PK_MessageAccumulator *messageAccumulator) const;
- //! \brief Check whether messageAccumulator contains a valid signature and message, and restart messageAccumulator
- //! \param messageAccumulator a reference to a PK_MessageAccumulator derived class
- //! \return true if the signature is valid, false otherwise
- //! \details VerifyAndRestart() restarts the messageAccumulator
+ /// \brief Check whether messageAccumulator contains a valid signature and message, and restart messageAccumulator
+ /// \param messageAccumulator a reference to a PK_MessageAccumulator derived class
+ /// \return true if the signature is valid, false otherwise
+ /// \details VerifyAndRestart() restarts the messageAccumulator
virtual bool VerifyAndRestart(PK_MessageAccumulator &messageAccumulator) const =0;
- //! \brief Check whether input signature is a valid signature for input message
- //! \param message a pointer to the message to be verified
- //! \param messageLen the size of the message
- //! \param signature a pointer to the signature over the message
- //! \param signatureLen the size of the signature
- //! \return true if the signature is valid, false otherwise
+ /// \brief Check whether input signature is a valid signature for input message
+ /// \param message a pointer to the message to be verified
+ /// \param messageLen the size of the message
+ /// \param signature a pointer to the signature over the message
+ /// \param signatureLen the size of the signature
+ /// \return true if the signature is valid, false otherwise
virtual bool VerifyMessage(const byte *message, size_t messageLen,
const byte *signature, size_t signatureLen) const;
- //! \brief Recover a message from its signature
- //! \param recoveredMessage a pointer to the recoverable message part to be verified
- //! \param messageAccumulator a pointer to a PK_MessageAccumulator derived class
- //! \return the result of the verification operation
- //! \details Recover() deletes the messageAccumulator, even if an exception is thrown.
- //! \pre COUNTOF(recoveredMessage) == MaxRecoverableLengthFromSignatureLength(signatureLength)
+ /// \brief Recover a message from its signature
+ /// \param recoveredMessage a pointer to the recoverable message part to be verified
+ /// \param messageAccumulator a pointer to a PK_MessageAccumulator derived class
+ /// \return the result of the verification operation
+ /// \details Recover() deletes the messageAccumulator, even if an exception is thrown.
+ /// \pre COUNTOF(recoveredMessage) == MaxRecoverableLengthFromSignatureLength(signatureLength)
virtual DecodingResult Recover(byte *recoveredMessage, PK_MessageAccumulator *messageAccumulator) const;
- //! \brief Recover a message from its signature
- //! \param recoveredMessage a pointer to the recoverable message part to be verified
- //! \param messageAccumulator a pointer to a PK_MessageAccumulator derived class
- //! \return the result of the verification operation
- //! \details RecoverAndRestart() restarts the messageAccumulator
- //! \pre COUNTOF(recoveredMessage) == MaxRecoverableLengthFromSignatureLength(signatureLength)
+ /// \brief Recover a message from its signature
+ /// \param recoveredMessage a pointer to the recoverable message part to be verified
+ /// \param messageAccumulator a pointer to a PK_MessageAccumulator derived class
+ /// \return the result of the verification operation
+ /// \details RecoverAndRestart() restarts the messageAccumulator
+ /// \pre COUNTOF(recoveredMessage) == MaxRecoverableLengthFromSignatureLength(signatureLength)
virtual DecodingResult RecoverAndRestart(byte *recoveredMessage, PK_MessageAccumulator &messageAccumulator) const =0;
- //! \brief Recover a message from its signature
- //! \param recoveredMessage a pointer for the recovered message
- //! \param nonrecoverableMessage a pointer to the non-recoverable message part to be signed
- //! \param nonrecoverableMessageLength the size of the non-recoverable message part
- //! \param signature the signature on the message
- //! \param signatureLength the size of the signature
- //! \return the result of the verification operation
- //! \pre COUNTOF(recoveredMessage) == MaxRecoverableLengthFromSignatureLength(signatureLength)
+ /// \brief Recover a message from its signature
+ /// \param recoveredMessage a pointer for the recovered message
+ /// \param nonrecoverableMessage a pointer to the non-recoverable message part to be signed
+ /// \param nonrecoverableMessageLength the size of the non-recoverable message part
+ /// \param signature the signature on the message
+ /// \param signatureLength the size of the signature
+ /// \return the result of the verification operation
+ /// \pre COUNTOF(recoveredMessage) == MaxRecoverableLengthFromSignatureLength(signatureLength)
virtual DecodingResult RecoverMessage(byte *recoveredMessage,
const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength,
const byte *signature, size_t signatureLength) const;
};
-//! \class SimpleKeyAgreementDomain
-//! \brief Interface for domains of simple key agreement protocols
-//! \details A key agreement domain is a set of parameters that must be shared
-//! by two parties in a key agreement protocol, along with the algorithms
-//! for generating key pairs and deriving agreed values.
+/// \class SimpleKeyAgreementDomain
+/// \brief Interface for domains of simple key agreement protocols
+/// \details A key agreement domain is a set of parameters that must be shared
+/// by two parties in a key agreement protocol, along with the algorithms
+/// for generating key pairs and deriving agreed values.
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE SimpleKeyAgreementDomain : public KeyAgreementAlgorithm
{
public:
virtual ~SimpleKeyAgreementDomain() {}
- //! \brief Provides the size of the agreed value
- //! \return size of agreed value produced in this domain
+ /// \brief Provides the size of the agreed value
+ /// \return size of agreed value produced in this domain
virtual unsigned int AgreedValueLength() const =0;
- //! \brief Provides the size of the private key
- //! \return size of private keys in this domain
+ /// \brief Provides the size of the private key
+ /// \return size of private keys in this domain
virtual unsigned int PrivateKeyLength() const =0;
- //! \brief Provides the size of the public key
- //! \return size of public keys in this domain
+ /// \brief Provides the size of the public key
+ /// \return size of public keys in this domain
virtual unsigned int PublicKeyLength() const =0;
- //! \brief Generate private key in this domain
- //! \param rng a RandomNumberGenerator derived class
- //! \param privateKey a byte buffer for the generated private key in this domain
- //! \pre COUNTOF(privateKey) == PrivateKeyLength()
+ /// \brief Generate private key in this domain
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param privateKey a byte buffer for the generated private key in this domain
+ /// \pre COUNTOF(privateKey) == PrivateKeyLength()
virtual void GeneratePrivateKey(RandomNumberGenerator &rng, byte *privateKey) const =0;
- //! \brief Generate a public key from a private key in this domain
- //! \param rng a RandomNumberGenerator derived class
- //! \param privateKey a byte buffer with the previously generated private key
- //! \param publicKey a byte buffer for the generated public key in this domain
- //! \pre COUNTOF(publicKey) == PublicKeyLength()
+ /// \brief Generate a public key from a private key in this domain
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param privateKey a byte buffer with the previously generated private key
+ /// \param publicKey a byte buffer for the generated public key in this domain
+ /// \pre COUNTOF(publicKey) == PublicKeyLength()
virtual void GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const =0;
- //! \brief Generate a private/public key pair
- //! \param rng a RandomNumberGenerator derived class
- //! \param privateKey a byte buffer for the generated private key in this domain
- //! \param publicKey a byte buffer for the generated public key in this domain
- //! \details GenerateKeyPair() is equivalent to calling GeneratePrivateKey() and then GeneratePublicKey().
- //! \pre COUNTOF(privateKey) == PrivateKeyLength()
- //! \pre COUNTOF(publicKey) == PublicKeyLength()
+ /// \brief Generate a private/public key pair
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param privateKey a byte buffer for the generated private key in this domain
+ /// \param publicKey a byte buffer for the generated public key in this domain
+ /// \details GenerateKeyPair() is equivalent to calling GeneratePrivateKey() and then GeneratePublicKey().
+ /// \pre COUNTOF(privateKey) == PrivateKeyLength()
+ /// \pre COUNTOF(publicKey) == PublicKeyLength()
virtual void GenerateKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const;
- //! \brief Derive agreed value
- //! \param agreedValue a byte buffer for the shared secret
- //! \param privateKey a byte buffer with your private key in this domain
- //! \param otherPublicKey a byte buffer with the other party's public key in this domain
- //! \param validateOtherPublicKey a flag indicating if the other party's public key should be validated
- //! \return true upon success, false in case of failure
- //! \details Agree() derives an agreed value from your private keys and couterparty's public keys.
- //! \details The other party's public key is validated by default. If you have previously validated the
- //! static public key, use validateStaticOtherPublicKey=false to save time.
- //! \pre COUNTOF(agreedValue) == AgreedValueLength()
- //! \pre COUNTOF(privateKey) == PrivateKeyLength()
- //! \pre COUNTOF(otherPublicKey) == PublicKeyLength()
+ /// \brief Derive agreed value
+ /// \param agreedValue a byte buffer for the shared secret
+ /// \param privateKey a byte buffer with your private key in this domain
+ /// \param otherPublicKey a byte buffer with the other party's public key in this domain
+ /// \param validateOtherPublicKey a flag indicating if the other party's public key should be validated
+ /// \return true upon success, false in case of failure
+ /// \details Agree() derives an agreed value from your private keys and couterparty's public keys.
+ /// \details The other party's public key is validated by default. If you have previously validated the
+ /// static public key, use validateStaticOtherPublicKey=false to save time.
+ /// \pre COUNTOF(agreedValue) == AgreedValueLength()
+ /// \pre COUNTOF(privateKey) == PrivateKeyLength()
+ /// \pre COUNTOF(otherPublicKey) == PublicKeyLength()
virtual bool Agree(byte *agreedValue, const byte *privateKey, const byte *otherPublicKey, bool validateOtherPublicKey=true) const =0;
};
-//! \brief Interface for domains of authenticated key agreement protocols
-//! \details In an authenticated key agreement protocol, each party has two
-//! key pairs. The long-lived key pair is called the static key pair,
-//! and the short-lived key pair is called the ephemeral key pair.
+/// \brief Interface for domains of authenticated key agreement protocols
+/// \details In an authenticated key agreement protocol, each party has two
+/// key pairs. The long-lived key pair is called the static key pair,
+/// and the short-lived key pair is called the ephemeral key pair.
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedKeyAgreementDomain : public KeyAgreementAlgorithm
{
public:
virtual ~AuthenticatedKeyAgreementDomain() {}
- //! \brief Provides the size of the agreed value
- //! \return size of agreed value produced in this domain
+ /// \brief Provides the size of the agreed value
+ /// \return size of agreed value produced in this domain
virtual unsigned int AgreedValueLength() const =0;
- //! \brief Provides the size of the static private key
- //! \return size of static private keys in this domain
+ /// \brief Provides the size of the static private key
+ /// \return size of static private keys in this domain
virtual unsigned int StaticPrivateKeyLength() const =0;
- //! \brief Provides the size of the static public key
- //! \return size of static public keys in this domain
+ /// \brief Provides the size of the static public key
+ /// \return size of static public keys in this domain
virtual unsigned int StaticPublicKeyLength() const =0;
- //! \brief Generate static private key in this domain
- //! \param rng a RandomNumberGenerator derived class
- //! \param privateKey a byte buffer for the generated private key in this domain
- //! \pre COUNTOF(privateKey) == PrivateStaticKeyLength()
+ /// \brief Generate static private key in this domain
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param privateKey a byte buffer for the generated private key in this domain
+ /// \pre COUNTOF(privateKey) == PrivateStaticKeyLength()
virtual void GenerateStaticPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const =0;
- //! \brief Generate a static public key from a private key in this domain
- //! \param rng a RandomNumberGenerator derived class
- //! \param privateKey a byte buffer with the previously generated private key
- //! \param publicKey a byte buffer for the generated public key in this domain
- //! \pre COUNTOF(publicKey) == PublicStaticKeyLength()
+ /// \brief Generate a static public key from a private key in this domain
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param privateKey a byte buffer with the previously generated private key
+ /// \param publicKey a byte buffer for the generated public key in this domain
+ /// \pre COUNTOF(publicKey) == PublicStaticKeyLength()
virtual void GenerateStaticPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const =0;
- //! \brief Generate a static private/public key pair
- //! \param rng a RandomNumberGenerator derived class
- //! \param privateKey a byte buffer for the generated private key in this domain
- //! \param publicKey a byte buffer for the generated public key in this domain
- //! \details GenerateStaticKeyPair() is equivalent to calling GenerateStaticPrivateKey() and then GenerateStaticPublicKey().
- //! \pre COUNTOF(privateKey) == PrivateStaticKeyLength()
- //! \pre COUNTOF(publicKey) == PublicStaticKeyLength()
+ /// \brief Generate a static private/public key pair
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param privateKey a byte buffer for the generated private key in this domain
+ /// \param publicKey a byte buffer for the generated public key in this domain
+ /// \details GenerateStaticKeyPair() is equivalent to calling GenerateStaticPrivateKey() and then GenerateStaticPublicKey().
+ /// \pre COUNTOF(privateKey) == PrivateStaticKeyLength()
+ /// \pre COUNTOF(publicKey) == PublicStaticKeyLength()
virtual void GenerateStaticKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const;
- //! \brief Provides the size of ephemeral private key
- //! \return the size of ephemeral private key in this domain
+ /// \brief Provides the size of ephemeral private key
+ /// \return the size of ephemeral private key in this domain
virtual unsigned int EphemeralPrivateKeyLength() const =0;
- //! \brief Provides the size of ephemeral public key
- //! \return the size of ephemeral public key in this domain
+ /// \brief Provides the size of ephemeral public key
+ /// \return the size of ephemeral public key in this domain
virtual unsigned int EphemeralPublicKeyLength() const =0;
- //! \brief Generate ephemeral private key
- //! \param rng a RandomNumberGenerator derived class
- //! \param privateKey a byte buffer for the generated private key in this domain
- //! \pre COUNTOF(privateKey) == PrivateEphemeralKeyLength()
+ /// \brief Generate ephemeral private key
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param privateKey a byte buffer for the generated private key in this domain
+ /// \pre COUNTOF(privateKey) == PrivateEphemeralKeyLength()
virtual void GenerateEphemeralPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const =0;
- //! \brief Generate ephemeral public key
- //! \param rng a RandomNumberGenerator derived class
- //! \param privateKey a byte buffer for the generated private key in this domain
- //! \param publicKey a byte buffer for the generated public key in this domain
- //! \pre COUNTOF(publicKey) == PublicEphemeralKeyLength()
+ /// \brief Generate ephemeral public key
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param privateKey a byte buffer for the generated private key in this domain
+ /// \param publicKey a byte buffer for the generated public key in this domain
+ /// \pre COUNTOF(publicKey) == PublicEphemeralKeyLength()
virtual void GenerateEphemeralPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const =0;
- //! \brief Generate private/public key pair
- //! \param rng a RandomNumberGenerator derived class
- //! \param privateKey a byte buffer for the generated private key in this domain
- //! \param publicKey a byte buffer for the generated public key in this domain
- //! \details GenerateEphemeralKeyPair() is equivalent to calling GenerateEphemeralPrivateKey() and then GenerateEphemeralPublicKey()
+ /// \brief Generate private/public key pair
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param privateKey a byte buffer for the generated private key in this domain
+ /// \param publicKey a byte buffer for the generated public key in this domain
+ /// \details GenerateEphemeralKeyPair() is equivalent to calling GenerateEphemeralPrivateKey() and then GenerateEphemeralPublicKey()
virtual void GenerateEphemeralKeyPair(RandomNumberGenerator &rng, byte *privateKey, byte *publicKey) const;
- //! \brief Derive agreed value
- //! \param agreedValue a byte buffer for the shared secret
- //! \param staticPrivateKey a byte buffer with your static private key in this domain
- //! \param ephemeralPrivateKey a byte buffer with your ephemeral private key in this domain
- //! \param staticOtherPublicKey a byte buffer with the other party's static public key in this domain
- //! \param ephemeralOtherPublicKey a byte buffer with the other party's ephemeral public key in this domain
- //! \param validateStaticOtherPublicKey a flag indicating if the other party's public key should be validated
- //! \return true upon success, false in case of failure
- //! \details Agree() derives an agreed value from your private keys and couterparty's public keys.
- //! \details The other party's ephemeral public key is validated by default. If you have previously validated
- //! the static public key, use validateStaticOtherPublicKey=false to save time.
- //! \pre COUNTOF(agreedValue) == AgreedValueLength()
- //! \pre COUNTOF(staticPrivateKey) == StaticPrivateKeyLength()
- //! \pre COUNTOF(ephemeralPrivateKey) == EphemeralPrivateKeyLength()
- //! \pre COUNTOF(staticOtherPublicKey) == StaticPublicKeyLength()
- //! \pre COUNTOF(ephemeralOtherPublicKey) == EphemeralPublicKeyLength()
+ /// \brief Derive agreed value
+ /// \param agreedValue a byte buffer for the shared secret
+ /// \param staticPrivateKey a byte buffer with your static private key in this domain
+ /// \param ephemeralPrivateKey a byte buffer with your ephemeral private key in this domain
+ /// \param staticOtherPublicKey a byte buffer with the other party's static public key in this domain
+ /// \param ephemeralOtherPublicKey a byte buffer with the other party's ephemeral public key in this domain
+ /// \param validateStaticOtherPublicKey a flag indicating if the other party's public key should be validated
+ /// \return true upon success, false in case of failure
+ /// \details Agree() derives an agreed value from your private keys and couterparty's public keys.
+ /// \details The other party's ephemeral public key is validated by default. If you have previously validated
+ /// the static public key, use validateStaticOtherPublicKey=false to save time.
+ /// \pre COUNTOF(agreedValue) == AgreedValueLength()
+ /// \pre COUNTOF(staticPrivateKey) == StaticPrivateKeyLength()
+ /// \pre COUNTOF(ephemeralPrivateKey) == EphemeralPrivateKeyLength()
+ /// \pre COUNTOF(staticOtherPublicKey) == StaticPublicKeyLength()
+ /// \pre COUNTOF(ephemeralOtherPublicKey) == EphemeralPublicKeyLength()
virtual bool Agree(byte *agreedValue,
const byte *staticPrivateKey, const byte *ephemeralPrivateKey,
const byte *staticOtherPublicKey, const byte *ephemeralOtherPublicKey,
@@ -2924,7 +2924,7 @@ public:
// interface for password authenticated key agreement protocols, not implemented yet
#if 0
-//! \brief Interface for protocol sessions
+/// \brief Interface for protocol sessions
/*! The methods should be called in the following order:
InitializeSession(rng, parameters); // or call initialize method in derived class
@@ -2948,14 +2948,14 @@ public:
class ProtocolSession
{
public:
- //! Exception thrown when an invalid protocol message is processed
+ /// Exception thrown when an invalid protocol message is processed
class ProtocolError : public Exception
{
public:
ProtocolError(ErrorType errorType, const std::string &s) : Exception(errorType, s) {}
};
- //! Exception thrown when a function is called unexpectedly
+ /// Exception thrown when a function is called unexpectedly
/*! for example calling ProcessIncomingMessage() when ProcessedLastMessage() == true */
class UnexpectedMethodCall : public Exception
{
@@ -3017,7 +3017,7 @@ class PasswordAuthenticatedKeyAgreementDomain : public KeyAgreementAlgorithm
public:
virtual ~PasswordAuthenticatedKeyAgreementDomain() {}
- //! return whether the domain parameters stored in this object are valid
+ /// return whether the domain parameters stored in this object are valid
virtual bool ValidateDomainParameters(RandomNumberGenerator &rng) const
{return GetCryptoParameters().Validate(rng, 2);}
@@ -3031,7 +3031,7 @@ public:
};
#endif
-//! \brief Exception thrown when an ASN.1 BER decoing error is encountered
+/// \brief Exception thrown when an ASN.1 BER decoing error is encountered
class CRYPTOPP_DLL BERDecodeErr : public InvalidArgument
{
public:
@@ -3039,95 +3039,95 @@ public:
BERDecodeErr(const std::string &s) : InvalidArgument(s) {}
};
-//! \brief Interface for encoding and decoding ASN1 objects
-//! \details Each class that derives from ASN1Object should provide a serialization format
-//! that controls subobject layout. Most of the time the serialization format is
-//! taken from a standard, like P1363 or an RFC.
+/// \brief Interface for encoding and decoding ASN1 objects
+/// \details Each class that derives from ASN1Object should provide a serialization format
+/// that controls subobject layout. Most of the time the serialization format is
+/// taken from a standard, like P1363 or an RFC.
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE ASN1Object
{
public:
virtual ~ASN1Object() {}
- //! \brief Decode this object from a BufferedTransformation
- //! \param bt BufferedTransformation object
- //! \details Uses Basic Encoding Rules (BER)
+ /// \brief Decode this object from a BufferedTransformation
+ /// \param bt BufferedTransformation object
+ /// \details Uses Basic Encoding Rules (BER)
virtual void BERDecode(BufferedTransformation &bt) =0;
- //! \brief Encode this object into a BufferedTransformation
- //! \param bt BufferedTransformation object
- //! \details Uses Distinguished Encoding Rules (DER)
+ /// \brief Encode this object into a BufferedTransformation
+ /// \param bt BufferedTransformation object
+ /// \details Uses Distinguished Encoding Rules (DER)
virtual void DEREncode(BufferedTransformation &bt) const =0;
- //! \brief Encode this object into a BufferedTransformation
- //! \param bt BufferedTransformation object
- //! \details Uses Basic Encoding Rules (BER).
- //! \details This may be useful if DEREncode() would be too inefficient.
+ /// \brief Encode this object into a BufferedTransformation
+ /// \param bt BufferedTransformation object
+ /// \details Uses Basic Encoding Rules (BER).
+ /// \details This may be useful if DEREncode() would be too inefficient.
virtual void BEREncode(BufferedTransformation &bt) const {DEREncode(bt);}
};
-//! \brief Specifies the build-time version of the library
-//! \returns integer representing the build-time version
-//! \details LibraryVersion can help detect inadvertent mixing and matching of library
-//! versions. When using Crypto++ distributed by a third party, LibraryVersion()
-//! records the version of the shared object that was built by the third party.
-//! The LibraryVersion() record resides in cryptlib.o on Unix compatibles
-//! and cryptlib.obj on Windows. It does not change when an app links
-//! to the library.
-//! \details LibraryVersion() is declared with C linkage (extern "C") within the
-//! CryptoPP namespace to help programs locate the symbol. If the symbol is present, then
-//! the library version is 5.7 or above. If it is missing, then the library version is
-//! 5.6.5 or below.
-//! \details The function could be used as shown below.
-//!
-//! if (LibraryVersion() != HeaderVersion())
-//! {
-//! cout << "Potential version mismatch" << endl;
-//!
-//! const int lmaj = (LibraryVersion() / 100U) % 10;
-//! const int lmin = (LibraryVersion() / 10U) % 10;
-//! const int hmaj = (HeaderVersion() / 100U) % 10;
-//! const int hmin = (HeaderVersion() / 10U) % 10;
-//!
-//! if(lmaj != hmaj)
-//! cout << "Major version mismatch" << endl;
-//! else if(lmin != hmin)
-//! cout << "Minor version mismatch" << endl;
-//! }
-//!
-//! \sa HeaderVersion(), GitHub Issue 371.
-//! \since Crypto++ 6.0
+/// \brief Specifies the build-time version of the library
+/// \returns integer representing the build-time version
+/// \details LibraryVersion can help detect inadvertent mixing and matching of library
+/// versions. When using Crypto++ distributed by a third party, LibraryVersion()
+/// records the version of the shared object that was built by the third party.
+/// The LibraryVersion() record resides in cryptlib.o on Unix compatibles
+/// and cryptlib.obj on Windows. It does not change when an app links
+/// to the library.
+/// \details LibraryVersion() is declared with C linkage (extern "C") within the
+/// CryptoPP namespace to help programs locate the symbol. If the symbol is present, then
+/// the library version is 5.7 or above. If it is missing, then the library version is
+/// 5.6.5 or below.
+/// \details The function could be used as shown below.
+///
+/// if (LibraryVersion() != HeaderVersion())
+/// {
+/// cout << "Potential version mismatch" << endl;
+///
+/// const int lmaj = (LibraryVersion() / 100U) % 10;
+/// const int lmin = (LibraryVersion() / 10U) % 10;
+/// const int hmaj = (HeaderVersion() / 100U) % 10;
+/// const int hmin = (HeaderVersion() / 10U) % 10;
+///
+/// if(lmaj != hmaj)
+/// cout << "Major version mismatch" << endl;
+/// else if(lmin != hmin)
+/// cout << "Minor version mismatch" << endl;
+/// }
+///
+/// \sa HeaderVersion(), GitHub Issue 371.
+/// \since Crypto++ 6.0
extern "C" {
int LibraryVersion(CRYPTOPP_NOINLINE_DOTDOTDOT);
} // C linkage
-//! \brief Specifies the runtime version of the library
-//! \returns integer representing the runtime version
-//! \details HeaderVersion() can help detect inadvertent mixing and matching of library
-//! versions. When using Crypto++ distributed by a third party, HeaderVersion()
-//! records the version of the headers used by the app when the app is compiled.
-//! \details HeaderVersion() is declared with C linkage (extern "C") within the
-//! CryptoPP namespace to help programs locate the symbol. If the symbol is present, then
-//! the library version is 5.7 or above. If it is missing, then the library version is
-//! 5.6.5 or below.
-//! \details The function could be used as shown below.
-//!
-//! if (LibraryVersion() != HeaderVersion())
-//! {
-//! cout << "Potential version mismatch" << endl;
-//!
-//! const int lmaj = (LibraryVersion() / 100U) % 10;
-//! const int lmin = (LibraryVersion() / 10U) % 10;
-//! const int hmaj = (HeaderVersion() / 100U) % 10;
-//! const int hmin = (HeaderVersion() / 10U) % 10;
-//!
-//! if(lmaj != hmaj)
-//! cout << "Major version mismatch" << endl;
-//! else if(lmin != hmin)
-//! cout << "Minor version mismatch" << endl;
-//! }
-//!
-//! \sa LibraryVersion(), GitHub Issue 371.
-//! \since Crypto++ 6.0
+/// \brief Specifies the runtime version of the library
+/// \returns integer representing the runtime version
+/// \details HeaderVersion() can help detect inadvertent mixing and matching of library
+/// versions. When using Crypto++ distributed by a third party, HeaderVersion()
+/// records the version of the headers used by the app when the app is compiled.
+/// \details HeaderVersion() is declared with C linkage (extern "C") within the
+/// CryptoPP namespace to help programs locate the symbol. If the symbol is present, then
+/// the library version is 5.7 or above. If it is missing, then the library version is
+/// 5.6.5 or below.
+/// \details The function could be used as shown below.
+///
+/// if (LibraryVersion() != HeaderVersion())
+/// {
+/// cout << "Potential version mismatch" << endl;
+///
+/// const int lmaj = (LibraryVersion() / 100U) % 10;
+/// const int lmin = (LibraryVersion() / 10U) % 10;
+/// const int hmaj = (HeaderVersion() / 100U) % 10;
+/// const int hmin = (HeaderVersion() / 10U) % 10;
+///
+/// if(lmaj != hmaj)
+/// cout << "Major version mismatch" << endl;
+/// else if(lmin != hmin)
+/// cout << "Minor version mismatch" << endl;
+/// }
+///
+/// \sa LibraryVersion(), GitHub Issue 371.
+/// \since Crypto++ 6.0
extern "C" {
inline int HeaderVersion()
{
diff --git a/default.h b/default.h
index 56f54c98..c6097449 100644
--- a/default.h
+++ b/default.h
@@ -1,7 +1,7 @@
// default.h - originally written and placed in the public domain by Wei Dai
-//! \file default.h
-//! \brief Classes for DefaultEncryptor, DefaultDecryptor, DefaultEncryptorWithMAC and DefaultDecryptorWithMAC
+/// \file default.h
+/// \brief Classes for DefaultEncryptor, DefaultDecryptor, DefaultEncryptorWithMAC and DefaultDecryptorWithMAC
#ifndef CRYPTOPP_DEFAULT_H
#define CRYPTOPP_DEFAULT_H
@@ -16,22 +16,22 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \brief Legacy block cipher for LegacyEncryptor, LegacyDecryptor, LegacyEncryptorWithMAC and LegacyDecryptorWithMAC
+/// \brief Legacy block cipher for LegacyEncryptor, LegacyDecryptor, LegacyEncryptorWithMAC and LegacyDecryptorWithMAC
typedef DES_EDE2 LegacyBlockCipher;
-//! \brief Legacy hash for use with LegacyEncryptorWithMAC and LegacyDecryptorWithMAC
+/// \brief Legacy hash for use with LegacyEncryptorWithMAC and LegacyDecryptorWithMAC
typedef SHA1 LegacyHashModule;
-//! \brief Legacy HMAC for use withLegacyEncryptorWithMAC and LegacyDecryptorWithMAC
+/// \brief Legacy HMAC for use withLegacyEncryptorWithMAC and LegacyDecryptorWithMAC
typedef HMAC LegacyMAC;
-//! \brief Default block cipher for DefaultEncryptor, DefaultDecryptor, DefaultEncryptorWithMAC and DefaultDecryptorWithMAC
+/// \brief Default block cipher for DefaultEncryptor, DefaultDecryptor, DefaultEncryptorWithMAC and DefaultDecryptorWithMAC
typedef AES DefaultBlockCipher;
-//! \brief Default hash for use with DefaultEncryptorWithMAC and DefaultDecryptorWithMAC
+/// \brief Default hash for use with DefaultEncryptorWithMAC and DefaultDecryptorWithMAC
typedef SHA256 DefaultHashModule;
-//! \brief Default HMAC for use withDefaultEncryptorWithMAC and DefaultDecryptorWithMAC
+/// \brief Default HMAC for use withDefaultEncryptorWithMAC and DefaultDecryptorWithMAC
typedef HMAC DefaultMAC;
-//! \class DataDecryptorErr
-//! \brief Exception thrown when LegacyDecryptorWithMAC or DefaultDecryptorWithMAC decryption error is encountered
+/// \class DataDecryptorErr
+/// \brief Exception thrown when LegacyDecryptorWithMAC or DefaultDecryptorWithMAC decryption error is encountered
class DataDecryptorErr : public Exception
{
public:
@@ -39,24 +39,24 @@ public:
: Exception(DATA_INTEGRITY_CHECK_FAILED, s) {}
};
-//! \class KeyBadErr
-//! \brief Exception thrown when a bad key is encountered in DefaultDecryptorWithMAC and LegacyDecryptorWithMAC
+/// \class KeyBadErr
+/// \brief Exception thrown when a bad key is encountered in DefaultDecryptorWithMAC and LegacyDecryptorWithMAC
class KeyBadErr : public DataDecryptorErr
{
public: KeyBadErr()
: DataDecryptorErr("DataDecryptor: cannot decrypt message with this passphrase") {}
};
-//! \class MACBadErr
-//! \brief Exception thrown when an incorrect MAC is encountered in DefaultDecryptorWithMAC and LegacyDecryptorWithMAC
+/// \class MACBadErr
+/// \brief Exception thrown when an incorrect MAC is encountered in DefaultDecryptorWithMAC and LegacyDecryptorWithMAC
class MACBadErr : public DataDecryptorErr
{
public: MACBadErr()
: DataDecryptorErr("DataDecryptorWithMAC: MAC check failed") {}
};
-//! \class DataParametersInfo
-//! \brief Algorithm information for password-based encryptors and decryptors
+/// \class DataParametersInfo
+/// \brief Algorithm information for password-based encryptors and decryptors
template
struct DataParametersInfo
{
@@ -70,15 +70,15 @@ struct DataParametersInfo
typedef DataParametersInfo LegacyParametersInfo;
typedef DataParametersInfo DefaultParametersInfo;
-//! \class DataEncryptor
-//! \brief Password-based Encryptor
-//! \tparam BC BlockCipher based class used for encryption
-//! \tparam H HashTransformation based class used for mashing
-//! \tparam Info Constants used by the algorithms
-//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
-//! Crypto++ 5.7 switched to AES and SHA256.
-//! \sa DefaultEncryptor, DefaultDecryptor, LegacyEncryptor, LegacyDecryptor
-//! \since Crypto++ 2.0
+/// \class DataEncryptor
+/// \brief Password-based Encryptor
+/// \tparam BC BlockCipher based class used for encryption
+/// \tparam H HashTransformation based class used for mashing
+/// \tparam Info Constants used by the algorithms
+/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
+/// Crypto++ 5.7 switched to AES and SHA256.
+/// \sa DefaultEncryptor, DefaultDecryptor, LegacyEncryptor, LegacyDecryptor
+/// \since Crypto++ 2.0
template
class DataEncryptor : public ProxyFilter, public Info
{
@@ -89,15 +89,15 @@ public:
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE)
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS)
- //! \brief Construct a DataEncryptor
- //! \param passphrase a C-String password
- //! \param attachment a BufferedTransformation to attach to this object
+ /// \brief Construct a DataEncryptor
+ /// \param passphrase a C-String password
+ /// \param attachment a BufferedTransformation to attach to this object
DataEncryptor(const char *passphrase, BufferedTransformation *attachment = NULLPTR);
- //! \brief Construct a DataEncryptor
- //! \param passphrase a byte string password
- //! \param passphraseLength the length of the byte string password
- //! \param attachment a BufferedTransformation to attach to this object
+ /// \brief Construct a DataEncryptor
+ /// \param passphrase a byte string password
+ /// \param passphraseLength the length of the byte string password
+ /// \param attachment a BufferedTransformation to attach to this object
DataEncryptor(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULLPTR);
protected:
@@ -109,15 +109,15 @@ private:
typename CBC_Mode::Encryption m_cipher;
};
-//! \class DataDecryptor
-//! \brief Password-based Decryptor
-//! \tparam BC BlockCipher based class used for encryption
-//! \tparam H HashTransformation based class used for mashing
-//! \tparam Info Constants used by the algorithms
-//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
-//! Crypto++ 5.7 switched to AES and SHA256.
-//! \sa DefaultEncryptor, DefaultDecryptor, LegacyEncryptor, LegacyDecryptor
-//! \since Crypto++ 2.0
+/// \class DataDecryptor
+/// \brief Password-based Decryptor
+/// \tparam BC BlockCipher based class used for encryption
+/// \tparam H HashTransformation based class used for mashing
+/// \tparam Info Constants used by the algorithms
+/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
+/// Crypto++ 5.7 switched to AES and SHA256.
+/// \sa DefaultEncryptor, DefaultDecryptor, LegacyEncryptor, LegacyDecryptor
+/// \since Crypto++ 2.0
template
class DataDecryptor : public ProxyFilter, public Info
{
@@ -128,17 +128,17 @@ public:
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE)
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS)
- //! \brief Constructs a DataDecryptor
- //! \param passphrase a C-String password
- //! \param attachment a BufferedTransformation to attach to this object
- //! \param throwException a flag specifiying whether an Exception should be thrown on error
+ /// \brief Constructs a DataDecryptor
+ /// \param passphrase a C-String password
+ /// \param attachment a BufferedTransformation to attach to this object
+ /// \param throwException a flag specifiying whether an Exception should be thrown on error
DataDecryptor(const char *passphrase, BufferedTransformation *attachment = NULLPTR, bool throwException=true);
- //! \brief Constructs a DataDecryptor
- //! \param passphrase a byte string password
- //! \param passphraseLength the length of the byte string password
- //! \param attachment a BufferedTransformation to attach to this object
- //! \param throwException a flag specifiying whether an Exception should be thrown on error
+ /// \brief Constructs a DataDecryptor
+ /// \param passphrase a byte string password
+ /// \param passphraseLength the length of the byte string password
+ /// \param attachment a BufferedTransformation to attach to this object
+ /// \param throwException a flag specifiying whether an Exception should be thrown on error
DataDecryptor(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULLPTR, bool throwException=true);
enum State {WAITING_FOR_KEYCHECK, KEY_GOOD, KEY_BAD};
@@ -160,22 +160,22 @@ private:
};
-//! \class DataEncryptorWithMAC
-//! \brief Password-based encryptor with MAC
-//! \tparam BC BlockCipher based class used for encryption
-//! \tparam H HashTransformation based class used for mashing
-//! \tparam MAC HashTransformation based class used for authentication
-//! \tparam Info Constants used by the algorithms
-//! \details DataEncryptorWithMAC uses a non-standard mashup function called Mash() to derive key
-//! bits from the password.
-//! \details The purpose of the function Mash() is to take an arbitrary length input string and
-//! *deterministically* produce an arbitrary length output string such that (1) it looks random,
-//! (2) no information about the input is deducible from it, and (3) it contains as much entropy
-//! as it can hold, or the amount of entropy in the input string, whichever is smaller.
-//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
-//! Crypto++ 5.7 switched to AES and SHA256.
-//! \sa DefaultEncryptorWithMAC, DefaultDecryptorWithMAC, LegacyDecryptorWithMAC, LegacyEncryptorWithMAC
-//! \since Crypto++ 2.0
+/// \class DataEncryptorWithMAC
+/// \brief Password-based encryptor with MAC
+/// \tparam BC BlockCipher based class used for encryption
+/// \tparam H HashTransformation based class used for mashing
+/// \tparam MAC HashTransformation based class used for authentication
+/// \tparam Info Constants used by the algorithms
+/// \details DataEncryptorWithMAC uses a non-standard mashup function called Mash() to derive key
+/// bits from the password.
+/// \details The purpose of the function Mash() is to take an arbitrary length input string and
+/// *deterministically* produce an arbitrary length output string such that (1) it looks random,
+/// (2) no information about the input is deducible from it, and (3) it contains as much entropy
+/// as it can hold, or the amount of entropy in the input string, whichever is smaller.
+/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
+/// Crypto++ 5.7 switched to AES and SHA256.
+/// \sa DefaultEncryptorWithMAC, DefaultDecryptorWithMAC, LegacyDecryptorWithMAC, LegacyEncryptorWithMAC
+/// \since Crypto++ 2.0
template
class DataEncryptorWithMAC : public ProxyFilter
{
@@ -186,15 +186,15 @@ public:
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE)
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS)
- //! \brief Constructs a DataEncryptorWithMAC
- //! \param passphrase a C-String password
- //! \param attachment a BufferedTransformation to attach to this object
+ /// \brief Constructs a DataEncryptorWithMAC
+ /// \param passphrase a C-String password
+ /// \param attachment a BufferedTransformation to attach to this object
DataEncryptorWithMAC(const char *passphrase, BufferedTransformation *attachment = NULLPTR);
- //! \brief Constructs a DataEncryptorWithMAC
- //! \param passphrase a byte string password
- //! \param passphraseLength the length of the byte string password
- //! \param attachment a BufferedTransformation to attach to this object
+ /// \brief Constructs a DataEncryptorWithMAC
+ /// \param passphrase a byte string password
+ /// \param passphraseLength the length of the byte string password
+ /// \param attachment a BufferedTransformation to attach to this object
DataEncryptorWithMAC(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULLPTR);
protected:
@@ -206,22 +206,22 @@ private:
};
-//! \class DataDecryptorWithMAC
-//! \brief Password-based decryptor with MAC
-//! \tparam BC BlockCipher based class used for encryption
-//! \tparam H HashTransformation based class used for mashing
-//! \tparam MAC HashTransformation based class used for authentication
-//! \tparam Info Constants used by the algorithms
-//! \details DataDecryptorWithMAC uses a non-standard mashup function called Mash() to derive key
-//! bits from the password.
-//! \details The purpose of the function Mash() is to take an arbitrary length input string and
-//! *deterministically* produce an arbitrary length output string such that (1) it looks random,
-//! (2) no information about the input is deducible from it, and (3) it contains as much entropy
-//! as it can hold, or the amount of entropy in the input string, whichever is smaller.
-//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
-//! Crypto++ 5.7 switched to AES and SHA256.
-//! \sa DefaultEncryptorWithMAC, DefaultDecryptorWithMAC, LegacyDecryptorWithMAC, LegacyEncryptorWithMAC
-//! \since Crypto++ 2.0
+/// \class DataDecryptorWithMAC
+/// \brief Password-based decryptor with MAC
+/// \tparam BC BlockCipher based class used for encryption
+/// \tparam H HashTransformation based class used for mashing
+/// \tparam MAC HashTransformation based class used for authentication
+/// \tparam Info Constants used by the algorithms
+/// \details DataDecryptorWithMAC uses a non-standard mashup function called Mash() to derive key
+/// bits from the password.
+/// \details The purpose of the function Mash() is to take an arbitrary length input string and
+/// *deterministically* produce an arbitrary length output string such that (1) it looks random,
+/// (2) no information about the input is deducible from it, and (3) it contains as much entropy
+/// as it can hold, or the amount of entropy in the input string, whichever is smaller.
+/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
+/// Crypto++ 5.7 switched to AES and SHA256.
+/// \sa DefaultEncryptorWithMAC, DefaultDecryptorWithMAC, LegacyDecryptorWithMAC, LegacyEncryptorWithMAC
+/// \since Crypto++ 2.0
template
class DataDecryptorWithMAC : public ProxyFilter
{
@@ -232,17 +232,17 @@ public:
CRYPTOPP_CONSTANT(DIGESTSIZE = Info::DIGESTSIZE)
CRYPTOPP_CONSTANT(ITERATIONS = Info::ITERATIONS)
- //! \brief Constructs a DataDecryptor
- //! \param passphrase a C-String password
- //! \param attachment a BufferedTransformation to attach to this object
- //! \param throwException a flag specifiying whether an Exception should be thrown on error
+ /// \brief Constructs a DataDecryptor
+ /// \param passphrase a C-String password
+ /// \param attachment a BufferedTransformation to attach to this object
+ /// \param throwException a flag specifiying whether an Exception should be thrown on error
DataDecryptorWithMAC(const char *passphrase, BufferedTransformation *attachment = NULLPTR, bool throwException=true);
- //! \brief Constructs a DataDecryptor
- //! \param passphrase a byte string password
- //! \param passphraseLength the length of the byte string password
- //! \param attachment a BufferedTransformation to attach to this object
- //! \param throwException a flag specifiying whether an Exception should be thrown on error
+ /// \brief Constructs a DataDecryptor
+ /// \param passphrase a byte string password
+ /// \param passphraseLength the length of the byte string password
+ /// \param attachment a BufferedTransformation to attach to this object
+ /// \param throwException a flag specifiying whether an Exception should be thrown on error
DataDecryptorWithMAC(const byte *passphrase, size_t passphraseLength, BufferedTransformation *attachment = NULLPTR, bool throwException=true);
typename DataDecryptor::State CurrentState() const;
@@ -259,53 +259,53 @@ private:
};
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
-//! \class LegacyEncryptor
-//! \brief Password-based encryptor (deprecated)
-//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
-//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
-//! Default* classes, and the old algorithms are available with the Legacy* classes.
+/// \class LegacyEncryptor
+/// \brief Password-based encryptor (deprecated)
+/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
+/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
+/// Default* classes, and the old algorithms are available with the Legacy* classes.
struct LegacyEncryptor : public DataEncryptor {};
-//! \class LegacyDecryptor
-//! \brief Password-based decryptor (deprecated)
-//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
-//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
-//! Default* classes, and the old algorithms are available with the Legacy* classes.
+/// \class LegacyDecryptor
+/// \brief Password-based decryptor (deprecated)
+/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
+/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
+/// Default* classes, and the old algorithms are available with the Legacy* classes.
struct LegacyDecryptor : public DataDecryptor {};
-//! \class DefaultEncryptor
-//! \brief Password-based encryptor
-//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
-//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
-//! Default* classes, and the old algorithms are available with the Legacy* classes.
+/// \class DefaultEncryptor
+/// \brief Password-based encryptor
+/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
+/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
+/// Default* classes, and the old algorithms are available with the Legacy* classes.
struct DefaultEncryptor : public DataEncryptor {};
-//! \class DefaultDecryptor
-//! \brief Password-based decryptor
-//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
-//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
-//! Default* classes, and the old algorithms are available with the Legacy* classes.
+/// \class DefaultDecryptor
+/// \brief Password-based decryptor
+/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
+/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
+/// Default* classes, and the old algorithms are available with the Legacy* classes.
struct DefaultDecryptor : public DataDecryptor {};
-//! \class LegacyEncryptorWithMAC
-//! \brief Password-based encryptor with MAC (deprecated)
-//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
-//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
-//! Default* classes, and the old algorithms are available with the Legacy* classes.
+/// \class LegacyEncryptorWithMAC
+/// \brief Password-based encryptor with MAC (deprecated)
+/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
+/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
+/// Default* classes, and the old algorithms are available with the Legacy* classes.
struct LegacyEncryptorWithMAC : public DataEncryptorWithMAC {};
-//! \class LegacyDecryptorWithMAC
-//! \brief Password-based decryptor with MAC (deprecated)
-//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
-//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
-//! Default* classes, and the old algorithms are available with the Legacy* classes.
+/// \class LegacyDecryptorWithMAC
+/// \brief Password-based decryptor with MAC (deprecated)
+/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
+/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
+/// Default* classes, and the old algorithms are available with the Legacy* classes.
struct LegacyDecryptorWithMAC : public DataDecryptorWithMAC {};
-//! \class DefaultEncryptorWithMAC
-//! \brief Password-based encryptor with MAC
-//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
-//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
-//! Default* classes, and the old algorithms are available with the Legacy* classes.
+/// \class DefaultEncryptorWithMAC
+/// \brief Password-based encryptor with MAC
+/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
+/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
+/// Default* classes, and the old algorithms are available with the Legacy* classes.
struct DefaultEncryptorWithMAC : public DataEncryptorWithMAC {};
-//! \class DefaultDecryptorWithMAC
-//! \brief Password-based decryptor with MAC
-//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
-//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
-//! Default* classes, and the old algorithms are available with the Legacy* classes.
+/// \class DefaultDecryptorWithMAC
+/// \brief Password-based decryptor with MAC
+/// \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1.
+/// Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the
+/// Default* classes, and the old algorithms are available with the Legacy* classes.
struct DefaultDecryptorWithMAC : public DataDecryptorWithMAC {};
#else
typedef DataEncryptor LegacyEncryptor;
diff --git a/des.h b/des.h
index e526ede5..e4171988 100644
--- a/des.h
+++ b/des.h
@@ -1,7 +1,7 @@
// des.h - originally written and placed in the public domain by Wei Dai
-//! \file des.h
-//! \brief Classes for DES, 2-key Triple-DES, 3-key Triple-DES and DESX
+/// \file des.h
+/// \brief Classes for DES, 2-key Triple-DES, 3-key Triple-DES and DESX
#ifndef CRYPTOPP_DES_H
#define CRYPTOPP_DES_H
@@ -11,8 +11,8 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class RawDES
-//! \brief DES block cipher base class
+/// \class RawDES
+/// \brief DES block cipher base class
class CRYPTOPP_DLL RawDES
{
public:
@@ -25,25 +25,25 @@ protected:
FixedSizeSecBlock k;
};
-//! \class DES_Info
-//! \brief DES block cipher information
+/// \class DES_Info
+/// \brief DES block cipher information
struct DES_Info : public FixedBlockSize<8>, public FixedKeyLength<8>
{
// disable DES in DLL version by not exporting this function
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "DES";}
};
-//! \class DES
-//! \brief DES block cipher
-//! \details The DES implementation in Crypto++ ignores the parity bits
-//! (the least significant bits of each byte) in the key. However you can use CheckKeyParityBits()
-//! and CorrectKeyParityBits() to check or correct the parity bits if you wish.
-//! \sa DES
-//! \since Crypto++ 1.0
+/// \class DES
+/// \brief DES block cipher
+/// \details The DES implementation in Crypto++ ignores the parity bits
+/// (the least significant bits of each byte) in the key. However you can use CheckKeyParityBits()
+/// and CorrectKeyParityBits() to check or correct the parity bits if you wish.
+/// \sa DES
+/// \since Crypto++ 1.0
class DES : public DES_Info, public BlockCipherDocumentation
{
- //! \class Base
- //! \brief DES block cipher default operation
+ /// \class Base
+ /// \brief DES block cipher default operation
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl, public RawDES
{
public:
@@ -52,30 +52,30 @@ class DES : public DES_Info, public BlockCipherDocumentation
};
public:
- //! check DES key parity bits
+ /// check DES key parity bits
static bool CheckKeyParityBits(const byte *key);
- //! correct DES key parity bits
+ /// correct DES key parity bits
static void CorrectKeyParityBits(byte *key);
typedef BlockCipherFinal Encryption;
typedef BlockCipherFinal Decryption;
};
-//! \class DES_EDE2_Info
-//! \brief 2-key TripleDES block cipher information
+/// \class DES_EDE2_Info
+/// \brief 2-key TripleDES block cipher information
struct DES_EDE2_Info : public FixedBlockSize<8>, public FixedKeyLength<16>
{
CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "DES-EDE2";}
};
-//! \class DES_EDE2
-//! \brief 2-key TripleDES block cipher
-//! \sa DES-EDE2
-//! \since Crypto++ 1.0
+/// \class DES_EDE2
+/// \brief 2-key TripleDES block cipher
+/// \sa DES-EDE2
+/// \since Crypto++ 1.0
class DES_EDE2 : public DES_EDE2_Info, public BlockCipherDocumentation
{
- //! \class Base
- //! \brief DES_EDE2 block cipher default operation
+ /// \class Base
+ /// \brief DES_EDE2 block cipher default operation
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl
{
public:
@@ -91,21 +91,21 @@ public:
typedef BlockCipherFinal Decryption;
};
-//! \class DES_EDE3_Info
-//! \brief 3-key TripleDES block cipher information
+/// \class DES_EDE3_Info
+/// \brief 3-key TripleDES block cipher information
struct DES_EDE3_Info : public FixedBlockSize<8>, public FixedKeyLength<24>
{
CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return "DES-EDE3";}
};
-//! \class DES_EDE3
-//! \brief 3-key TripleDES block cipher
-//! \sa DES-EDE3
-//! \since Crypto++ 1.0
+/// \class DES_EDE3
+/// \brief 3-key TripleDES block cipher
+/// \sa DES-EDE3
+/// \since Crypto++ 1.0
class DES_EDE3 : public DES_EDE3_Info, public BlockCipherDocumentation
{
- //! \class Base
- //! \brief DES_EDE3 block cipher default operation
+ /// \class Base
+ /// \brief DES_EDE3 block cipher default operation
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl
{
public:
@@ -121,21 +121,21 @@ public:
typedef BlockCipherFinal Decryption;
};
-//! \class DES_XEX3_Info
-//! \brief DESX block cipher information
+/// \class DES_XEX3_Info
+/// \brief DESX block cipher information
struct DES_XEX3_Info : public FixedBlockSize<8>, public FixedKeyLength<24>
{
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "DES-XEX3";}
};
-//! \class DES_XEX3
-//! \brief DESX block cipher
-//! \sa DES-XEX3, AKA DESX
-//! \since Crypto++ 1.0
+/// \class DES_XEX3
+/// \brief DESX block cipher
+/// \sa DES-XEX3, AKA DESX
+/// \since Crypto++ 1.0
class DES_XEX3 : public DES_XEX3_Info, public BlockCipherDocumentation
{
- //! \class Base
- //! \brief DES_XEX3 block cipher default operation
+ /// \class Base
+ /// \brief DES_XEX3 block cipher default operation
class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl
{
public:
diff --git a/dh.h b/dh.h
index 3d3dba12..e54cf0ea 100644
--- a/dh.h
+++ b/dh.h
@@ -1,7 +1,7 @@
// dh.h - originally written and placed in the public domain by Wei Dai
-//! \file dh.h
-//! \brief Classes for Diffie-Hellman key exchange
+/// \file dh.h
+/// \brief Classes for Diffie-Hellman key exchange
#ifndef CRYPTOPP_DH_H
#define CRYPTOPP_DH_H
@@ -12,16 +12,16 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class DH_Domain
-//! \brief Diffie-Hellman domain
-//! \tparam GROUP_PARAMETERS group parameters
-//! \tparam COFACTOR_OPTION cofactor multiplication option
-//! \details A Diffie-Hellman domain is a set of parameters that must be shared
-//! by two parties in a key agreement protocol, along with the algorithms
-//! for generating key pairs and deriving agreed values.
-//! \details For COFACTOR_OPTION, see CofactorMultiplicationOption.
-//! \sa DL_SimpleKeyAgreementDomainBase
-//! \since Crypto++ 1.0
+/// \class DH_Domain
+/// \brief Diffie-Hellman domain
+/// \tparam GROUP_PARAMETERS group parameters
+/// \tparam COFACTOR_OPTION cofactor multiplication option
+/// \details A Diffie-Hellman domain is a set of parameters that must be shared
+/// by two parties in a key agreement protocol, along with the algorithms
+/// for generating key pairs and deriving agreed values.
+/// \details For COFACTOR_OPTION, see CofactorMultiplicationOption.
+/// \sa DL_SimpleKeyAgreementDomainBase
+/// \since Crypto++ 1.0
template
class DH_Domain : public DL_SimpleKeyAgreementDomainBase
{
@@ -35,104 +35,104 @@ public:
virtual ~DH_Domain() {}
- //! \brief Construct a Diffie-Hellman domain
+ /// \brief Construct a Diffie-Hellman domain
DH_Domain() {}
- //! \brief Construct a Diffie-Hellman domain
- //! \param params group parameters and options
+ /// \brief Construct a Diffie-Hellman domain
+ /// \param params group parameters and options
DH_Domain(const GroupParameters ¶ms)
: m_groupParameters(params) {}
- //! \brief Construct a Diffie-Hellman domain
- //! \param bt BufferedTransformation with group parameters and options
+ /// \brief Construct a Diffie-Hellman domain
+ /// \param bt BufferedTransformation with group parameters and options
DH_Domain(BufferedTransformation &bt)
{m_groupParameters.BERDecode(bt);}
- //! \brief Create a Diffie-Hellman domain
- //! \tparam T2 template parameter used as a constructor parameter
- //! \param v1 RandomNumberGenerator derived class
- //! \param v2 second parameter
- //! \details v1 and v2 are passed directly to the GROUP_PARAMETERS object.
+ /// \brief Create a Diffie-Hellman domain
+ /// \tparam T2 template parameter used as a constructor parameter
+ /// \param v1 RandomNumberGenerator derived class
+ /// \param v2 second parameter
+ /// \details v1 and v2 are passed directly to the GROUP_PARAMETERS object.
template
DH_Domain(RandomNumberGenerator &v1, const T2 &v2)
{m_groupParameters.Initialize(v1, v2);}
- //! \brief Create a Diffie-Hellman domain
- //! \tparam T2 template parameter used as a constructor parameter
- //! \tparam T3 template parameter used as a constructor parameter
- //! \param v1 RandomNumberGenerator derived class
- //! \param v2 second parameter
- //! \param v3 third parameter
- //! \details v1, v2 and v3 are passed directly to the GROUP_PARAMETERS object.
+ /// \brief Create a Diffie-Hellman domain
+ /// \tparam T2 template parameter used as a constructor parameter
+ /// \tparam T3 template parameter used as a constructor parameter
+ /// \param v1 RandomNumberGenerator derived class
+ /// \param v2 second parameter
+ /// \param v3 third parameter
+ /// \details v1, v2 and v3 are passed directly to the GROUP_PARAMETERS object.
template
DH_Domain(RandomNumberGenerator &v1, const T2 &v2, const T3 &v3)
{m_groupParameters.Initialize(v1, v2, v3);}
- //! \brief Create a Diffie-Hellman domain
- //! \tparam T2 template parameter used as a constructor parameter
- //! \tparam T3 template parameter used as a constructor parameter
- //! \tparam T4 template parameter used as a constructor parameter
- //! \param v1 RandomNumberGenerator derived class
- //! \param v2 second parameter
- //! \param v3 third parameter
- //! \param v4 fourth parameter
- //! \details v1, v2, v3 and v4 are passed directly to the GROUP_PARAMETERS object.
+ /// \brief Create a Diffie-Hellman domain
+ /// \tparam T2 template parameter used as a constructor parameter
+ /// \tparam T3 template parameter used as a constructor parameter
+ /// \tparam T4 template parameter used as a constructor parameter
+ /// \param v1 RandomNumberGenerator derived class
+ /// \param v2 second parameter
+ /// \param v3 third parameter
+ /// \param v4 fourth parameter
+ /// \details v1, v2, v3 and v4 are passed directly to the GROUP_PARAMETERS object.
template
DH_Domain(RandomNumberGenerator &v1, const T2 &v2, const T3 &v3, const T4 &v4)
{m_groupParameters.Initialize(v1, v2, v3, v4);}
- //! \brief Construct a Diffie-Hellman domain
- //! \tparam T1 template parameter used as a constructor parameter
- //! \tparam T2 template parameter used as a constructor parameter
- //! \param v1 first parameter
- //! \param v2 second parameter
- //! \details v1 and v2 are passed directly to the GROUP_PARAMETERS object.
+ /// \brief Construct a Diffie-Hellman domain
+ /// \tparam T1 template parameter used as a constructor parameter
+ /// \tparam T2 template parameter used as a constructor parameter
+ /// \param v1 first parameter
+ /// \param v2 second parameter
+ /// \details v1 and v2 are passed directly to the GROUP_PARAMETERS object.
template
DH_Domain(const T1 &v1, const T2 &v2)
{m_groupParameters.Initialize(v1, v2);}
- //! \brief Construct a Diffie-Hellman domain
- //! \tparam T1 template parameter used as a constructor parameter
- //! \tparam T2 template parameter used as a constructor parameter
- //! \tparam T3 template parameter used as a constructor parameter
- //! \param v1 first parameter
- //! \param v2 second parameter
- //! \param v3 third parameter
- //! \details v1, v2 and v3 are passed directly to the GROUP_PARAMETERS object.
+ /// \brief Construct a Diffie-Hellman domain
+ /// \tparam T1 template parameter used as a constructor parameter
+ /// \tparam T2 template parameter used as a constructor parameter
+ /// \tparam T3 template parameter used as a constructor parameter
+ /// \param v1 first parameter
+ /// \param v2 second parameter
+ /// \param v3 third parameter
+ /// \details v1, v2 and v3 are passed directly to the GROUP_PARAMETERS object.
template
DH_Domain(const T1 &v1, const T2 &v2, const T3 &v3)
{m_groupParameters.Initialize(v1, v2, v3);}
- //! \brief Construct a Diffie-Hellman domain
- //! \tparam T1 template parameter used as a constructor parameter
- //! \tparam T2 template parameter used as a constructor parameter
- //! \tparam T3 template parameter used as a constructor parameter
- //! \tparam T4 template parameter used as a constructor parameter
- //! \param v1 first parameter
- //! \param v2 second parameter
- //! \param v3 third parameter
- //! \param v4 fourth parameter
- //! \details v1, v2, v3 and v4 are passed directly to the GROUP_PARAMETERS object.
+ /// \brief Construct a Diffie-Hellman domain
+ /// \tparam T1 template parameter used as a constructor parameter
+ /// \tparam T2 template parameter used as a constructor parameter
+ /// \tparam T3 template parameter used as a constructor parameter
+ /// \tparam T4 template parameter used as a constructor parameter
+ /// \param v1 first parameter
+ /// \param v2 second parameter
+ /// \param v3 third parameter
+ /// \param v4 fourth parameter
+ /// \details v1, v2, v3 and v4 are passed directly to the GROUP_PARAMETERS object.
template
DH_Domain(const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4)
{m_groupParameters.Initialize(v1, v2, v3, v4);}
- //! \brief Retrieves the group parameters for this domain
- //! \return the group parameters for this domain as a const reference
+ /// \brief Retrieves the group parameters for this domain
+ /// \return the group parameters for this domain as a const reference
const GroupParameters & GetGroupParameters() const {return m_groupParameters;}
- //! \brief Retrieves the group parameters for this domain
- //! \return the group parameters for this domain as a non-const reference
+ /// \brief Retrieves the group parameters for this domain
+ /// \return the group parameters for this domain as a non-const reference
GroupParameters & AccessGroupParameters() {return m_groupParameters;}
- //! \brief Generate a public key from a private key in this domain
- //! \param rng RandomNumberGenerator derived class
- //! \param privateKey byte buffer with the previously generated private key
- //! \param publicKey byte buffer for the generated public key in this domain
- //! \details If using a FIPS 140-2 validated library on Windows, then this class will perform
- //! a self test to ensure the key pair is pairwise consistent. Non-FIPS and non-Windows
- //! builds of the library do not provide FIPS validated cryptography, so the code should be
- //! removed by the optimizer.
- //! \pre COUNTOF(publicKey) == PublicKeyLength()
+ /// \brief Generate a public key from a private key in this domain
+ /// \param rng RandomNumberGenerator derived class
+ /// \param privateKey byte buffer with the previously generated private key
+ /// \param publicKey byte buffer for the generated public key in this domain
+ /// \details If using a FIPS 140-2 validated library on Windows, then this class will perform
+ /// a self test to ensure the key pair is pairwise consistent. Non-FIPS and non-Windows
+ /// builds of the library do not provide FIPS validated cryptography, so the code should be
+ /// removed by the optimizer.
+ /// \pre COUNTOF(publicKey) == PublicKeyLength()
void GeneratePublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
{
Base::GeneratePublicKey(rng, privateKey, publicKey);
@@ -169,45 +169,45 @@ private:
CRYPTOPP_DLL_TEMPLATE_CLASS DH_Domain;
-//! \brief Diffie-Hellman in GF(p)
-//! \details DH() class is a typedef of DH_Domain(). The documentation that follows
-//! does not exist. Rather the documentation was created in response to Issue
-//! 328, Diffie-Hellman example code not compiling.
-//! \details Generally speaking, a DH() object is ephemeral and is intended to execute one instance of the Diffie-Hellman protocol. The
-//! private and public key parts are not intended to be set or persisted. Rather, a new set of domain parameters are generated each
-//! time an object is created.
-//! \details Once a DH() object is created, once can retrieve the ephemeral public key for the other party with code similar to the
-//! following.
-//! AutoSeededRandomPool prng;
-//! Integer p, q, g;
-//! PrimeAndGenerator pg;
-//!
-//! pg.Generate(1, prng, 512, 511);
-//! p = pg.Prime();
-//! q = pg.SubPrime();
-//! g = pg.Generator();
-//!
-//! DH dh(p, q, g);
-//! SecByteBlock t1(dh.PrivateKeyLength()), t2(dh.PublicKeyLength());
-//! dh.GenerateKeyPair(prng, t1, t2);
-//! Integer k1(t1, t1.size()), k2(t2, t2.size());
-//!
-//! cout << "Private key:\n";
-//! cout << hex << k1 << endl;
-//!
-//! cout << "Public key:\n";
-//! cout << hex << k2 << endl;
-//!
-//! \details Output of the program above will be similar to the following.
-//! $ ./cryptest.exe
-//! Private key:
-//! 72b45a42371545e9d4880f48589aefh
-//! Public key:
-//! 45fdb13f97b1840626f0250cec1dba4a23b894100b51fb5d2dd13693d789948f8bfc88f9200014b2
-//! ba8dd8a6debc471c69ef1e2326c61184a2eca88ec866346bh
-//! \sa Diffie-Hellman on the Crypto++ wiki and
-//! Diffie-Hellman in GF(p) with key validation
-//! \since Crypto++ 1.0
+/// \brief Diffie-Hellman in GF(p)
+/// \details DH() class is a typedef of DH_Domain(). The documentation that follows
+/// does not exist. Rather the documentation was created in response to Issue
+/// 328, Diffie-Hellman example code not compiling.
+/// \details Generally speaking, a DH() object is ephemeral and is intended to execute one instance of the Diffie-Hellman protocol. The
+/// private and public key parts are not intended to be set or persisted. Rather, a new set of domain parameters are generated each
+/// time an object is created.
+/// \details Once a DH() object is created, once can retrieve the ephemeral public key for the other party with code similar to the
+/// following.
+/// AutoSeededRandomPool prng;
+/// Integer p, q, g;
+/// PrimeAndGenerator pg;
+///
+/// pg.Generate(1, prng, 512, 511);
+/// p = pg.Prime();
+/// q = pg.SubPrime();
+/// g = pg.Generator();
+///
+/// DH dh(p, q, g);
+/// SecByteBlock t1(dh.PrivateKeyLength()), t2(dh.PublicKeyLength());
+/// dh.GenerateKeyPair(prng, t1, t2);
+/// Integer k1(t1, t1.size()), k2(t2, t2.size());
+///
+/// cout << "Private key:\n";
+/// cout << hex << k1 << endl;
+///
+/// cout << "Public key:\n";
+/// cout << hex << k2 << endl;
+///
+/// \details Output of the program above will be similar to the following.
+/// $ ./cryptest.exe
+/// Private key:
+/// 72b45a42371545e9d4880f48589aefh
+/// Public key:
+/// 45fdb13f97b1840626f0250cec1dba4a23b894100b51fb5d2dd13693d789948f8bfc88f9200014b2
+/// ba8dd8a6debc471c69ef1e2326c61184a2eca88ec866346bh
+/// \sa Diffie-Hellman on the Crypto++ wiki and
+/// Diffie-Hellman in GF(p) with key validation
+/// \since Crypto++ 1.0
#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
struct DH : public DH_Domain
{
@@ -216,53 +216,53 @@ struct DH : public DH_Domain
virtual ~DH() {}
- //! \brief Create an uninitialized Diffie-Hellman object
+ /// \brief Create an uninitialized Diffie-Hellman object
DH() : DH_Domain() {}
- //! \brief Initialize a Diffie-Hellman object
- //! \param bt BufferedTransformation with group parameters and options
+ /// \brief Initialize a Diffie-Hellman object
+ /// \param bt BufferedTransformation with group parameters and options
DH(BufferedTransformation &bt) : DH_Domain(bt) {}
- //! \brief Initialize a Diffie-Hellman object
- //! \param params group parameters and options
+ /// \brief Initialize a Diffie-Hellman object
+ /// \param params group parameters and options
DH(const GroupParameters ¶ms) : DH_Domain(params) {}
- //! \brief Create a Diffie-Hellman object
- //! \param rng a RandomNumberGenerator derived class
- //! \param modulusBits the size of the modulus, in bits
- //! \details This function overload of Initialize() creates a new Diffie-Hellman object because it
- //! takes a RandomNumberGenerator() as a parameter.
+ /// \brief Create a Diffie-Hellman object
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param modulusBits the size of the modulus, in bits
+ /// \details This function overload of Initialize() creates a new Diffie-Hellman object because it
+ /// takes a RandomNumberGenerator() as a parameter.
DH(RandomNumberGenerator &rng, unsigned int modulusBits) : DH_Domain(rng, modulusBits) {}
- //! \brief Initialize a Diffie-Hellman object
- //! \param p the modulus
- //! \param g the generator
+ /// \brief Initialize a Diffie-Hellman object
+ /// \param p the modulus
+ /// \param g the generator
DH(const Integer &p, const Integer &g) : DH_Domain(p, g) {}
- //! \brief Initialize a Diffie-Hellman object
- //! \param p the modulus
- //! \param q the subgroup order
- //! \param g the generator
+ /// \brief Initialize a Diffie-Hellman object
+ /// \param p the modulus
+ /// \param q the subgroup order
+ /// \param g the generator
DH(const Integer &p, const Integer &q, const Integer &g) : DH_Domain(p, q, g) {}
- //! \brief Creates a Diffie-Hellman object
- //! \param rng a RandomNumberGenerator derived class
- //! \param modulusBits the size of the modulus, in bits
- //! \details This function overload of Initialize() creates a new Diffie-Hellman object because it
- //! takes a RandomNumberGenerator() as a parameter.
+ /// \brief Creates a Diffie-Hellman object
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param modulusBits the size of the modulus, in bits
+ /// \details This function overload of Initialize() creates a new Diffie-Hellman object because it
+ /// takes a RandomNumberGenerator() as a parameter.
void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits)
{AccessGroupParameters().Initialize(rng, modulusBits);}
- //! \brief Initialize a Diffie-Hellman object
- //! \param p the modulus
- //! \param g the generator
+ /// \brief Initialize a Diffie-Hellman object
+ /// \param p the modulus
+ /// \param g the generator
void Initialize(const Integer &p, const Integer &g)
{AccessGroupParameters().Initialize(p, g);}
- //! \brief Initialize a Diffie-Hellman object
- //! \param p the modulus
- //! \param q the subgroup order
- //! \param g the generator
+ /// \brief Initialize a Diffie-Hellman object
+ /// \param p the modulus
+ /// \param q the subgroup order
+ /// \param g the generator
void Initialize(const Integer &p, const Integer &q, const Integer &g)
{AccessGroupParameters().Initialize(p, q, g);}
};
diff --git a/dh2.h b/dh2.h
index 2163de27..4795387b 100644
--- a/dh2.h
+++ b/dh2.h
@@ -1,7 +1,7 @@
// dh2.h - originally written and placed in the public domain by Wei Dai
-//! \file dh2.h
-//! \brief Classes for Unified Diffie-Hellman key exchange
+/// \file dh2.h
+/// \brief Classes for Unified Diffie-Hellman key exchange
#ifndef CRYPTOPP_DH2_H
#define CRYPTOPP_DH2_H
@@ -10,22 +10,22 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class DH2
-//! \brief Unified Diffie-Hellman in GF(p)
-//! \details A Diffie-Hellman domain is a set of parameters that must be shared
-//! by two parties in a key agreement protocol, along with the algorithms
-//! for generating key pairs and deriving agreed values.
-//! \sa AuthenticatedKeyAgreementDomain, Unified Diffie-Hellman
-//! \since Crypto++ 1.0
+/// \class DH2
+/// \brief Unified Diffie-Hellman in GF(p)
+/// \details A Diffie-Hellman domain is a set of parameters that must be shared
+/// by two parties in a key agreement protocol, along with the algorithms
+/// for generating key pairs and deriving agreed values.
+/// \sa AuthenticatedKeyAgreementDomain, Unified Diffie-Hellman
+/// \since Crypto++ 1.0
class DH2 : public AuthenticatedKeyAgreementDomain
{
public:
virtual ~DH2() {}
- //! \brief Construct a DH2
+ /// \brief Construct a DH2
DH2(SimpleKeyAgreementDomain &domain)
: d1(domain), d2(domain) {}
- //! \brief Construct a DH2
+ /// \brief Construct a DH2
DH2(SimpleKeyAgreementDomain &staticDomain, SimpleKeyAgreementDomain &ephemeralDomain)
: d1(staticDomain), d2(ephemeralDomain) {}
diff --git a/dll.h b/dll.h
index a15096e9..bd8acf10 100644
--- a/dll.h
+++ b/dll.h
@@ -1,8 +1,8 @@
// dll.h - originally written and placed in the public domain by Wei Dai
-//! \file
-//! \headerfile dll.h
-//! \brief Functions and definitions required for building the FIPS-140 DLL on Windows
+/// \file
+/// \headerfile dll.h
+/// \brief Functions and definitions required for building the FIPS-140 DLL on Windows
#ifndef CRYPTOPP_DLL_H
#define CRYPTOPP_DLL_H
diff --git a/dmac.h b/dmac.h
index 1af7e04a..f7e17ce0 100644
--- a/dmac.h
+++ b/dmac.h
@@ -1,8 +1,8 @@
// dmac.h - originally written and placed in the public domain by Wei Dai
-//! \file
-//! \headerfile dmac.h
-//! \brief Classes for DMAC message authentication code
+/// \file
+/// \headerfile dmac.h
+/// \brief Classes for DMAC message authentication code
#ifndef CRYPTOPP_DMAC_H
#define CRYPTOPP_DMAC_H
@@ -11,9 +11,9 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class DMAC_Base
-//! \brief DMAC message authentication code base class
-//! \tparam T class derived from BlockCipherDocumentation
+/// \class DMAC_Base
+/// \brief DMAC message authentication code base class
+/// \tparam T class derived from BlockCipherDocumentation
template
class CRYPTOPP_NO_VTABLE DMAC_Base : public SameKeyLengthAs, public MessageAuthenticationCode
{
@@ -39,21 +39,21 @@ private:
unsigned int m_counter;
};
-//! \class DMAC
-//! \brief DMAC message authentication code
-//! \tparam T class derived from BlockCipherDocumentation
-//! \sa CBC MAC for Real-Time Data Sources (08.15.1997)
-//! by Erez Petrank and Charles Rackoff
+/// \class DMAC
+/// \brief DMAC message authentication code
+/// \tparam T class derived from BlockCipherDocumentation
+/// \sa CBC MAC for Real-Time Data Sources (08.15.1997)
+/// by Erez Petrank and Charles Rackoff
template
class DMAC : public MessageAuthenticationCodeFinal >
{
public:
- //! \brief Construct a DMAC
+ /// \brief Construct a DMAC
DMAC() {}
- //! \brief Construct a DMAC
- //! \param key a byte array used to key the cipher
- //! \param length the size of the byte array, in bytes
+ /// \brief Construct a DMAC
+ /// \param key a byte array used to key the cipher
+ /// \param length the size of the byte array, in bytes
DMAC(const byte *key, size_t length=DMAC_Base::DEFAULT_KEYLENGTH)
{this->SetKey(key, length);}
};
diff --git a/drbg.h b/drbg.h
index 468b8b1c..42b5c788 100644
--- a/drbg.h
+++ b/drbg.h
@@ -1,10 +1,10 @@
// drbg.h - written and placed in public domain by Jeffrey Walton.
-//! \file drbg.h
-//! \brief Classes for NIST DRBGs from SP 800-90A
-//! \sa Recommendation
-//! for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)
-//! \since Crypto++ 6.0
+/// \file drbg.h
+/// \brief Classes for NIST DRBGs from SP 800-90A
+/// \sa Recommendation
+/// for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)
+/// \since Crypto++ 6.0
#ifndef CRYPTOPP_NIST_DRBG_H
#define CRYPTOPP_NIST_DRBG_H
@@ -16,16 +16,16 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class NIST_DRBG
-//! \brief Interface for NIST DRBGs from SP 800-90A
-//! \details NIST_DRBG is the base class interface for NIST DRBGs from SP 800-90A Rev 1 (June 2015)
-//! \sa Recommendation
-//! for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)
-//! \since Crypto++ 6.0
+/// \class NIST_DRBG
+/// \brief Interface for NIST DRBGs from SP 800-90A
+/// \details NIST_DRBG is the base class interface for NIST DRBGs from SP 800-90A Rev 1 (June 2015)
+/// \sa Recommendation
+/// for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)
+/// \since Crypto++ 6.0
class NIST_DRBG : public RandomNumberGenerator
{
public:
- //! \brief Exception thrown when a NIST DRBG encounters an error
+ /// \brief Exception thrown when a NIST DRBG encounters an error
class Err : public Exception
{
public:
@@ -36,105 +36,105 @@ public:
public:
virtual ~NIST_DRBG() {}
- //! \brief Determines if a generator can accept additional entropy
- //! \return true
- //! \details All NIST_DRBG return true
+ /// \brief Determines if a generator can accept additional entropy
+ /// \return true
+ /// \details All NIST_DRBG return true
virtual bool CanIncorporateEntropy() const {return true;}
- //! \brief Update RNG state with additional unpredictable values
- //! \param input the entropy to add to the generator
- //! \param length the size of the input buffer
- //! \throws NIST_DRBG::Err if the generator is reseeded with insufficient entropy
- //! \details NIST instantiation and reseed requirements demand the generator is constructed
- //! with at least MINIMUM_ENTROPY entropy. The byte array for input must
- //! meet NIST SP 800-90B or
- //! SP 800-90C requirements.
+ /// \brief Update RNG state with additional unpredictable values
+ /// \param input the entropy to add to the generator
+ /// \param length the size of the input buffer
+ /// \throws NIST_DRBG::Err if the generator is reseeded with insufficient entropy
+ /// \details NIST instantiation and reseed requirements demand the generator is constructed
+ /// with at least MINIMUM_ENTROPY entropy. The byte array for input must
+ /// meet NIST SP 800-90B or
+ /// SP 800-90C requirements.
virtual void IncorporateEntropy(const byte *input, size_t length)=0;
- //! \brief Update RNG state with additional unpredictable values
- //! \param entropy the entropy to add to the generator
- //! \param entropyLength the size of the input buffer
- //! \param additional additional input to add to the generator
- //! \param additionaLength the size of the additional input buffer
- //! \throws NIST_DRBG::Err if the generator is reseeded with insufficient entropy
- //! \details IncorporateEntropy() is an overload provided to match NIST requirements. NIST
- //! instantiation and reseed requirements demand the generator is constructed with at least
- //! MINIMUM_ENTROPY entropy. The byte array for entropy must meet
- //! NIST SP 800-90B or
- //!! SP 800-90C requirements.
+ /// \brief Update RNG state with additional unpredictable values
+ /// \param entropy the entropy to add to the generator
+ /// \param entropyLength the size of the input buffer
+ /// \param additional additional input to add to the generator
+ /// \param additionaLength the size of the additional input buffer
+ /// \throws NIST_DRBG::Err if the generator is reseeded with insufficient entropy
+ /// \details IncorporateEntropy() is an overload provided to match NIST requirements. NIST
+ /// instantiation and reseed requirements demand the generator is constructed with at least
+ /// MINIMUM_ENTROPY entropy. The byte array for entropy must meet
+ /// NIST SP 800-90B or
+ ///! SP 800-90C requirements.
virtual void IncorporateEntropy(const byte *entropy, size_t entropyLength, const byte* additional, size_t additionaLength)=0;
- //! \brief Generate random array of bytes
- //! \param output the byte buffer
- //! \param size the length of the buffer, in bytes
- //! \throws NIST_DRBG::Err if a reseed is required
- //! \throws NIST_DRBG::Err if the size exceeds MAXIMUM_BYTES_PER_REQUEST
+ /// \brief Generate random array of bytes
+ /// \param output the byte buffer
+ /// \param size the length of the buffer, in bytes
+ /// \throws NIST_DRBG::Err if a reseed is required
+ /// \throws NIST_DRBG::Err if the size exceeds MAXIMUM_BYTES_PER_REQUEST
virtual void GenerateBlock(byte *output, size_t size)=0;
- //! \brief Generate random array of bytes
- //! \param additional additional input to add to the generator
- //! \param additionaLength the size of the additional input buffer
- //! \param output the byte buffer
- //! \param size the length of the buffer, in bytes
- //! \throws NIST_DRBG::Err if a reseed is required
- //! \throws NIST_DRBG::Err if the size exceeds MAXIMUM_BYTES_PER_REQUEST
- //! \details GenerateBlock() is an overload provided to match NIST requirements. The byte
- //! array for additional input is optional. If present the additional randomness
- //! is mixed before generating the output bytes.
+ /// \brief Generate random array of bytes
+ /// \param additional additional input to add to the generator
+ /// \param additionaLength the size of the additional input buffer
+ /// \param output the byte buffer
+ /// \param size the length of the buffer, in bytes
+ /// \throws NIST_DRBG::Err if a reseed is required
+ /// \throws NIST_DRBG::Err if the size exceeds MAXIMUM_BYTES_PER_REQUEST
+ /// \details GenerateBlock() is an overload provided to match NIST requirements. The byte
+ /// array for additional input is optional. If present the additional randomness
+ /// is mixed before generating the output bytes.
virtual void GenerateBlock(const byte* additional, size_t additionaLength, byte *output, size_t size)=0;
- //! \brief Provides the security strength
- //! \returns The security strength of the generator, in bytes
- //! \details The equivalent class constant is SECURITY_STRENGTH
+ /// \brief Provides the security strength
+ /// \returns The security strength of the generator, in bytes
+ /// \details The equivalent class constant is SECURITY_STRENGTH
virtual unsigned int SecurityStrength() const=0;
- //! \brief Provides the seed length
- //! \returns The seed size of the generator, in bytes
- //! \details The equivalent class constant is SEED_LENGTH. The size is
- //! used to maintain internal state of V and C.
+ /// \brief Provides the seed length
+ /// \returns The seed size of the generator, in bytes
+ /// \details The equivalent class constant is SEED_LENGTH. The size is
+ /// used to maintain internal state of V and C.
virtual unsigned int SeedLength() const=0;
- //! \brief Provides the minimum entropy size
- //! \returns The minimum entropy size required by the generator, in bytes
- //! \details The equivalent class constant is MINIMUM_ENTROPY. All NIST DRBGs must
- //! be instaniated with at least MINIMUM_ENTROPY bytes of entropy. The bytes must
- //! meet NIST SP 800-90B or
- //! SP 800-90C requirements.
+ /// \brief Provides the minimum entropy size
+ /// \returns The minimum entropy size required by the generator, in bytes
+ /// \details The equivalent class constant is MINIMUM_ENTROPY. All NIST DRBGs must
+ /// be instaniated with at least MINIMUM_ENTROPY bytes of entropy. The bytes must
+ /// meet NIST SP 800-90B or
+ /// SP 800-90C requirements.
virtual unsigned int MinEntropyLength() const=0;
- //! \brief Provides the maximum entropy size
- //! \returns The maximum entropy size that can be consumed by the generator, in bytes
- //! \details The equivalent class constant is MAXIMUM_ENTROPY. The bytes must
- //! meet NIST SP 800-90B or
- //! SP 800-90C requirements. MAXIMUM_ENTROPY has been reduced from
- //! 235 to INT_MAX to fit the underlying C++ datatype.
+ /// \brief Provides the maximum entropy size
+ /// \returns The maximum entropy size that can be consumed by the generator, in bytes
+ /// \details The equivalent class constant is MAXIMUM_ENTROPY. The bytes must
+ /// meet NIST SP 800-90B or
+ /// SP 800-90C requirements. MAXIMUM_ENTROPY has been reduced from
+ /// 235 to INT_MAX to fit the underlying C++ datatype.
virtual unsigned int MaxEntropyLength() const=0;
- //! \brief Provides the minimum nonce size
- //! \returns The minimum nonce size recommended for the generator, in bytes
- //! \details The equivalent class constant is MINIMUM_NONCE. If a nonce is not
- //! required then MINIMUM_NONCE is 0. Hash_DRBG does not require a
- //! nonce, while HMAC_DRBG and CTR_DRBG require a nonce.
+ /// \brief Provides the minimum nonce size
+ /// \returns The minimum nonce size recommended for the generator, in bytes
+ /// \details The equivalent class constant is MINIMUM_NONCE. If a nonce is not
+ /// required then MINIMUM_NONCE is 0. Hash_DRBG does not require a
+ /// nonce, while HMAC_DRBG and CTR_DRBG require a nonce.
virtual unsigned int MinNonceLength() const=0;
- //! \brief Provides the maximum nonce size
- //! \returns The maximum nonce that can be consumed by the generator, in bytes
- //! \details The equivalent class constant is MAXIMUM_NONCE. MAXIMUM_NONCE
- //! has been reduced from 235 to INT_MAX to fit the underlying C++ datatype.
- //! If a nonce is not required then MINIMUM_NONCE is 0. Hash_DRBG does not
- //! require a nonce, while HMAC_DRBG and CTR_DRBG require a nonce.
+ /// \brief Provides the maximum nonce size
+ /// \returns The maximum nonce that can be consumed by the generator, in bytes
+ /// \details The equivalent class constant is MAXIMUM_NONCE. MAXIMUM_NONCE
+ /// has been reduced from 235 to INT_MAX to fit the underlying C++ datatype.
+ /// If a nonce is not required then MINIMUM_NONCE is 0. Hash_DRBG does not
+ /// require a nonce, while HMAC_DRBG and CTR_DRBG require a nonce.
virtual unsigned int MaxNonceLength() const=0;
- //! \brief Provides the maximum size of a request to GenerateBlock
- //! \returns The the maximum size of a request to GenerateBlock(), in bytes
- //! \details The equivalent class constant is MAXIMUM_BYTES_PER_REQUEST
+ /// \brief Provides the maximum size of a request to GenerateBlock
+ /// \returns The the maximum size of a request to GenerateBlock(), in bytes
+ /// \details The equivalent class constant is MAXIMUM_BYTES_PER_REQUEST
virtual unsigned int MaxBytesPerRequest() const=0;
- //! \brief Provides the maximum number of requests before a reseed
- //! \returns The the maximum number of requests before a reseed, in bytes
- //! \details The equivalent class constant is MAXIMUM_REQUESTS_BEFORE_RESEED.
- //! MAXIMUM_REQUESTS_BEFORE_RESEED has been reduced from 248 to INT_MAX
- //! to fit the underlying C++ datatype.
+ /// \brief Provides the maximum number of requests before a reseed
+ /// \returns The the maximum number of requests before a reseed, in bytes
+ /// \details The equivalent class constant is MAXIMUM_REQUESTS_BEFORE_RESEED.
+ /// MAXIMUM_REQUESTS_BEFORE_RESEED has been reduced from 248 to INT_MAX
+ /// to fit the underlying C++ datatype.
virtual unsigned int MaxRequestBeforeReseed() const=0;
protected:
@@ -146,21 +146,21 @@ protected:
// *************************************************************
-//! \class Hash_DRBG
-//! \tparam HASH NIST approved hash derived from HashTransformation
-//! \tparam STRENGTH security strength, in bytes
-//! \tparam SEEDLENGTH seed length, in bytes
-//! \brief Hash_DRBG from SP 800-90A Rev 1 (June 2015)
-//! \details The NIST Hash DRBG is instantiated with a number of parameters. Two of the parameters,
-//! Security Strength and Seed Length, depend on the hash and are specified as template parameters.
-//! The remaining parameters are included in the class. The parameters and their values are listed
-//! in NIST SP 800-90A Rev. 1, Table 2: Definitions for Hash-Based DRBG Mechanisms (p.38).
-//! \details Some parameters have been reduce to fit C++ datatypes. For example, NIST allows upto
-//! 248 requests before a reseed. However, Hash_DRBG limits it to INT_MAX due
-//! to the limited data range of an int.
-//! \sa Recommendation
-//! for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)
-//! \since Crypto++ 6.0
+/// \class Hash_DRBG
+/// \tparam HASH NIST approved hash derived from HashTransformation
+/// \tparam STRENGTH security strength, in bytes
+/// \tparam SEEDLENGTH seed length, in bytes
+/// \brief Hash_DRBG from SP 800-90A Rev 1 (June 2015)
+/// \details The NIST Hash DRBG is instantiated with a number of parameters. Two of the parameters,
+/// Security Strength and Seed Length, depend on the hash and are specified as template parameters.
+/// The remaining parameters are included in the class. The parameters and their values are listed
+/// in NIST SP 800-90A Rev. 1, Table 2: Definitions for Hash-Based DRBG Mechanisms (p.38).
+/// \details Some parameters have been reduce to fit C++ datatypes. For example, NIST allows upto
+/// 248 requests before a reseed. However, Hash_DRBG limits it to INT_MAX due
+/// to the limited data range of an int.
+/// \sa Recommendation
+/// for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)
+/// \since Crypto++ 6.0
template
class Hash_DRBG : public NIST_DRBG, public NotCopyable
{
@@ -180,31 +180,31 @@ public:
static std::string StaticAlgorithmName() { return std::string("Hash_DRBG(") + HASH::StaticAlgorithmName() + std::string(")"); }
- //! \brief Construct a Hash DRBG
- //! \param entropy the entropy to instantiate the generator
- //! \param entropyLength the size of the entropy buffer
- //! \param nonce additional input to instantiate the generator
- //! \param nonceLength the size of the nonce buffer
- //! \param personalization additional input to instantiate the generator
- //! \param personalizationLength the size of the personalization buffer
- //! \throws NIST_DRBG::Err if the generator is instantiated with insufficient entropy
- //! \details All NIST DRBGs must be instaniated with at least MINIMUM_ENTROPY bytes of entropy.
- //! The byte array for entropy must meet NIST
- //! SP 800-90B or SP 800-90C requirements.
- //! \details The nonce and personalization are optional byte arrays. If nonce is supplied,
- //! then it should be at least MINIMUM_NONCE bytes of entropy.
- //! \details An example of instantiating a SHA256 generator is shown below.
- //! The example provides more entropy than required for SHA256. The NonblockingRng meets the
- //! requirements of NIST SP 800-90B or SP 800-90C.
- //! RDRAND() and RDSEED() generators would work as well.
- //!
- //! SecByteBlock entropy(48), result(128);
- //! NonblockingRng prng;
- //! RandomNumberSource rns(prng, entropy.size(), new ArraySink(entropy, entropy.size()));
- //!
- //! Hash_DRBG drbg(entropy, 32, entropy+32, 16);
- //! drbg.GenerateBlock(result, result.size());
- //!
+ /// \brief Construct a Hash DRBG
+ /// \param entropy the entropy to instantiate the generator
+ /// \param entropyLength the size of the entropy buffer
+ /// \param nonce additional input to instantiate the generator
+ /// \param nonceLength the size of the nonce buffer
+ /// \param personalization additional input to instantiate the generator
+ /// \param personalizationLength the size of the personalization buffer
+ /// \throws NIST_DRBG::Err if the generator is instantiated with insufficient entropy
+ /// \details All NIST DRBGs must be instaniated with at least MINIMUM_ENTROPY bytes of entropy.
+ /// The byte array for entropy must meet NIST
+ /// SP 800-90B or SP 800-90C requirements.
+ /// \details The nonce and personalization are optional byte arrays. If nonce is supplied,
+ /// then it should be at least MINIMUM_NONCE bytes of entropy.
+ /// \details An example of instantiating a SHA256 generator is shown below.
+ /// The example provides more entropy than required for SHA256. The NonblockingRng meets the
+ /// requirements of NIST SP 800-90B or SP 800-90C.
+ /// RDRAND() and RDSEED() generators would work as well.
+ ///
+ /// SecByteBlock entropy(48), result(128);
+ /// NonblockingRng prng;
+ /// RandomNumberSource rns(prng, entropy.size(), new ArraySink(entropy, entropy.size()));
+ ///
+ /// Hash_DRBG drbg(entropy, 32, entropy+32, 16);
+ /// drbg.GenerateBlock(result, result.size());
+ ///
Hash_DRBG(const byte* entropy=NULLPTR, size_t entropyLength=STRENGTH, const byte* nonce=NULLPTR,
size_t nonceLength=0, const byte* personalization=NULLPTR, size_t personalizationLength=0)
: NIST_DRBG(), m_c(SEEDLENGTH), m_v(SEEDLENGTH), m_reseed(0)
@@ -261,20 +261,20 @@ private:
// *************************************************************
-//! \class HMAC_DRBG
-//! \tparam HASH NIST approved hash derived from HashTransformation
-//! \tparam STRENGTH security strength, in bytes
-//! \tparam SEEDLENGTH seed length, in bytes
-//! \brief HMAC_DRBG from SP 800-90A Rev 1 (June 2015)
-//! \details The NIST HMAC DRBG is instantiated with a number of parameters. Two of the parameters,
-//! Security Strength and Seed Length, depend on the hash and are specified as template parameters.
-//! The remaining parameters are included in the class. The parameters and their values are listed
-//! in NIST SP 800-90A Rev. 1, Table 2: Definitions for Hash-Based DRBG Mechanisms (p.38).
-//! \details Some parameters have been reduce to fit C++ datatypes. For example, NIST allows upto 248 requests
-//! before a reseed. However, HMAC_DRBG limits it to INT_MAX due to the limited data range of an int.
-//! \sa Recommendation
-//! for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)
-//! \since Crypto++ 6.0
+/// \class HMAC_DRBG
+/// \tparam HASH NIST approved hash derived from HashTransformation
+/// \tparam STRENGTH security strength, in bytes
+/// \tparam SEEDLENGTH seed length, in bytes
+/// \brief HMAC_DRBG from SP 800-90A Rev 1 (June 2015)
+/// \details The NIST HMAC DRBG is instantiated with a number of parameters. Two of the parameters,
+/// Security Strength and Seed Length, depend on the hash and are specified as template parameters.
+/// The remaining parameters are included in the class. The parameters and their values are listed
+/// in NIST SP 800-90A Rev. 1, Table 2: Definitions for Hash-Based DRBG Mechanisms (p.38).
+/// \details Some parameters have been reduce to fit C++ datatypes. For example, NIST allows upto 248 requests
+/// before a reseed. However, HMAC_DRBG limits it to INT_MAX due to the limited data range of an int.
+/// \sa Recommendation
+/// for Random Number Generation Using Deterministic Random Bit Generators, Rev 1 (June 2015)
+/// \since Crypto++ 6.0
template
class HMAC_DRBG : public NIST_DRBG, public NotCopyable
{
@@ -294,31 +294,31 @@ public:
static std::string StaticAlgorithmName() { return std::string("HMAC_DRBG(") + HASH::StaticAlgorithmName() + std::string(")"); }
- //! \brief Construct a HMAC DRBG
- //! \param entropy the entropy to instantiate the generator
- //! \param entropyLength the size of the entropy buffer
- //! \param nonce additional input to instantiate the generator
- //! \param nonceLength the size of the nonce buffer
- //! \param personalization additional input to instantiate the generator
- //! \param personalizationLength the size of the personalization buffer
- //! \throws NIST_DRBG::Err if the generator is instantiated with insufficient entropy
- //! \details All NIST DRBGs must be instaniated with at least MINIMUM_ENTROPY bytes of entropy.
- //! The byte array for entropy must meet NIST
- //! SP 800-90B or SP 800-90C requirements.
- //! \details The nonce and personalization are optional byte arrays. If nonce is supplied,
- //! then it should be at least MINIMUM_NONCE bytes of entropy.
- //! \details An example of instantiating a SHA256 generator is shown below.
- //! The example provides more entropy than required for SHA256. The NonblockingRng meets the
- //! requirements of NIST SP 800-90B or SP 800-90C.
- //! RDRAND() and RDSEED() generators would work as well.
- //!
- //! SecByteBlock entropy(48), result(128);
- //! NonblockingRng prng;
- //! RandomNumberSource rns(prng, entropy.size(), new ArraySink(entropy, entropy.size()));
- //!
- //! HMAC_DRBG drbg(entropy, 32, entropy+32, 16);
- //! drbg.GenerateBlock(result, result.size());
- //!
+ /// \brief Construct a HMAC DRBG
+ /// \param entropy the entropy to instantiate the generator
+ /// \param entropyLength the size of the entropy buffer
+ /// \param nonce additional input to instantiate the generator
+ /// \param nonceLength the size of the nonce buffer
+ /// \param personalization additional input to instantiate the generator
+ /// \param personalizationLength the size of the personalization buffer
+ /// \throws NIST_DRBG::Err if the generator is instantiated with insufficient entropy
+ /// \details All NIST DRBGs must be instaniated with at least MINIMUM_ENTROPY bytes of entropy.
+ /// The byte array for entropy must meet NIST
+ /// SP 800-90B or SP 800-90C requirements.
+ /// \details The nonce and personalization are optional byte arrays. If nonce is supplied,
+ /// then it should be at least MINIMUM_NONCE bytes of entropy.
+ /// \details An example of instantiating a SHA256 generator is shown below.
+ /// The example provides more entropy than required for SHA256. The NonblockingRng meets the
+ /// requirements of NIST SP 800-90B or SP 800-90C.
+ /// RDRAND() and RDSEED() generators would work as well.
+ ///
+ /// SecByteBlock entropy(48), result(128);
+ /// NonblockingRng prng;
+ /// RandomNumberSource rns(prng, entropy.size(), new ArraySink(entropy, entropy.size()));
+ ///
+ /// HMAC_DRBG drbg(entropy, 32, entropy+32, 16);
+ /// drbg.GenerateBlock(result, result.size());
+ ///
HMAC_DRBG(const byte* entropy=NULLPTR, size_t entropyLength=STRENGTH, const byte* nonce=NULLPTR,
size_t nonceLength=0, const byte* personalization=NULLPTR, size_t personalizationLength=0)
: NIST_DRBG(), m_k(HASH::DIGESTSIZE), m_v(HASH::DIGESTSIZE), m_reseed(0)
diff --git a/dsa.h b/dsa.h
index 8ea4773f..21cd1a74 100644
--- a/dsa.h
+++ b/dsa.h
@@ -1,7 +1,7 @@
// dsa.h - originally written and placed in the public domain by Wei Dai
-//! \file dsa.h
-//! \brief Classes for the DSA signature algorithm
+/// \file dsa.h
+/// \brief Classes for the DSA signature algorithm
#ifndef CRYPTOPP_DSA_H
#define CRYPTOPP_DSA_H
@@ -11,29 +11,29 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \brief DSA Signature Format
-//! \details The DSA signature format used by Crypto++ is as defined by IEEE P1363.
-//! Java nad .Net use the DER format, and OpenPGP uses the OpenPGP format.
+/// \brief DSA Signature Format
+/// \details The DSA signature format used by Crypto++ is as defined by IEEE P1363.
+/// Java nad .Net use the DER format, and OpenPGP uses the OpenPGP format.
enum DSASignatureFormat {
- //! \brief Crypto++ native signature encoding format
+ /// \brief Crypto++ native signature encoding format
DSA_P1363,
- //! \brief signature encoding format used by Java and .Net
+ /// \brief signature encoding format used by Java and .Net
DSA_DER,
- //! \brief OpenPGP signature encoding format
+ /// \brief OpenPGP signature encoding format
DSA_OPENPGP
};
-//! \brief Converts between signature encoding formats
-//! \param buffer byte buffer for the converted signature encoding
-//! \param bufferSize the length of the converted signature encoding buffer
-//! \param toFormat the source signature format
-//! \param signature byte buffer for the existing signature encoding
-//! \param signatureLen the length of the existing signature encoding buffer
-//! \param fromFormat the source signature format
-//! \details This function converts between these formats, and returns length
-//! of signature in the target format. If toFormat == DSA_P1363, then
-//! bufferSize must equal publicKey.SignatureLength()
-//! \since Crypto++ 1.0
+/// \brief Converts between signature encoding formats
+/// \param buffer byte buffer for the converted signature encoding
+/// \param bufferSize the length of the converted signature encoding buffer
+/// \param toFormat the source signature format
+/// \param signature byte buffer for the existing signature encoding
+/// \param signatureLen the length of the existing signature encoding buffer
+/// \param fromFormat the source signature format
+/// \details This function converts between these formats, and returns length
+/// of signature in the target format. If toFormat == DSA_P1363, then
+/// bufferSize must equal publicKey.SignatureLength()
+/// \since Crypto++ 1.0
size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat,
const byte *signature, size_t signatureLen, DSASignatureFormat fromFormat);
diff --git a/eax.h b/eax.h
index 3a17658b..f9917fe1 100644
--- a/eax.h
+++ b/eax.h
@@ -1,7 +1,7 @@
// eax.h - originally written and placed in the public domain by Wei Dai
-//! \file eax.h
-//! \brief EAX block cipher mode of operation
+/// \file eax.h
+/// \brief EAX block cipher mode of operation
#ifndef CRYPTOPP_EAX_H
#define CRYPTOPP_EAX_H
@@ -12,10 +12,10 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class EAX_Base
-//! \brief EAX block cipher base implementation
-//! \details Base implementation of the AuthenticatedSymmetricCipher interface
-//! \since Crypto++ 5.6.0
+/// \class EAX_Base
+/// \brief EAX block cipher base implementation
+/// \details Base implementation of the AuthenticatedSymmetricCipher interface
+/// \since Crypto++ 5.6.0
class CRYPTOPP_NO_VTABLE EAX_Base : public AuthenticatedSymmetricCipherBase
{
public:
@@ -67,11 +67,11 @@ protected:
CTR_Mode_ExternalCipher::Encryption m_ctr;
};
-//! \class EAX_Final
-//! \brief EAX block cipher final implementation
-//! \tparam T_BlockCipher block cipher
-//! \tparam T_IsEncryption direction in which to operate the cipher
-//! \since Crypto++ 5.6.0
+/// \class EAX_Final
+/// \brief EAX block cipher final implementation
+/// \tparam T_BlockCipher block cipher
+/// \tparam T_IsEncryption direction in which to operate the cipher
+/// \since Crypto++ 5.6.0
template
class EAX_Final : public EAX_Base
{
@@ -90,15 +90,15 @@ private:
#undef EAX
#endif
-//! \class EAX
-//! \brief EAX block cipher mode of operation
-//! \tparam T_BlockCipher block cipher
-//! \details \p EAX provides the \p Encryption and \p Decryption typedef. See EAX_Base
-//! and EAX_Final for the AuthenticatedSymmetricCipher implementation.
-//! \sa EAX Mode and
-//! Modes of Operation
-//! on the Crypto++ wiki.
-//! \since Crypto++ 5.6.0
+/// \class EAX
+/// \brief EAX block cipher mode of operation
+/// \tparam T_BlockCipher block cipher
+/// \details \p EAX provides the \p Encryption and \p Decryption typedef. See EAX_Base
+/// and EAX_Final for the AuthenticatedSymmetricCipher implementation.
+/// \sa EAX Mode and
+/// Modes of Operation
+/// on the Crypto++ wiki.
+/// \since Crypto++ 5.6.0
template
struct EAX : public AuthenticatedSymmetricCipherDocumentation
{
diff --git a/ec2n.h b/ec2n.h
index cc4c0462..6de58c62 100644
--- a/ec2n.h
+++ b/ec2n.h
@@ -1,8 +1,8 @@
// ec2n.h - originally written and placed in the public domain by Wei Dai
-//! \file
-//! \headerfile ec2n.h
-//! \brief Classes for Elliptic Curves over binary fields
+/// \file
+/// \headerfile ec2n.h
+/// \brief Classes for Elliptic Curves over binary fields
#ifndef CRYPTOPP_EC2N_H
@@ -24,8 +24,8 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class EC2N
-//! \brief Elliptic Curve over GF(2^n)
+/// \class EC2N
+/// \brief Elliptic Curve over GF(2^n)
class CRYPTOPP_DLL EC2N : public AbstractGroup, public EncodedPoint
{
public:
@@ -35,23 +35,23 @@ public:
virtual ~EC2N() {}
- //! \brief Construct an EC2N
+ /// \brief Construct an EC2N
EC2N() {}
- //! \brief Construct an EC2N
- //! \param field Field, GF2NP derived class
- //! \param a Field::Element
- //! \param b Field::Element
+ /// \brief Construct an EC2N
+ /// \param field Field, GF2NP derived class
+ /// \param a Field::Element
+ /// \param b Field::Element
EC2N(const Field &field, const Field::Element &a, const Field::Element &b)
: m_field(field), m_a(a), m_b(b) {}
- //! \brief Construct an EC2N from BER encoded parameters
- //! \param bt BufferedTransformation derived object
- //! \details This constructor will decode and extract the the fields fieldID and curve of the sequence ECParameters
+ /// \brief Construct an EC2N from BER encoded parameters
+ /// \param bt BufferedTransformation derived object
+ /// \details This constructor will decode and extract the the fields fieldID and curve of the sequence ECParameters
EC2N(BufferedTransformation &bt);
- //! \brief Encode the fields fieldID and curve of the sequence ECParameters
- //! \param bt BufferedTransformation derived object
+ /// \brief Encode the fields fieldID and curve of the sequence ECParameters
+ /// \param bt BufferedTransformation derived object
void DEREncode(BufferedTransformation &bt) const;
bool Equal(const Point &P, const Point &Q) const;
@@ -97,15 +97,15 @@ private:
CRYPTOPP_DLL_TEMPLATE_CLASS DL_FixedBasePrecomputationImpl;
CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupPrecomputation;
-//! \class EcPrecomputation
-//! \brief Elliptic Curve precomputation
-//! \tparam EC elliptic curve field
+/// \class EcPrecomputation
+/// \brief Elliptic Curve precomputation
+/// \tparam EC elliptic curve field
template class EcPrecomputation;
-//! \class EcPrecomputation
-//! \brief EC2N precomputation specialization
-//! \details Implementation of DL_GroupPrecomputation
-//! \sa DL_GroupPrecomputation
+/// \class EcPrecomputation
+/// \brief EC2N precomputation specialization
+/// \details Implementation of DL_GroupPrecomputation
+/// \sa DL_GroupPrecomputation
template<> class EcPrecomputation : public DL_GroupPrecomputation
{
public:
diff --git a/eccrypto.h b/eccrypto.h
index f6016c07..3072f592 100644
--- a/eccrypto.h
+++ b/eccrypto.h
@@ -1,8 +1,8 @@
// eccrypto.h - originally written and placed in the public domain by Wei Dai
// deterministic signatures added by by Douglas Roark
-//! \file eccrypto.h
-//! \brief Classes and functions for Elliptic Curves over prime and binary fields
+/// \file eccrypto.h
+/// \brief Classes and functions for Elliptic Curves over prime and binary fields
#ifndef CRYPTOPP_ECCRYPTO_H
#define CRYPTOPP_ECCRYPTO_H
@@ -29,10 +29,10 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \brief Elliptic Curve Parameters
-//! \tparam EC elliptic curve field
-//! \details This class corresponds to the ASN.1 sequence of the same name
-//! in ANSI X9.62 and SEC 1. EC is currently defined for ECP and EC2N.
+/// \brief Elliptic Curve Parameters
+/// \tparam EC elliptic curve field
+/// \details This class corresponds to the ASN.1 sequence of the same name
+/// in ANSI X9.62 and SEC 1. EC is currently defined for ECP and EC2N.
template
class DL_GroupParameters_EC : public DL_GroupParametersImpl >
{
@@ -46,33 +46,33 @@ public:
virtual ~DL_GroupParameters_EC() {}
- //! \brief Construct an EC GroupParameters
+ /// \brief Construct an EC GroupParameters
DL_GroupParameters_EC() : m_compress(false), m_encodeAsOID(true) {}
- //! \brief Construct an EC GroupParameters
- //! \param oid the OID of a curve
+ /// \brief Construct an EC GroupParameters
+ /// \param oid the OID of a curve
DL_GroupParameters_EC(const OID &oid)
: m_compress(false), m_encodeAsOID(true) {Initialize(oid);}
- //! \brief Construct an EC GroupParameters
- //! \param ec the elliptic curve
- //! \param G the base point
- //! \param n the order of the base point
- //! \param k the cofactor
+ /// \brief Construct an EC GroupParameters
+ /// \param ec the elliptic curve
+ /// \param G the base point
+ /// \param n the order of the base point
+ /// \param k the cofactor
DL_GroupParameters_EC(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero())
: m_compress(false), m_encodeAsOID(true) {Initialize(ec, G, n, k);}
- //! \brief Construct an EC GroupParameters
- //! \param bt BufferedTransformation with group parameters
+ /// \brief Construct an EC GroupParameters
+ /// \param bt BufferedTransformation with group parameters
DL_GroupParameters_EC(BufferedTransformation &bt)
: m_compress(false), m_encodeAsOID(true) {BERDecode(bt);}
- //! \brief Initialize an EC GroupParameters using {EC,G,n,k}
- //! \param ec the elliptic curve
- //! \param G the base point
- //! \param n the order of the base point
- //! \param k the cofactor
- //! \details This Initialize() function overload initializes group parameters from existing parameters.
+ /// \brief Initialize an EC GroupParameters using {EC,G,n,k}
+ /// \param ec the elliptic curve
+ /// \param G the base point
+ /// \param n the order of the base point
+ /// \param k the cofactor
+ /// \details This Initialize() function overload initializes group parameters from existing parameters.
void Initialize(const EllipticCurve &ec, const Point &G, const Integer &n, const Integer &k = Integer::Zero())
{
this->m_groupPrecomputation.SetCurve(ec);
@@ -81,9 +81,9 @@ public:
m_k = k;
}
- //! \brief Initialize a DL_GroupParameters_EC {EC,G,n,k}
- //! \param oid the OID of a curve
- //! \details This Initialize() function overload initializes group parameters from existing parameters.
+ /// \brief Initialize a DL_GroupParameters_EC {EC,G,n,k}
+ /// \param oid the OID of a curve
+ /// \details This Initialize() function overload initializes group parameters from existing parameters.
void Initialize(const OID &oid);
// NameValuePairs
@@ -91,7 +91,7 @@ public:
void AssignFrom(const NameValuePairs &source);
// GeneratibleCryptoMaterial interface
- //! this implementation doesn't actually generate a curve, it just initializes the parameters with existing values
+ /// this implementation doesn't actually generate a curve, it just initializes the parameters with existing values
/*! parameters: (Curve, SubgroupGenerator, SubgroupOrder, Cofactor (optional)), or (GroupOID) */
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg);
@@ -174,9 +174,9 @@ protected:
mutable bool m_compress, m_encodeAsOID; // presentation details
};
-//! \class DL_PublicKey_EC
-//! \brief Elliptic Curve Discrete Log (DL) public key
-//! \tparam EC elliptic curve field
+/// \class DL_PublicKey_EC
+/// \brief Elliptic Curve Discrete Log (DL) public key
+/// \tparam EC elliptic curve field
template
class DL_PublicKey_EC : public DL_PublicKeyImpl >
{
@@ -185,19 +185,19 @@ public:
virtual ~DL_PublicKey_EC() {}
- //! \brief Initialize an EC Public Key using {GP,Q}
- //! \param params group parameters
- //! \param Q the public point
- //! \details This Initialize() function overload initializes a public key from existing parameters.
+ /// \brief Initialize an EC Public Key using {GP,Q}
+ /// \param params group parameters
+ /// \param Q the public point
+ /// \details This Initialize() function overload initializes a public key from existing parameters.
void Initialize(const DL_GroupParameters_EC ¶ms, const Element &Q)
{this->AccessGroupParameters() = params; this->SetPublicElement(Q);}
- //! \brief Initialize an EC Public Key using {EC,G,n,Q}
- //! \param ec the elliptic curve
- //! \param G the base point
- //! \param n the order of the base point
- //! \param Q the public point
- //! \details This Initialize() function overload initializes a public key from existing parameters.
+ /// \brief Initialize an EC Public Key using {EC,G,n,Q}
+ /// \param ec the elliptic curve
+ /// \param G the base point
+ /// \param n the order of the base point
+ /// \param Q the public point
+ /// \details This Initialize() function overload initializes a public key from existing parameters.
void Initialize(const EC &ec, const Element &G, const Integer &n, const Element &Q)
{this->AccessGroupParameters().Initialize(ec, G, n); this->SetPublicElement(Q);}
@@ -206,9 +206,9 @@ public:
void DEREncodePublicKey(BufferedTransformation &bt) const;
};
-//! \class DL_PrivateKey_EC
-//! \brief Elliptic Curve Discrete Log (DL) private key
-//! \tparam EC elliptic curve field
+/// \class DL_PrivateKey_EC
+/// \brief Elliptic Curve Discrete Log (DL) private key
+/// \tparam EC elliptic curve field
template
class DL_PrivateKey_EC : public DL_PrivateKeyImpl >
{
@@ -217,39 +217,39 @@ public:
virtual ~DL_PrivateKey_EC();
- //! \brief Initialize an EC Private Key using {GP,x}
- //! \param params group parameters
- //! \param x the private exponent
- //! \details This Initialize() function overload initializes a private key from existing parameters.
+ /// \brief Initialize an EC Private Key using {GP,x}
+ /// \param params group parameters
+ /// \param x the private exponent
+ /// \details This Initialize() function overload initializes a private key from existing parameters.
void Initialize(const DL_GroupParameters_EC ¶ms, const Integer &x)
{this->AccessGroupParameters() = params; this->SetPrivateExponent(x);}
- //! \brief Initialize an EC Private Key using {EC,G,n,x}
- //! \param ec the elliptic curve
- //! \param G the base point
- //! \param n the order of the base point
- //! \param x the private exponent
- //! \details This Initialize() function overload initializes a private key from existing parameters.
+ /// \brief Initialize an EC Private Key using {EC,G,n,x}
+ /// \param ec the elliptic curve
+ /// \param G the base point
+ /// \param n the order of the base point
+ /// \param x the private exponent
+ /// \details This Initialize() function overload initializes a private key from existing parameters.
void Initialize(const EC &ec, const Element &G, const Integer &n, const Integer &x)
{this->AccessGroupParameters().Initialize(ec, G, n); this->SetPrivateExponent(x);}
- //! \brief Create an EC private key
- //! \param rng a RandomNumberGenerator derived class
- //! \param params the EC group parameters
- //! \details This function overload of Initialize() creates a new private key because it
- //! takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
- //! then use one of the other Initialize() overloads.
+ /// \brief Create an EC private key
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param params the EC group parameters
+ /// \details This function overload of Initialize() creates a new private key because it
+ /// takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
+ /// then use one of the other Initialize() overloads.
void Initialize(RandomNumberGenerator &rng, const DL_GroupParameters_EC ¶ms)
{this->GenerateRandom(rng, params);}
- //! \brief Create an EC private key
- //! \param rng a RandomNumberGenerator derived class
- //! \param ec the elliptic curve
- //! \param G the base point
- //! \param n the order of the base point
- //! \details This function overload of Initialize() creates a new private key because it
- //! takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
- //! then use one of the other Initialize() overloads.
+ /// \brief Create an EC private key
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param ec the elliptic curve
+ /// \param G the base point
+ /// \param n the order of the base point
+ /// \details This function overload of Initialize() creates a new private key because it
+ /// takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
+ /// then use one of the other Initialize() overloads.
void Initialize(RandomNumberGenerator &rng, const EC &ec, const Element &G, const Integer &n)
{this->GenerateRandom(rng, DL_GroupParameters_EC(ec, G, n));}
@@ -262,21 +262,21 @@ public:
template
DL_PrivateKey_EC::~DL_PrivateKey_EC() {}
-//! \class ECDH
-//! \brief Elliptic Curve Diffie-Hellman
-//! \tparam EC elliptic curve field
-//! \tparam COFACTOR_OPTION cofactor multiplication option
-//! \sa CofactorMultiplicationOption, Elliptic Curve Diffie-Hellman, AKA ECDH
+/// \class ECDH
+/// \brief Elliptic Curve Diffie-Hellman
+/// \tparam EC elliptic curve field
+/// \tparam COFACTOR_OPTION cofactor multiplication option
+/// \sa CofactorMultiplicationOption, Elliptic Curve Diffie-Hellman, AKA ECDH
template ::DefaultCofactorOption>
struct ECDH
{
typedef DH_Domain, COFACTOR_OPTION> Domain;
};
-//! \class ECMQV
-//! \brief Elliptic Curve Menezes-Qu-Vanstone
-//! \tparam EC elliptic curve field
-//! \tparam COFACTOR_OPTION cofactor multiplication option
+/// \class ECMQV
+/// \brief Elliptic Curve Menezes-Qu-Vanstone
+/// \tparam EC elliptic curve field
+/// \tparam COFACTOR_OPTION cofactor multiplication option
/// \sa CofactorMultiplicationOption, Elliptic Curve Menezes-Qu-Vanstone, AKA ECMQV
template ::DefaultCofactorOption>
struct ECMQV
@@ -284,13 +284,13 @@ struct ECMQV
typedef MQV_Domain, COFACTOR_OPTION> Domain;
};
-//! \class ECHMQV
-//! \brief Hashed Elliptic Curve Menezes-Qu-Vanstone
-//! \tparam EC elliptic curve field
-//! \tparam COFACTOR_OPTION cofactor multiplication option
-//! \details This implementation follows Hugo Krawczyk's HMQV: A High-Performance
-//! Secure Diffie-Hellman Protocol. Note: this implements HMQV only. HMQV-C with Key Confirmation is not provided.
-//! \sa CofactorMultiplicationOption
+/// \class ECHMQV
+/// \brief Hashed Elliptic Curve Menezes-Qu-Vanstone
+/// \tparam EC elliptic curve field
+/// \tparam COFACTOR_OPTION cofactor multiplication option
+/// \details This implementation follows Hugo Krawczyk's HMQV: A High-Performance
+/// Secure Diffie-Hellman Protocol. Note: this implements HMQV only. HMQV-C with Key Confirmation is not provided.
+/// \sa CofactorMultiplicationOption
template ::DefaultCofactorOption, class HASH = SHA256>
struct ECHMQV
{
@@ -302,14 +302,14 @@ typedef ECHMQV< ECP, DL_GroupParameters_EC< ECP >::DefaultCofactorOption, SHA256
typedef ECHMQV< ECP, DL_GroupParameters_EC< ECP >::DefaultCofactorOption, SHA384 >::Domain ECHMQV384;
typedef ECHMQV< ECP, DL_GroupParameters_EC< ECP >::DefaultCofactorOption, SHA512 >::Domain ECHMQV512;
-//! \class ECFHMQV
-//! \brief Fully Hashed Elliptic Curve Menezes-Qu-Vanstone
-//! \tparam EC elliptic curve field
-//! \tparam COFACTOR_OPTION cofactor multiplication option
-//! \details This implementation follows Augustin P. Sarr and Philippe Elbaz–Vincent, and Jean–Claude Bajard's
-//! A Secure and Efficient Authenticated Diffie-Hellman Protocol.
-//! Note: this is FHMQV, Protocol 5, from page 11; and not FHMQV-C.
-//! \sa CofactorMultiplicationOption
+/// \class ECFHMQV
+/// \brief Fully Hashed Elliptic Curve Menezes-Qu-Vanstone
+/// \tparam EC elliptic curve field
+/// \tparam COFACTOR_OPTION cofactor multiplication option
+/// \details This implementation follows Augustin P. Sarr and Philippe Elbaz–Vincent, and Jean–Claude Bajard's
+/// A Secure and Efficient Authenticated Diffie-Hellman Protocol.
+/// Note: this is FHMQV, Protocol 5, from page 11; and not FHMQV-C.
+/// \sa CofactorMultiplicationOption
template ::DefaultCofactorOption, class HASH = SHA256>
struct ECFHMQV
{
@@ -321,9 +321,9 @@ typedef ECFHMQV< ECP, DL_GroupParameters_EC< ECP >::DefaultCofactorOption, SHA25
typedef ECFHMQV< ECP, DL_GroupParameters_EC< ECP >::DefaultCofactorOption, SHA384 >::Domain ECFHMQV384;
typedef ECFHMQV< ECP, DL_GroupParameters_EC< ECP >::DefaultCofactorOption, SHA512 >::Domain ECFHMQV512;
-//! \class DL_Keys_EC
-//! \brief Elliptic Curve Discrete Log (DL) keys
-//! \tparam EC elliptic curve field
+/// \class DL_Keys_EC
+/// \brief Elliptic Curve Discrete Log (DL) keys
+/// \tparam EC elliptic curve field
template
struct DL_Keys_EC
{
@@ -335,9 +335,9 @@ struct DL_Keys_EC
template
struct ECDSA;
-//! \class DL_Keys_ECDSA
-//! \brief Elliptic Curve DSA keys
-//! \tparam EC elliptic curve field
+/// \class DL_Keys_ECDSA
+/// \brief Elliptic Curve DSA keys
+/// \tparam EC elliptic curve field
template
struct DL_Keys_ECDSA
{
@@ -345,9 +345,9 @@ struct DL_Keys_ECDSA
typedef DL_PrivateKey_WithSignaturePairwiseConsistencyTest, ECDSA > PrivateKey;
};
-//! \class DL_Algorithm_ECDSA
-//! \brief Elliptic Curve DSA (ECDSA) signature algorithm
-//! \tparam EC elliptic curve field
+/// \class DL_Algorithm_ECDSA
+/// \brief Elliptic Curve DSA (ECDSA) signature algorithm
+/// \tparam EC elliptic curve field
template
class DL_Algorithm_ECDSA : public DL_Algorithm_GDSA
{
@@ -355,12 +355,12 @@ public:
CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "ECDSA";}
};
-//! \class DL_Algorithm_ECDSA_RFC6979
-//! \brief Elliptic Curve DSA (ECDSA) signature algorithm based on RFC 6979
-//! \tparam EC elliptic curve field
-//! \sa RFC 6979, Deterministic Usage of the
-//! Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)
-//! \since Crypto++ 6.0
+/// \class DL_Algorithm_ECDSA_RFC6979
+/// \brief Elliptic Curve DSA (ECDSA) signature algorithm based on RFC 6979
+/// \tparam EC elliptic curve field
+/// \sa RFC 6979, Deterministic Usage of the
+/// Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)
+/// \since Crypto++ 6.0
template
class DL_Algorithm_ECDSA_RFC6979 : public DL_Algorithm_DSA_RFC6979
{
@@ -368,9 +368,9 @@ public:
CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "ECDSA-RFC6979";}
};
-//! \class DL_Algorithm_ECNR
-//! \brief Elliptic Curve NR (ECNR) signature algorithm
-//! \tparam EC elliptic curve field
+/// \class DL_Algorithm_ECNR
+/// \brief Elliptic Curve NR (ECNR) signature algorithm
+/// \tparam EC elliptic curve field
template
class DL_Algorithm_ECNR : public DL_Algorithm_NR
{
@@ -378,22 +378,22 @@ public:
CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "ECNR";}
};
-//! \class ECDSA
-//! \brief Elliptic Curve DSA (ECDSA) signature scheme
-//! \tparam EC elliptic curve field
-//! \tparam H HashTransformation derived class
-//! \sa ECDSA
+/// \class ECDSA
+/// \brief Elliptic Curve DSA (ECDSA) signature scheme
+/// \tparam EC elliptic curve field
+/// \tparam H HashTransformation derived class
+/// \sa ECDSA
template
struct ECDSA : public DL_SS, DL_Algorithm_ECDSA, DL_SignatureMessageEncodingMethod_DSA, H>
{
};
-//! \class ECDSA_RFC6979
-//! \brief Elliptic Curve DSA (ECDSA) deterministic signature scheme
-//! \tparam EC elliptic curve field
-//! \tparam H HashTransformation derived class
-//! \sa Deterministic Usage of the
-//! Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)
+/// \class ECDSA_RFC6979
+/// \brief Elliptic Curve DSA (ECDSA) deterministic signature scheme
+/// \tparam EC elliptic curve field
+/// \tparam H HashTransformation derived class
+/// \sa Deterministic Usage of the
+/// Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)
template
struct ECDSA_RFC6979 : public DL_SS<
DL_Keys_ECDSA,
@@ -405,10 +405,10 @@ struct ECDSA_RFC6979 : public DL_SS<
static std::string CRYPTOPP_API StaticAlgorithmName() {return std::string("ECDSA-RFC6979/") + H::StaticAlgorithmName();}
};
-//! \class ECNR
-//! \brief Elliptic Curve NR (ECNR) signature scheme
-//! \tparam EC elliptic curve field
-//! \tparam H HashTransformation derived class
+/// \class ECNR
+/// \brief Elliptic Curve NR (ECNR) signature scheme
+/// \tparam EC elliptic curve field
+/// \tparam H HashTransformation derived class
template
struct ECNR : public DL_SS, DL_Algorithm_ECNR, DL_SignatureMessageEncodingMethod_NR, H>
{
@@ -421,11 +421,11 @@ class DL_PublicKey_ECGDSA_ISO15946;
template
class DL_PrivateKey_ECGDSA_ISO15946;
-//! \class DL_PrivateKey_ECGDSA_ISO15946
-//! \brief Elliptic Curve German DSA key for ISO/IEC 15946
-//! \tparam EC elliptic curve field
-//! \sa ECGDSA_ISO15946
-//! \since Crypto++ 6.0
+/// \class DL_PrivateKey_ECGDSA_ISO15946
+/// \brief Elliptic Curve German DSA key for ISO/IEC 15946
+/// \tparam EC elliptic curve field
+/// \sa ECGDSA_ISO15946
+/// \since Crypto++ 6.0
template
class DL_PrivateKey_ECGDSA_ISO15946 : public DL_PrivateKeyImpl >
{
@@ -434,10 +434,10 @@ public:
virtual ~DL_PrivateKey_ECGDSA_ISO15946() {}
- //! \brief Initialize an EC Private Key using {GP,x}
- //! \param params group parameters
- //! \param x the private exponent
- //! \details This Initialize() function overload initializes a private key from existing parameters.
+ /// \brief Initialize an EC Private Key using {GP,x}
+ /// \param params group parameters
+ /// \param x the private exponent
+ /// \details This Initialize() function overload initializes a private key from existing parameters.
void Initialize(const DL_GroupParameters_EC ¶ms, const Integer &x)
{
this->AccessGroupParameters() = params;
@@ -445,12 +445,12 @@ public:
CRYPTOPP_ASSERT(x>=1 && x<=params.GetSubgroupOrder()-1);
}
- //! \brief Initialize an EC Private Key using {EC,G,n,x}
- //! \param ec the elliptic curve
- //! \param G the base point
- //! \param n the order of the base point
- //! \param x the private exponent
- //! \details This Initialize() function overload initializes a private key from existing parameters.
+ /// \brief Initialize an EC Private Key using {EC,G,n,x}
+ /// \param ec the elliptic curve
+ /// \param G the base point
+ /// \param n the order of the base point
+ /// \param x the private exponent
+ /// \details This Initialize() function overload initializes a private key from existing parameters.
void Initialize(const EC &ec, const Element &G, const Integer &n, const Integer &x)
{
this->AccessGroupParameters().Initialize(ec, G, n);
@@ -458,23 +458,23 @@ public:
CRYPTOPP_ASSERT(x>=1 && x<=this->AccessGroupParameters().GetSubgroupOrder()-1);
}
- //! \brief Create an EC private key
- //! \param rng a RandomNumberGenerator derived class
- //! \param params the EC group parameters
- //! \details This function overload of Initialize() creates a new private key because it
- //! takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
- //! then use one of the other Initialize() overloads.
+ /// \brief Create an EC private key
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param params the EC group parameters
+ /// \details This function overload of Initialize() creates a new private key because it
+ /// takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
+ /// then use one of the other Initialize() overloads.
void Initialize(RandomNumberGenerator &rng, const DL_GroupParameters_EC ¶ms)
{this->GenerateRandom(rng, params);}
- //! \brief Create an EC private key
- //! \param rng a RandomNumberGenerator derived class
- //! \param ec the elliptic curve
- //! \param G the base point
- //! \param n the order of the base point
- //! \details This function overload of Initialize() creates a new private key because it
- //! takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
- //! then use one of the other Initialize() overloads.
+ /// \brief Create an EC private key
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param ec the elliptic curve
+ /// \param G the base point
+ /// \param n the order of the base point
+ /// \details This function overload of Initialize() creates a new private key because it
+ /// takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
+ /// then use one of the other Initialize() overloads.
void Initialize(RandomNumberGenerator &rng, const EC &ec, const Element &G, const Integer &n)
{this->GenerateRandom(rng, DL_GroupParameters_EC(ec, G, n));}
@@ -504,11 +504,11 @@ public:
void DEREncodePrivateKey(BufferedTransformation &bt) const;
};
-//! \class DL_PublicKey_ECGDSA_ISO15946
-//! \brief Elliptic Curve German DSA key for ISO/IEC 15946
-//! \tparam EC elliptic curve field
-//! \sa ECGDSA_ISO15946
-//! \since Crypto++ 6.0
+/// \class DL_PublicKey_ECGDSA_ISO15946
+/// \brief Elliptic Curve German DSA key for ISO/IEC 15946
+/// \tparam EC elliptic curve field
+/// \sa ECGDSA_ISO15946
+/// \since Crypto++ 6.0
template
class DL_PublicKey_ECGDSA_ISO15946 : public DL_PublicKeyImpl >
{
@@ -519,19 +519,19 @@ public:
virtual ~DL_PublicKey_ECGDSA_ISO15946() {}
- //! \brief Initialize an EC Public Key using {GP,Q}
- //! \param params group parameters
- //! \param Q the public point
- //! \details This Initialize() function overload initializes a public key from existing parameters.
+ /// \brief Initialize an EC Public Key using {GP,Q}
+ /// \param params group parameters
+ /// \param Q the public point
+ /// \details This Initialize() function overload initializes a public key from existing parameters.
void Initialize(const DL_GroupParameters_EC ¶ms, const Element &Q)
{this->AccessGroupParameters() = params; this->SetPublicElement(Q);}
- //! \brief Initialize an EC Public Key using {EC,G,n,Q}
- //! \param ec the elliptic curve
- //! \param G the base point
- //! \param n the order of the base point
- //! \param Q the public point
- //! \details This Initialize() function overload initializes a public key from existing parameters.
+ /// \brief Initialize an EC Public Key using {EC,G,n,Q}
+ /// \param ec the elliptic curve
+ /// \param G the base point
+ /// \param n the order of the base point
+ /// \param Q the public point
+ /// \details This Initialize() function overload initializes a public key from existing parameters.
void Initialize(const EC &ec, const Element &G, const Integer &n, const Element &Q)
{this->AccessGroupParameters().Initialize(ec, G, n); this->SetPublicElement(Q);}
@@ -557,11 +557,11 @@ public:
void DEREncodePublicKey(BufferedTransformation &bt) const;
};
-//! \class DL_Keys_ECGDSA_ISO15946
-//! \brief Elliptic Curve German DSA keys for ISO/IEC 15946
-//! \tparam EC elliptic curve field
-//! \sa ECGDSA_ISO15946
-//! \since Crypto++ 6.0
+/// \class DL_Keys_ECGDSA_ISO15946
+/// \brief Elliptic Curve German DSA keys for ISO/IEC 15946
+/// \tparam EC elliptic curve field
+/// \sa ECGDSA_ISO15946
+/// \since Crypto++ 6.0
template
struct DL_Keys_ECGDSA_ISO15946
{
@@ -569,11 +569,11 @@ struct DL_Keys_ECGDSA_ISO15946
typedef DL_PrivateKey_ECGDSA_ISO15946 PrivateKey;
};
-//! \class DL_Algorithm_ECGDSA_ISO15946
-//! \brief Elliptic Curve German DSA signature algorithm
-//! \tparam EC elliptic curve field
-//! \sa ECGDSA_ISO15946
-//! \since Crypto++ 6.0
+/// \class DL_Algorithm_ECGDSA_ISO15946
+/// \brief Elliptic Curve German DSA signature algorithm
+/// \tparam EC elliptic curve field
+/// \sa ECGDSA_ISO15946
+/// \since Crypto++ 6.0
template
class DL_Algorithm_ECGDSA_ISO15946 : public DL_Algorithm_GDSA_ISO15946
{
@@ -581,14 +581,14 @@ public:
CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "ECGDSA";}
};
-//! \class ECGDSA
-//! \brief Elliptic Curve German Digital Signature Algorithm signature scheme
-//! \tparam EC elliptic curve field
-//! \tparam H HashTransformation derived class
-//! \sa Erwin Hess, Marcus Schafheutle, and Pascale Serf The Digital Signature Scheme
-//! ECGDSA (October 24, 2006)
-//! \since Crypto++ 6.0
+/// \class ECGDSA
+/// \brief Elliptic Curve German Digital Signature Algorithm signature scheme
+/// \tparam EC elliptic curve field
+/// \tparam H HashTransformation derived class
+/// \sa Erwin Hess, Marcus Schafheutle, and Pascale Serf The Digital Signature Scheme
+/// ECGDSA (October 24, 2006)
+/// \since Crypto++ 6.0
template
struct ECGDSA : public DL_SS<
DL_Keys_ECGDSA_ISO15946,
@@ -601,40 +601,40 @@ struct ECGDSA : public DL_SS<
// ******************************************
-//! \class ECIES
-//! \brief Elliptic Curve Integrated Encryption Scheme
-//! \tparam COFACTOR_OPTION cofactor multiplication option
-//! \tparam HASH HashTransformation derived class used for key drivation and MAC computation
-//! \tparam DHAES_MODE flag indicating if the MAC includes additional context parameters such as u·V, v·U and label
-//! \tparam LABEL_OCTETS flag indicating if the label size is specified in octets or bits
-//! \details ECIES is an Elliptic Curve based Integrated Encryption Scheme (IES). The scheme combines a Key Encapsulation
-//! Method (KEM) with a Data Encapsulation Method (DEM) and a MAC tag. The scheme is
-//! IND-CCA2, which is a strong notion of security.
-//! You should prefer an Integrated Encryption Scheme over homegrown schemes.
-//! \details The library's original implementation is based on an early P1363 draft, which itself appears to be based on an early Certicom
-//! SEC-1 draft (or an early SEC-1 draft was based on a P1363 draft). Crypto++ 4.2 used the early draft in its Integrated Ecryption
-//! Schemes with NoCofactorMultiplication, DHAES_MODE=false and LABEL_OCTETS=true.
-//! \details If you desire an Integrated Encryption Scheme with Crypto++ 4.2 compatibility, then use the ECIES template class with
-//! NoCofactorMultiplication, DHAES_MODE=false and LABEL_OCTETS=true.
-//! \details If you desire an Integrated Encryption Scheme with Bouncy Castle 1.54 and Botan 1.11 compatibility, then use the ECIES
-//! template class with NoCofactorMultiplication, DHAES_MODE=true and LABEL_OCTETS=false.
-//! \details The default template parameters ensure compatibility with Bouncy Castle 1.54 and Botan 1.11. The combination of
-//! IncompatibleCofactorMultiplication and DHAES_MODE=true is recommended for best efficiency and security.
-//! SHA1 is used for compatibility reasons, but it can be changed if desired. SHA-256 or another hash will likely improve the
-//! security provided by the MAC. The hash is also used in the key derivation function as a PRF.
-//! \details Below is an example of constructing a Crypto++ 4.2 compatible ECIES encryptor and decryptor.
-//!
-//! AutoSeededRandomPool prng;
-//! DL_PrivateKey_EC key;
-//! key.Initialize(prng, ASN1::secp160r1());
-//!
-//! ECIES::Decryptor decryptor(key);
-//! ECIES::Encryptor encryptor(decryptor);
-//!
-//! \sa DLIES, Elliptic Curve Integrated Encryption Scheme (ECIES),
-//! Martínez, Encinas, and Ávila's A Survey of the Elliptic
-//! Curve Integrated Encryption Schemes
-//! \since Crypto++ 4.0, Crypto++ 5.7 for Bouncy Castle and Botan compatibility
+/// \class ECIES
+/// \brief Elliptic Curve Integrated Encryption Scheme
+/// \tparam COFACTOR_OPTION cofactor multiplication option
+/// \tparam HASH HashTransformation derived class used for key drivation and MAC computation
+/// \tparam DHAES_MODE flag indicating if the MAC includes additional context parameters such as u·V, v·U and label
+/// \tparam LABEL_OCTETS flag indicating if the label size is specified in octets or bits
+/// \details ECIES is an Elliptic Curve based Integrated Encryption Scheme (IES). The scheme combines a Key Encapsulation
+/// Method (KEM) with a Data Encapsulation Method (DEM) and a MAC tag. The scheme is
+/// IND-CCA2, which is a strong notion of security.
+/// You should prefer an Integrated Encryption Scheme over homegrown schemes.
+/// \details The library's original implementation is based on an early P1363 draft, which itself appears to be based on an early Certicom
+/// SEC-1 draft (or an early SEC-1 draft was based on a P1363 draft). Crypto++ 4.2 used the early draft in its Integrated Ecryption
+/// Schemes with NoCofactorMultiplication, DHAES_MODE=false and LABEL_OCTETS=true.
+/// \details If you desire an Integrated Encryption Scheme with Crypto++ 4.2 compatibility, then use the ECIES template class with
+/// NoCofactorMultiplication, DHAES_MODE=false and LABEL_OCTETS=true.
+/// \details If you desire an Integrated Encryption Scheme with Bouncy Castle 1.54 and Botan 1.11 compatibility, then use the ECIES
+/// template class with NoCofactorMultiplication, DHAES_MODE=true and LABEL_OCTETS=false.
+/// \details The default template parameters ensure compatibility with Bouncy Castle 1.54 and Botan 1.11. The combination of
+/// IncompatibleCofactorMultiplication and DHAES_MODE=true is recommended for best efficiency and security.
+/// SHA1 is used for compatibility reasons, but it can be changed if desired. SHA-256 or another hash will likely improve the
+/// security provided by the MAC. The hash is also used in the key derivation function as a PRF.
+/// \details Below is an example of constructing a Crypto++ 4.2 compatible ECIES encryptor and decryptor.
+///
+/// AutoSeededRandomPool prng;
+/// DL_PrivateKey_EC key;
+/// key.Initialize(prng, ASN1::secp160r1());
+///
+/// ECIES::Decryptor decryptor(key);
+/// ECIES::Encryptor encryptor(decryptor);
+///
+/// \sa DLIES, Elliptic Curve Integrated Encryption Scheme (ECIES),
+/// Martínez, Encinas, and Ávila's A Survey of the Elliptic
+/// Curve Integrated Encryption Schemes
+/// \since Crypto++ 4.0, Crypto++ 5.7 for Bouncy Castle and Botan compatibility
template
struct ECIES
: public DL_ES<
diff --git a/ecp.h b/ecp.h
index 082eb636..2199b8c3 100644
--- a/ecp.h
+++ b/ecp.h
@@ -1,7 +1,7 @@
// ecp.h - originally written and placed in the public domain by Wei Dai
-//! \file ecp.h
-//! \brief Classes for Elliptic Curves over prime fields
+/// \file ecp.h
+/// \brief Classes for Elliptic Curves over prime fields
#ifndef CRYPTOPP_ECP_H
#define CRYPTOPP_ECP_H
@@ -22,8 +22,8 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class ECP
-//! \brief Elliptic Curve over GF(p), where p is prime
+/// \class ECP
+/// \brief Elliptic Curve over GF(p), where p is prime
class CRYPTOPP_DLL ECP : public AbstractGroup, public EncodedPoint
{
public:
@@ -33,29 +33,29 @@ public:
virtual ~ECP() {}
- //! \brief Construct an ECP
+ /// \brief Construct an ECP
ECP() {}
- //! \brief Copy construct an ECP
- //! \param ecp the other ECP object
- //! \param convertToMontgomeryRepresentation flag indicating if the curve should be converted to a MontgomeryRepresentation
- //! \sa ModularArithmetic, MontgomeryRepresentation
+ /// \brief Copy construct an ECP
+ /// \param ecp the other ECP object
+ /// \param convertToMontgomeryRepresentation flag indicating if the curve should be converted to a MontgomeryRepresentation
+ /// \sa ModularArithmetic, MontgomeryRepresentation
ECP(const ECP &ecp, bool convertToMontgomeryRepresentation = false);
- //! \brief Construct an ECP
- //! \param modulus the prime modulus
- //! \param a Field::Element
- //! \param b Field::Element
+ /// \brief Construct an ECP
+ /// \param modulus the prime modulus
+ /// \param a Field::Element
+ /// \param b Field::Element
ECP(const Integer &modulus, const FieldElement &a, const FieldElement &b)
: m_fieldPtr(new Field(modulus)), m_a(a.IsNegative() ? modulus+a : a), m_b(b) {}
- //! \brief Construct an ECP from BER encoded parameters
- //! \param bt BufferedTransformation derived object
- //! \details This constructor will decode and extract the the fields fieldID and curve of the sequence ECParameters
+ /// \brief Construct an ECP from BER encoded parameters
+ /// \param bt BufferedTransformation derived object
+ /// \details This constructor will decode and extract the the fields fieldID and curve of the sequence ECParameters
ECP(BufferedTransformation &bt);
- //! \brief Encode the fields fieldID and curve of the sequence ECParameters
- //! \param bt BufferedTransformation derived object
+ /// \brief Encode the fields fieldID and curve of the sequence ECParameters
+ /// \param bt BufferedTransformation derived object
void DEREncode(BufferedTransformation &bt) const;
bool Equal(const Point &P, const Point &Q) const;
@@ -104,16 +104,16 @@ private:
CRYPTOPP_DLL_TEMPLATE_CLASS DL_FixedBasePrecomputationImpl;
CRYPTOPP_DLL_TEMPLATE_CLASS DL_GroupPrecomputation;
-//! \class EcPrecomputation
-//! \brief Elliptic Curve precomputation
-//! \tparam EC elliptic curve field
+/// \class EcPrecomputation
+/// \brief Elliptic Curve precomputation
+/// \tparam EC elliptic curve field
template class EcPrecomputation;
-//! \class EcPrecomputation
-//! \brief ECP precomputation specialization
-//! \details Implementation of DL_GroupPrecomputation with input and output
-//! conversions for Montgomery modular multiplication.
-//! \sa DL_GroupPrecomputation, ModularArithmetic, MontgomeryRepresentation
+/// \class EcPrecomputation
+/// \brief ECP precomputation specialization
+/// \details Implementation of DL_GroupPrecomputation with input and output
+/// conversions for Montgomery modular multiplication.
+/// \sa DL_GroupPrecomputation, ModularArithmetic, MontgomeryRepresentation
template<> class EcPrecomputation : public DL_GroupPrecomputation
{
public:
diff --git a/ecpoint.h b/ecpoint.h
index 57f9f55a..5b726e4c 100644
--- a/ecpoint.h
+++ b/ecpoint.h
@@ -1,9 +1,9 @@
// ecpoint.h - written and placed in the public domain by Jeffrey Walton
// Data structures moved from ecp.h and ec2n.h. Added EncodedPoint interface
-//! \file ecpoint.h
-//! \brief Classes for Elliptic Curve points
-//! \since Crypto++ 6.0
+/// \file ecpoint.h
+/// \brief Classes for Elliptic Curve points
+/// \since Crypto++ 6.0
#ifndef CRYPTOPP_ECPOINT_H
#define CRYPTOPP_ECPOINT_H
@@ -15,31 +15,31 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class ECPPoint
-//! \brief Elliptical Curve Point over GF(p), where p is prime
-//! \since Crypto++ 2.0
+/// \class ECPPoint
+/// \brief Elliptical Curve Point over GF(p), where p is prime
+/// \since Crypto++ 2.0
struct CRYPTOPP_DLL ECPPoint
{
virtual ~ECPPoint() {}
- //! \brief Construct an ECPPoint
- //! \details identity is set to true
+ /// \brief Construct an ECPPoint
+ /// \details identity is set to true
ECPPoint() : identity(true) {}
- //! \brief Construct an ECPPoint from coordinates
- //! \details identity is set to false
+ /// \brief Construct an ECPPoint from coordinates
+ /// \details identity is set to false
ECPPoint(const Integer &x, const Integer &y)
: x(x), y(y), identity(false) {}
- //! \brief Tests points for equality
- //! \param t the other point
- //! \returns true if the points are equal, false otherwise
+ /// \brief Tests points for equality
+ /// \param t the other point
+ /// \returns true if the points are equal, false otherwise
bool operator==(const ECPPoint &t) const
{return (identity && t.identity) || (!identity && !t.identity && x==t.x && y==t.y);}
- //! \brief Tests points for ordering
- //! \param t the other point
- //! \returns true if this point is less than other, false otherwise
+ /// \brief Tests points for ordering
+ /// \param t the other point
+ /// \returns true if this point is less than other, false otherwise
bool operator< (const ECPPoint &t) const
{return identity ? !t.identity : (!t.identity && (x;
-//! \class EC2NPoint
-//! \brief Elliptical Curve Point over GF(2^n)
-//! \since Crypto++ 2.0
+/// \class EC2NPoint
+/// \brief Elliptical Curve Point over GF(2^n)
+/// \since Crypto++ 2.0
struct CRYPTOPP_DLL EC2NPoint
{
virtual ~EC2NPoint() {}
- //! \brief Construct an EC2NPoint
- //! \details identity is set to true
+ /// \brief Construct an EC2NPoint
+ /// \details identity is set to true
EC2NPoint() : identity(true) {}
- //! \brief Construct an EC2NPoint from coordinates
- //! \details identity is set to false
+ /// \brief Construct an EC2NPoint from coordinates
+ /// \details identity is set to false
EC2NPoint(const PolynomialMod2 &x, const PolynomialMod2 &y)
: x(x), y(y), identity(false) {}
- //! \brief Tests points for equality
- //! \param t the other point
- //! \returns true if the points are equal, false otherwise
+ /// \brief Tests points for equality
+ /// \param t the other point
+ /// \returns true if the points are equal, false otherwise
bool operator==(const EC2NPoint &t) const
{return (identity && t.identity) || (!identity && !t.identity && x==t.x && y==t.y);}
- //! \brief Tests points for ordering
- //! \param t the other point
- //! \returns true if this point is less than other, false otherwise
+ /// \brief Tests points for ordering
+ /// \param t the other point
+ /// \returns true if this point is less than other, false otherwise
bool operator< (const EC2NPoint &t) const
{return identity ? !t.identity : (!t.identity && (x;
-//! \class EncodedPoint
-//! \brief Abstract class for encoding and decoding ellicptic curve points
-//! \tparam Point ellicptic curve point
-//! \details EncodedPoint is an interface for encoding and decoding elliptic curve points.
-//! The template parameter Point should be a class like ECP or EC2N.
-//! \since Crypto++ 6.0
+/// \class EncodedPoint
+/// \brief Abstract class for encoding and decoding ellicptic curve points
+/// \tparam Point ellicptic curve point
+/// \details EncodedPoint is an interface for encoding and decoding elliptic curve points.
+/// The template parameter Point should be a class like ECP or EC2N.
+/// \since Crypto++ 6.0
template
class EncodedPoint
{
public:
virtual ~EncodedPoint() {}
- //! \brief Decodes an elliptic curve point
- //! \param P point which is decoded
- //! \param bt source BufferedTransformation
- //! \param len number of bytes to read from the BufferedTransformation
- //! \returns true if a point was decoded, false otherwise
+ /// \brief Decodes an elliptic curve point
+ /// \param P point which is decoded
+ /// \param bt source BufferedTransformation
+ /// \param len number of bytes to read from the BufferedTransformation
+ /// \returns true if a point was decoded, false otherwise
virtual bool DecodePoint(Point &P, BufferedTransformation &bt, size_t len) const =0;
- //! \brief Decodes an elliptic curve point
- //! \param P point which is decoded
- //! \param encodedPoint byte array with the encoded point
- //! \param len the size of the array
- //! \returns true if a point was decoded, false otherwise
+ /// \brief Decodes an elliptic curve point
+ /// \param P point which is decoded
+ /// \param encodedPoint byte array with the encoded point
+ /// \param len the size of the array
+ /// \returns true if a point was decoded, false otherwise
virtual bool DecodePoint(Point &P, const byte *encodedPoint, size_t len) const =0;
- //! \brief Verifies points on elliptic curve
- //! \param P point to verify
- //! \returns true if the point is valid, false otherwise
+ /// \brief Verifies points on elliptic curve
+ /// \param P point to verify
+ /// \returns true if the point is valid, false otherwise
virtual bool VerifyPoint(const Point &P) const =0;
- //! \brief Determines encoded point size
- //! \param compressed flag indicating if the point is compressed
- //! \returns the minimum number of bytes required to encode the point
+ /// \brief Determines encoded point size
+ /// \param compressed flag indicating if the point is compressed
+ /// \returns the minimum number of bytes required to encode the point
virtual unsigned int EncodedPointSize(bool compressed = false) const =0;
- //! \brief Encodes an elliptic curve point
- //! \param P point which is decoded
- //! \param encodedPoint byte array for the encoded point
- //! \param compressed flag indicating if the point is compressed
- //! \details encodedPoint must be at least EncodedPointSize() in length
+ /// \brief Encodes an elliptic curve point
+ /// \param P point which is decoded
+ /// \param encodedPoint byte array for the encoded point
+ /// \param compressed flag indicating if the point is compressed
+ /// \details encodedPoint must be at least EncodedPointSize() in length
virtual void EncodePoint(byte *encodedPoint, const Point &P, bool compressed) const =0;
- //! \brief Encodes an elliptic curve point
- //! \param bt target BufferedTransformation
- //! \param P point which is encoded
- //! \param compressed flag indicating if the point is compressed
+ /// \brief Encodes an elliptic curve point
+ /// \param bt target BufferedTransformation
+ /// \param P point which is encoded
+ /// \param compressed flag indicating if the point is compressed
virtual void EncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const =0;
- //! \brief BER Decodes an elliptic curve point
- //! \param bt source BufferedTransformation
- //! \returns the decoded elliptic curve point
+ /// \brief BER Decodes an elliptic curve point
+ /// \param bt source BufferedTransformation
+ /// \returns the decoded elliptic curve point
virtual Point BERDecodePoint(BufferedTransformation &bt) const =0;
- //! \brief DER Encodes an elliptic curve point
- //! \param bt target BufferedTransformation
- //! \param P point which is encoded
- //! \param compressed flag indicating if the point is compressed
+ /// \brief DER Encodes an elliptic curve point
+ /// \param bt target BufferedTransformation
+ /// \param P point which is encoded
+ /// \param compressed flag indicating if the point is compressed
virtual void DEREncodePoint(BufferedTransformation &bt, const Point &P, bool compressed) const =0;
};
diff --git a/elgamal.h b/elgamal.h
index 1b7906c8..79344b62 100644
--- a/elgamal.h
+++ b/elgamal.h
@@ -1,7 +1,7 @@
// elgamal.h - originally written and placed in the public domain by Wei Dai
-//! \file elgamal.h
-//! \brief Classes and functions for ElGamal key agreement and encryption schemes
+/// \file elgamal.h
+/// \brief Classes and functions for ElGamal key agreement and encryption schemes
#ifndef CRYPTOPP_ELGAMAL_H
#define CRYPTOPP_ELGAMAL_H
@@ -16,9 +16,9 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class ElGamalBase
-//! \brief ElGamal key agreement and encryption schemes base class
-//! \since Crypto++ 1.0
+/// \class ElGamalBase
+/// \brief ElGamal key agreement and encryption schemes base class
+/// \since Crypto++ 1.0
class CRYPTOPP_NO_VTABLE ElGamalBase : public DL_KeyAgreementAlgorithm_DH,
public DL_KeyDerivationAlgorithm,
public DL_SymmetricEncryptionAlgorithm
@@ -93,9 +93,9 @@ public:
virtual const DL_GroupParameters_GFP & GetGroupParameters() const =0;
};
-//! \class ElGamalObjectImpl
-//! \brief ElGamal key agreement and encryption schemes default implementation
-//! \since Crypto++ 1.0
+/// \class ElGamalObjectImpl
+/// \brief ElGamal key agreement and encryption schemes default implementation
+/// \since Crypto++ 1.0
template
class ElGamalObjectImpl : public DL_ObjectImplBase, public ElGamalBase
{
@@ -116,8 +116,8 @@ protected:
const DL_SymmetricEncryptionAlgorithm & GetSymmetricEncryptionAlgorithm() const {return *this;}
};
-//! \class ElGamalKeys
-//! \brief ElGamal key agreement and encryption schemes keys
+/// \class ElGamalKeys
+/// \brief ElGamal key agreement and encryption schemes keys
struct ElGamalKeys
{
typedef DL_CryptoKeys_GFP::GroupParameters GroupParameters;
@@ -125,9 +125,9 @@ struct ElGamalKeys
typedef DL_PublicKey_GFP_OldFormat PublicKey;
};
-//! \class ElGamal
-//! \brief ElGamal encryption scheme with non-standard padding
-//! \since Crypto++ 1.0
+/// \class ElGamal
+/// \brief ElGamal encryption scheme with non-standard padding
+/// \since Crypto++ 1.0
struct ElGamal
{
typedef DL_CryptoSchemeOptions SchemeOptions;
@@ -135,9 +135,9 @@ struct ElGamal
CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "ElgamalEnc/Crypto++Padding";}
typedef SchemeOptions::GroupParameters GroupParameters;
- //! implements PK_Encryptor interface
+ /// implements PK_Encryptor interface
typedef PK_FinalTemplate, SchemeOptions, SchemeOptions::PublicKey> > Encryptor;
- //! implements PK_Decryptor interface
+ /// implements PK_Decryptor interface
typedef PK_FinalTemplate, SchemeOptions, SchemeOptions::PrivateKey> > Decryptor;
};
diff --git a/emsa2.h b/emsa2.h
index 1ee4b76b..a156a75e 100644
--- a/emsa2.h
+++ b/emsa2.h
@@ -1,7 +1,7 @@
// emsa2.h - originally written and placed in the public domain by Wei Dai
-//! \file emsa2.h
-//! \brief Classes and functions for various padding schemes used in public key algorithms
+/// \file emsa2.h
+/// \brief Classes and functions for various padding schemes used in public key algorithms
#ifndef CRYPTOPP_EMSA2_H
#define CRYPTOPP_EMSA2_H
@@ -57,7 +57,7 @@ CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId;
CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId;
#endif
-//! _
+/// _
class CRYPTOPP_DLL EMSA2Pad : public EMSA2HashIdLookup
{
public:
@@ -72,7 +72,7 @@ public:
byte *representative, size_t representativeBitLength) const;
};
-//! EMSA2, for use with RWSS and RSA_ISO
+/// EMSA2, for use with RWSS and RSA_ISO
/*! Only the following hash functions are supported by this signature standard:
\dontinclude emsa2.h
\skip EMSA2HashId can be instantiated
diff --git a/eprecomp.h b/eprecomp.h
index 57b99f1d..210f678c 100644
--- a/eprecomp.h
+++ b/eprecomp.h
@@ -1,7 +1,7 @@
// eprecomp.h - originally written and placed in the public domain by Wei Dai
-//! \file eprecomp.h
-//! \brief Classes for precomputation in a group
+/// \file eprecomp.h
+/// \brief Classes for precomputation in a group
#ifndef CRYPTOPP_EPRECOMP_H
#define CRYPTOPP_EPRECOMP_H
diff --git a/esign.h b/esign.h
index dcda42c4..7faeca55 100644
--- a/esign.h
+++ b/esign.h
@@ -1,8 +1,8 @@
// esign.h - originally written and placed in the public domain by Wei Dai
-//! \file esign.h
-//! \brief Classes providing ESIGN signature schemes as defined in IEEE P1363a
-//! \since Crypto++ 5.0
+/// \file esign.h
+/// \brief Classes providing ESIGN signature schemes as defined in IEEE P1363a
+/// \since Crypto++ 5.0
#ifndef CRYPTOPP_ESIGN_H
#define CRYPTOPP_ESIGN_H
@@ -15,18 +15,18 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class ESIGNFunction
-//! \brief ESIGN trapdoor function using the public key
-//! \since Crypto++ 5.0
+/// \class ESIGNFunction
+/// \brief ESIGN trapdoor function using the public key
+/// \since Crypto++ 5.0
class ESIGNFunction : public TrapdoorFunction, public ASN1CryptoMaterial
{
typedef ESIGNFunction ThisClass;
public:
- //! \brief Initialize a ESIGN public key with {n,e}
- //! \param n the modulus
- //! \param e the public exponent
+ /// \brief Initialize a ESIGN public key with {n,e}
+ /// \param n the modulus
+ /// \param e the public exponent
void Initialize(const Integer &n, const Integer &e)
{m_n = n; m_e = e;}
@@ -58,30 +58,30 @@ protected:
Integer m_n, m_e;
};
-//! \class InvertibleESIGNFunction
-//! \brief ESIGN trapdoor function using the private key
-//! \since Crypto++ 5.0
+/// \class InvertibleESIGNFunction
+/// \brief ESIGN trapdoor function using the private key
+/// \since Crypto++ 5.0
class InvertibleESIGNFunction : public ESIGNFunction, public RandomizedTrapdoorFunctionInverse, public PrivateKey
{
typedef InvertibleESIGNFunction ThisClass;
public:
- //! \brief Initialize a ESIGN private key with {n,e,p,q}
- //! \param n modulus
- //! \param e public exponent
- //! \param p first prime factor
- //! \param q second prime factor
- //! \details This Initialize() function overload initializes a private key from existing parameters.
+ /// \brief Initialize a ESIGN private key with {n,e,p,q}
+ /// \param n modulus
+ /// \param e public exponent
+ /// \param p first prime factor
+ /// \param q second prime factor
+ /// \details This Initialize() function overload initializes a private key from existing parameters.
void Initialize(const Integer &n, const Integer &e, const Integer &p, const Integer &q)
{m_n = n; m_e = e; m_p = p; m_q = q;}
- //! \brief Create a ESIGN private key
- //! \param rng a RandomNumberGenerator derived class
- //! \param modulusBits the size of the modulud, in bits
- //! \details This function overload of Initialize() creates a new private key because it
- //! takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
- //! then use one of the other Initialize() overloads.
+ /// \brief Create a ESIGN private key
+ /// \param rng a RandomNumberGenerator derived class
+ /// \param modulusBits the size of the modulud, in bits
+ /// \details This function overload of Initialize() creates a new private key because it
+ /// takes a RandomNumberGenerator() as a parameter. If you have an existing keypair,
+ /// then use one of the other Initialize() overloads.
void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits)
{GenerateRandomWithKeySize(rng, modulusBits);}
@@ -115,10 +115,10 @@ protected:
Integer m_p, m_q;
};
-//! \class EMSA5Pad
-//! \brief EMSA5 padding method
-//! \tparam T Mask Generation Function
-//! \since Crypto++ 5.0
+/// \class EMSA5Pad
+/// \brief EMSA5 padding method
+/// \tparam T Mask Generation Function
+/// \since Crypto++ 5.0
template
class EMSA5Pad : public PK_DeterministicSignatureMessageEncodingMethod
{
@@ -142,9 +142,9 @@ public:
}
};
-//! \class P1363_EMSA5
-//! \brief EMSA5 padding method, for use with ESIGN
-//! \since Crypto++ 5.0
+/// \class P1363_EMSA5
+/// \brief EMSA5 padding method, for use with ESIGN
+/// \since Crypto++ 5.0
struct P1363_EMSA5 : public SignatureStandard
{
typedef EMSA5Pad SignatureMessageEncodingMethod;
@@ -157,11 +157,11 @@ struct ESIGN_Keys
typedef InvertibleESIGNFunction PrivateKey;
};
-//! \class ESIGN
-//! \brief ESIGN signature scheme, IEEE P1363a
-//! \tparam H HashTransformation derived class
-//! \tparam STANDARD Signature encoding method
-//! \since Crypto++ 5.0
+/// \class ESIGN
+/// \brief ESIGN signature scheme, IEEE P1363a
+/// \tparam H HashTransformation derived class
+/// \tparam STANDARD Signature encoding method
+/// \since Crypto++ 5.0
template
struct ESIGN : public TF_SS
{
diff --git a/factory.h b/factory.h
index df69f0bb..ff2be1d9 100644
--- a/factory.h
+++ b/factory.h
@@ -1,7 +1,7 @@
// factory.h - originally written and placed in the public domain by Wei Dai
-//! \file factory.h
-//! \brief Classes and functions for registering and locating library objects
+/// \file factory.h
+/// \brief Classes and functions for registering and locating library objects
#ifndef CRYPTOPP_OBJFACT_H
#define CRYPTOPP_OBJFACT_H
@@ -12,9 +12,9 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class ObjectFactory
-//! \brief Object factory interface for registering objects
-//! \tparam AbstractClass Base class interface of the object
+/// \class ObjectFactory
+/// \brief Object factory interface for registering objects
+/// \tparam AbstractClass Base class interface of the object
template
class ObjectFactory
{
@@ -23,10 +23,10 @@ public:
virtual AbstractClass * CreateObject() const =0;
};
-//! \class DefaultObjectFactory
-//! \brief Object factory for registering objects
-//! \tparam AbstractClass Base class interface of the object
-//! \tparam ConcreteClass Class object
+/// \class DefaultObjectFactory
+/// \brief Object factory for registering objects
+/// \tparam AbstractClass Base class interface of the object
+/// \tparam ConcreteClass Class object
template
class DefaultObjectFactory : public ObjectFactory
{
@@ -37,10 +37,10 @@ public:
}
};
-//! \class ObjectFactoryRegistry
-//! \brief Object factory registry
-//! \tparam AbstractClass Base class interface of the object
-//! \tparam instance unique identifier
+/// \class ObjectFactoryRegistry
+/// \brief Object factory registry
+/// \tparam AbstractClass Base class interface of the object
+/// \tparam instance unique identifier
template
class ObjectFactoryRegistry
{
@@ -105,11 +105,11 @@ ObjectFactoryRegistry & ObjectFactoryRegistry
struct RegisterDefaultFactoryFor
{
@@ -122,13 +122,13 @@ struct RegisterDefaultFactoryFor
}
};
-//! \fn RegisterAsymmetricCipherDefaultFactories
-//! \brief Register asymmetric ciphers
-//! \tparam SchemeClass interface of the object under a scheme
-//! \details Schemes include asymmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
-//! signature schemes (registers SchemeClass::Signer and SchemeClass::Verifier),
-//! symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
-//! authenticated symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor), etc.
+/// \fn RegisterAsymmetricCipherDefaultFactories
+/// \brief Register asymmetric ciphers
+/// \tparam SchemeClass interface of the object under a scheme
+/// \details Schemes include asymmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
+/// signature schemes (registers SchemeClass::Signer and SchemeClass::Verifier),
+/// symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
+/// authenticated symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor), etc.
template
void RegisterAsymmetricCipherDefaultFactories(const char *name=NULLPTR)
{
@@ -136,13 +136,13 @@ void RegisterAsymmetricCipherDefaultFactories(const char *name=NULLPTR)
RegisterDefaultFactoryFor((const char *)name);
}
-//! \fn RegisterSignatureSchemeDefaultFactories
-//! \brief Register signature schemes
-//! \tparam SchemeClass interface of the object under a scheme
-//! \details Schemes include asymmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
-//! signature schemes (registers SchemeClass::Signer and SchemeClass::Verifier),
-//! symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
-//! authenticated symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor), etc.
+/// \fn RegisterSignatureSchemeDefaultFactories
+/// \brief Register signature schemes
+/// \tparam SchemeClass interface of the object under a scheme
+/// \details Schemes include asymmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
+/// signature schemes (registers SchemeClass::Signer and SchemeClass::Verifier),
+/// symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
+/// authenticated symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor), etc.
template
void RegisterSignatureSchemeDefaultFactories(const char *name=NULLPTR)
{
@@ -150,13 +150,13 @@ void RegisterSignatureSchemeDefaultFactories(const char *name=NULLPTR)
RegisterDefaultFactoryFor((const char *)name);
}
-//! \fn RegisterSymmetricCipherDefaultFactories
-//! \brief Register symmetric ciphers
-//! \tparam SchemeClass interface of the object under a scheme
-//! \details Schemes include asymmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
-//! signature schemes (registers SchemeClass::Signer and SchemeClass::Verifier),
-//! symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
-//! authenticated symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor), etc.
+/// \fn RegisterSymmetricCipherDefaultFactories
+/// \brief Register symmetric ciphers
+/// \tparam SchemeClass interface of the object under a scheme
+/// \details Schemes include asymmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
+/// signature schemes (registers SchemeClass::Signer and SchemeClass::Verifier),
+/// symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
+/// authenticated symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor), etc.
template
void RegisterSymmetricCipherDefaultFactories(const char *name=NULLPTR)
{
@@ -164,13 +164,13 @@ void RegisterSymmetricCipherDefaultFactories(const char *name=NULLPTR)
RegisterDefaultFactoryFor((const char *)name);
}
-//! \fn RegisterAuthenticatedSymmetricCipherDefaultFactories
-//! \brief Register authenticated symmetric ciphers
-//! \tparam SchemeClass interface of the object under a scheme
-//! \details Schemes include asymmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
-//! signature schemes (registers SchemeClass::Signer and SchemeClass::Verifier),
-//! symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
-//! authenticated symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor), etc.
+/// \fn RegisterAuthenticatedSymmetricCipherDefaultFactories
+/// \brief Register authenticated symmetric ciphers
+/// \tparam SchemeClass interface of the object under a scheme
+/// \details Schemes include asymmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
+/// signature schemes (registers SchemeClass::Signer and SchemeClass::Verifier),
+/// symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor),
+/// authenticated symmetric ciphers (registers SchemeClass::Encryptor and SchemeClass::Decryptor), etc.
template
void RegisterAuthenticatedSymmetricCipherDefaultFactories(const char *name=NULLPTR)
{
diff --git a/fhmqv.h b/fhmqv.h
index 49120f02..38657ee8 100644
--- a/fhmqv.h
+++ b/fhmqv.h
@@ -4,9 +4,9 @@
#ifndef CRYPTOPP_FHMQV_H
#define CRYPTOPP_FHMQV_H
-//! \file fhmqv.h
-//! \brief Classes for Fully Hashed Menezes-Qu-Vanstone key agreement in GF(p)
-//! \since Crypto++ 5.6.4
+/// \file fhmqv.h
+/// \brief Classes for Fully Hashed Menezes-Qu-Vanstone key agreement in GF(p)
+/// \since Crypto++ 5.6.4
#include "gfpcrypt.h"
#include "algebra.h"
@@ -14,12 +14,12 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \brief Fully Hashed Menezes-Qu-Vanstone in GF(p)
-//! \details This implementation follows Augustin P. Sarr and Philippe Elbaz–Vincent, and Jean–Claude Bajard's
-//!