summaryrefslogtreecommitdiff
path: root/mqv.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-11-29 10:54:33 -0500
committerJeffrey Walton <noloader@gmail.com>2017-11-29 10:54:33 -0500
commit61ec50dabe14c5d4582ac187706ea27645b3562b (patch)
tree18a2eebb7adc8c9556ce132d7081a105fa058d6b /mqv.h
parent16ebfa72bf130c4725e652e4d3688d97d3feb0ee (diff)
downloadcryptopp-git-61ec50dabe14c5d4582ac187706ea27645b3562b.tar.gz
Change Doxygen comment style from //! to ///
Also see https://groups.google.com/forum/#!topic/cryptopp-users/A7-Xt5Knlzw
Diffstat (limited to 'mqv.h')
-rw-r--r--mqv.h144
1 files changed, 72 insertions, 72 deletions
diff --git a/mqv.h b/mqv.h
index c51a8452..23464c3c 100644
--- a/mqv.h
+++ b/mqv.h
@@ -1,7 +1,7 @@
// mqv.h - originally written and placed in the public domain by Wei Dai
-//! \file mqv.h
-//! \brief Classes for Menezes–Qu–Vanstone (MQV) key agreement
+/// \file mqv.h
+/// \brief Classes for Menezes–Qu–Vanstone (MQV) key agreement
#ifndef CRYPTOPP_MQV_H
#define CRYPTOPP_MQV_H
@@ -15,14 +15,14 @@
NAMESPACE_BEGIN(CryptoPP)
-//! \class MQV_Domain
-//! \brief MQV domain for performing authenticated key agreement
-//! \tparam GROUP_PARAMETERS doamin parameters
-//! \tparam COFACTOR_OPTION cofactor option
-//! \details GROUP_PARAMETERS parameters include the curve coefcients and the base point.
-//! Binary curves use a polynomial to represent its characteristic, while prime curves
-//! use a prime number.
-//! \sa MQV, HMQV, FHMQV, and AuthenticatedKeyAgreementDomain
+/// \class MQV_Domain
+/// \brief MQV domain for performing authenticated key agreement
+/// \tparam GROUP_PARAMETERS doamin parameters
+/// \tparam COFACTOR_OPTION cofactor option
+/// \details GROUP_PARAMETERS parameters include the curve coefcients and the base point.
+/// Binary curves use a polynomial to represent its characteristic, while prime curves
+/// use a prime number.
+/// \sa MQV, HMQV, FHMQV, and AuthenticatedKeyAgreementDomain
template <class GROUP_PARAMETERS, class COFACTOR_OPTION = typename GROUP_PARAMETERS::DefaultCofactorOption>
class MQV_Domain : public AuthenticatedKeyAgreementDomain
{
@@ -31,104 +31,104 @@ public:
typedef typename GroupParameters::Element Element;
typedef MQV_Domain<GROUP_PARAMETERS, COFACTOR_OPTION> Domain;
- //! \brief Construct a MQV domain
+ /// \brief Construct a MQV domain
MQV_Domain() {}
- //! \brief Construct a MQV domain
- //! \param params group parameters and options
+ /// \brief Construct a MQV domain
+ /// \param params group parameters and options
MQV_Domain(const GroupParameters &params)
: m_groupParameters(params) {}
- //! \brief Construct a MQV domain
- //! \param bt BufferedTransformation with group parameters and options
+ /// \brief Construct a MQV domain
+ /// \param bt BufferedTransformation with group parameters and options
MQV_Domain(BufferedTransformation &bt)
{m_groupParameters.BERDecode(bt);}
- //! \brief Construct a MQV 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 MQV 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 <class T1, class T2>
MQV_Domain(T1 v1, T2 v2)
{m_groupParameters.Initialize(v1, v2);}
- //! \brief Construct a MQV 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 MQV 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 <class T1, class T2, class T3>
MQV_Domain(T1 v1, T2 v2, T3 v3)
{m_groupParameters.Initialize(v1, v2, v3);}
- //! \brief Construct a MQV 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 third parameter
- //! \details v1, v2, v3 and v4 are passed directly to the GROUP_PARAMETERS object.
+ /// \brief Construct a MQV 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 third parameter
+ /// \details v1, v2, v3 and v4 are passed directly to the GROUP_PARAMETERS object.
template <class T1, class T2, class T3, class T4>
MQV_Domain(T1 v1, T2 v2, T3 v3, 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 Retrieves the crypto parameters for this domain
- //! \return the crypto parameters for this domain as a non-const reference
+ /// \brief Retrieves the crypto parameters for this domain
+ /// \return the crypto parameters for this domain as a non-const reference
CryptoParameters & AccessCryptoParameters() {return AccessAbstractGroupParameters();}
- //! \brief Provides the size of the agreed value
- //! \return size of agreed value produced in this domain
- //! \details The length is calculated using <tt>GetEncodedElementSize(false)</tt>, which means the
- //! element is encoded in a non-reversible format. A non-reversible format means its a raw byte array,
- //! and it lacks presentation format like an ASN.1 BIT_STRING or OCTET_STRING.
+ /// \brief Provides the size of the agreed value
+ /// \return size of agreed value produced in this domain
+ /// \details The length is calculated using <tt>GetEncodedElementSize(false)</tt>, which means the
+ /// element is encoded in a non-reversible format. A non-reversible format means its a raw byte array,
+ /// and it lacks presentation format like an ASN.1 BIT_STRING or OCTET_STRING.
unsigned int AgreedValueLength() const {return GetAbstractGroupParameters().GetEncodedElementSize(false);}
- //! \brief Provides the size of the static private key
- //! \return size of static private keys in this domain
- //! \details The length is calculated using the byte count of the subgroup order.
+ /// \brief Provides the size of the static private key
+ /// \return size of static private keys in this domain
+ /// \details The length is calculated using the byte count of the subgroup order.
unsigned int StaticPrivateKeyLength() const {return GetAbstractGroupParameters().GetSubgroupOrder().ByteCount();}
- //! \brief Provides the size of the static public key
- //! \return size of static public keys in this domain
- //! \details The length is calculated using <tt>GetEncodedElementSize(true)</tt>, which means the
- //! element is encoded in a reversible format. A reversible format means it has a presentation format,
- //! and its an ANS.1 encoded element or point.
+ /// \brief Provides the size of the static public key
+ /// \return size of static public keys in this domain
+ /// \details The length is calculated using <tt>GetEncodedElementSize(true)</tt>, which means the
+ /// element is encoded in a reversible format. A reversible format means it has a presentation format,
+ /// and its an ANS.1 encoded element or point.
unsigned int StaticPublicKeyLength() const {return GetAbstractGroupParameters().GetEncodedElementSize(true);}
- //! \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
- //! \details The private key is a random scalar used as an exponent in the range <tt>[1,MaxExponent()]</tt>.
- //! \pre <tt>COUNTOF(privateKey) == PrivateStaticKeyLength()</tt>
+ /// \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
+ /// \details The private key is a random scalar used as an exponent in the range <tt>[1,MaxExponent()]</tt>.
+ /// \pre <tt>COUNTOF(privateKey) == PrivateStaticKeyLength()</tt>
void GenerateStaticPrivateKey(RandomNumberGenerator &rng, byte *privateKey) const
{
Integer x(rng, Integer::One(), GetAbstractGroupParameters().GetMaxExponent());
x.Encode(privateKey, StaticPrivateKeyLength());
}
- //! \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
- //! \details The public key is an element or point on the curve, and its stored in a revrsible format.
- //! A reversible format means it has a presentation format, and its an ANS.1 encoded element or point.
- //! \pre <tt>COUNTOF(publicKey) == PublicStaticKeyLength()</tt>
+ /// \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
+ /// \details The public key is an element or point on the curve, and its stored in a revrsible format.
+ /// A reversible format means it has a presentation format, and its an ANS.1 encoded element or point.
+ /// \pre <tt>COUNTOF(publicKey) == PublicStaticKeyLength()</tt>
void GenerateStaticPublicKey(RandomNumberGenerator &rng, const byte *privateKey, byte *publicKey) const
{
CRYPTOPP_UNUSED(rng);
@@ -212,8 +212,8 @@ private:
GroupParameters m_groupParameters;
};
-//! Menezes-Qu-Vanstone in GF(p) with key validation, AKA <a href="http://www.weidai.com/scan-mirror/ka.html#MQV">MQV</a>
-//! \sa MQV, HMQV_Domain, FHMQV_Domain, AuthenticatedKeyAgreementDomain
+/// Menezes-Qu-Vanstone in GF(p) with key validation, AKA <a href="http://www.weidai.com/scan-mirror/ka.html#MQV">MQV</a>
+/// \sa MQV, HMQV_Domain, FHMQV_Domain, AuthenticatedKeyAgreementDomain
typedef MQV_Domain<DL_GroupParameters_GFP_DefaultSafePrime> MQV;
NAMESPACE_END