Update documentation

pull/873/head
Jeffrey Walton 2019-08-03 21:58:26 -04:00
parent 47a58050c6
commit 057c2b434b
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 15 additions and 8 deletions

View File

@ -31,7 +31,7 @@ public:
virtual ~FHMQV_Domain() {} virtual ~FHMQV_Domain() {}
/// \brief Construct a FHMQV domain /// \brief Construct a FHMQV domain
/// \params clientRole flag indicating initiator or recipient /// \param clientRole flag indicating initiator or recipient
/// \details <tt>clientRole = true</tt> indicates initiator, and /// \details <tt>clientRole = true</tt> indicates initiator, and
/// <tt>clientRole = false</tt> indicates recipient or server. /// <tt>clientRole = false</tt> indicates recipient or server.
FHMQV_Domain(bool clientRole = true) FHMQV_Domain(bool clientRole = true)
@ -39,6 +39,7 @@ public:
/// \brief Construct a FHMQV domain /// \brief Construct a FHMQV domain
/// \param params group parameters and options /// \param params group parameters and options
/// \param clientRole flag indicating initiator or recipient
/// \details <tt>clientRole = true</tt> indicates initiator, and /// \details <tt>clientRole = true</tt> indicates initiator, and
/// <tt>clientRole = false</tt> indicates recipient or server. /// <tt>clientRole = false</tt> indicates recipient or server.
FHMQV_Domain(const GroupParameters &params, bool clientRole = true) FHMQV_Domain(const GroupParameters &params, bool clientRole = true)
@ -46,6 +47,7 @@ public:
/// \brief Construct a FHMQV domain /// \brief Construct a FHMQV domain
/// \param bt BufferedTransformation with group parameters and options /// \param bt BufferedTransformation with group parameters and options
/// \param clientRole flag indicating initiator or recipient
/// \details <tt>clientRole = true</tt> indicates initiator, and /// \details <tt>clientRole = true</tt> indicates initiator, and
/// <tt>clientRole = false</tt> indicates recipient or server. /// <tt>clientRole = false</tt> indicates recipient or server.
FHMQV_Domain(BufferedTransformation &bt, bool clientRole = true) FHMQV_Domain(BufferedTransformation &bt, bool clientRole = true)
@ -57,6 +59,7 @@ public:
/// \tparam T2 template parameter used as a constructor parameter /// \tparam T2 template parameter used as a constructor parameter
/// \param v1 first parameter /// \param v1 first parameter
/// \param v2 second parameter /// \param v2 second parameter
/// \param clientRole flag indicating initiator or recipient
/// \details v1 and v2 are passed directly to the GROUP_PARAMETERS object. /// \details v1 and v2 are passed directly to the GROUP_PARAMETERS object.
/// \details <tt>clientRole = true</tt> indicates initiator, and /// \details <tt>clientRole = true</tt> indicates initiator, and
/// <tt>clientRole = false</tt> indicates recipient or server. /// <tt>clientRole = false</tt> indicates recipient or server.
@ -70,6 +73,7 @@ public:
/// \tparam T2 template parameter used as a constructor parameter /// \tparam T2 template parameter used as a constructor parameter
/// \param v1 first parameter /// \param v1 first parameter
/// \param v2 second parameter /// \param v2 second parameter
/// \param clientRole flag indicating initiator or recipient
/// \details v1 and v2 are passed directly to the GROUP_PARAMETERS object. /// \details v1 and v2 are passed directly to the GROUP_PARAMETERS object.
/// \details <tt>clientRole = true</tt> indicates initiator, and /// \details <tt>clientRole = true</tt> indicates initiator, and
/// <tt>clientRole = false</tt> indicates recipient or server. /// <tt>clientRole = false</tt> indicates recipient or server.
@ -85,6 +89,7 @@ public:
/// \param v1 first parameter /// \param v1 first parameter
/// \param v2 second parameter /// \param v2 second parameter
/// \param v3 third parameter /// \param v3 third parameter
/// \param clientRole flag indicating initiator or recipient
/// \details v1, v2 and v3 are passed directly to the GROUP_PARAMETERS object. /// \details v1, v2 and v3 are passed directly to the GROUP_PARAMETERS object.
/// \details <tt>clientRole = true</tt> indicates initiator, and /// \details <tt>clientRole = true</tt> indicates initiator, and
/// <tt>clientRole = false</tt> indicates recipient or server. /// <tt>clientRole = false</tt> indicates recipient or server.
@ -102,6 +107,7 @@ public:
/// \param v2 second parameter /// \param v2 second parameter
/// \param v3 third parameter /// \param v3 third parameter
/// \param v4 third parameter /// \param v4 third parameter
/// \param clientRole flag indicating initiator or recipient
/// \details v1, v2, v3 and v4 are passed directly to the GROUP_PARAMETERS object. /// \details v1, v2, v3 and v4 are passed directly to the GROUP_PARAMETERS object.
/// \details <tt>clientRole = true</tt> indicates initiator, and /// \details <tt>clientRole = true</tt> indicates initiator, and
/// <tt>clientRole = false</tt> indicates recipient or server. /// <tt>clientRole = false</tt> indicates recipient or server.

15
hmqv.h
View File

@ -30,7 +30,7 @@ public:
virtual ~HMQV_Domain() {} virtual ~HMQV_Domain() {}
/// \brief Construct a HMQV domain /// \brief Construct a HMQV domain
/// \params clientRole flag indicating initiator or recipient /// \param clientRole flag indicating initiator or recipient
/// \details <tt>clientRole = true</tt> indicates initiator, and /// \details <tt>clientRole = true</tt> indicates initiator, and
/// <tt>clientRole = false</tt> indicates recipient or server. /// <tt>clientRole = false</tt> indicates recipient or server.
HMQV_Domain(bool clientRole = true) HMQV_Domain(bool clientRole = true)
@ -38,6 +38,7 @@ public:
/// \brief Construct a HMQV domain /// \brief Construct a HMQV domain
/// \param params group parameters and options /// \param params group parameters and options
/// \param clientRole flag indicating initiator or recipient
/// \details <tt>clientRole = true</tt> indicates initiator, and /// \details <tt>clientRole = true</tt> indicates initiator, and
/// <tt>clientRole = false</tt> indicates recipient or server. /// <tt>clientRole = false</tt> indicates recipient or server.
HMQV_Domain(const GroupParameters &params, bool clientRole = true) HMQV_Domain(const GroupParameters &params, bool clientRole = true)
@ -45,6 +46,7 @@ public:
/// \brief Construct a HMQV domain /// \brief Construct a HMQV domain
/// \param bt BufferedTransformation with group parameters and options /// \param bt BufferedTransformation with group parameters and options
/// \param clientRole flag indicating initiator or recipient
/// \details <tt>clientRole = true</tt> indicates initiator, and /// \details <tt>clientRole = true</tt> indicates initiator, and
/// <tt>clientRole = false</tt> indicates recipient or server. /// <tt>clientRole = false</tt> indicates recipient or server.
HMQV_Domain(BufferedTransformation &bt, bool clientRole = true) HMQV_Domain(BufferedTransformation &bt, bool clientRole = true)
@ -56,6 +58,7 @@ public:
/// \tparam T2 template parameter used as a constructor parameter /// \tparam T2 template parameter used as a constructor parameter
/// \param v1 first parameter /// \param v1 first parameter
/// \param v2 second parameter /// \param v2 second parameter
/// \param clientRole flag indicating initiator or recipient
/// \details v1 and v2 are passed directly to the GROUP_PARAMETERS object. /// \details v1 and v2 are passed directly to the GROUP_PARAMETERS object.
/// \details <tt>clientRole = true</tt> indicates initiator, and /// \details <tt>clientRole = true</tt> indicates initiator, and
/// <tt>clientRole = false</tt> indicates recipient or server. /// <tt>clientRole = false</tt> indicates recipient or server.
@ -69,6 +72,7 @@ public:
/// \tparam T2 template parameter used as a constructor parameter /// \tparam T2 template parameter used as a constructor parameter
/// \param v1 first parameter /// \param v1 first parameter
/// \param v2 second parameter /// \param v2 second parameter
/// \param clientRole flag indicating initiator or recipient
/// \details v1 and v2 are passed directly to the GROUP_PARAMETERS object. /// \details v1 and v2 are passed directly to the GROUP_PARAMETERS object.
/// \details <tt>clientRole = true</tt> indicates initiator, and /// \details <tt>clientRole = true</tt> indicates initiator, and
/// <tt>clientRole = false</tt> indicates recipient or server. /// <tt>clientRole = false</tt> indicates recipient or server.
@ -84,6 +88,7 @@ public:
/// \param v1 first parameter /// \param v1 first parameter
/// \param v2 second parameter /// \param v2 second parameter
/// \param v3 third parameter /// \param v3 third parameter
/// \param clientRole flag indicating initiator or recipient
/// \details v1, v2 and v3 are passed directly to the GROUP_PARAMETERS object. /// \details v1, v2 and v3 are passed directly to the GROUP_PARAMETERS object.
/// \details <tt>clientRole = true</tt> indicates initiator, and /// \details <tt>clientRole = true</tt> indicates initiator, and
/// <tt>clientRole = false</tt> indicates recipient or server. /// <tt>clientRole = false</tt> indicates recipient or server.
@ -101,6 +106,7 @@ public:
/// \param v2 second parameter /// \param v2 second parameter
/// \param v3 third parameter /// \param v3 third parameter
/// \param v4 third parameter /// \param v4 third parameter
/// \param clientRole flag indicating initiator or recipient
/// \details v1, v2, v3 and v4 are passed directly to the GROUP_PARAMETERS object. /// \details v1, v2, v3 and v4 are passed directly to the GROUP_PARAMETERS object.
/// \details <tt>clientRole = true</tt> indicates initiator, and /// \details <tt>clientRole = true</tt> indicates initiator, and
/// <tt>clientRole = false</tt> indicates recipient or server. /// <tt>clientRole = false</tt> indicates recipient or server.
@ -248,7 +254,7 @@ public:
BB = tt.BytePtr(); BB = tt.BytePtr();
bbs = tt.SizeInBytes(); bbs = tt.SizeInBytes();
} }
else if(m_role == RoleClient) else
{ {
Integer a(staticPrivateKey, StaticPrivateKeyLength()); Integer a(staticPrivateKey, StaticPrivateKeyLength());
Element A = params.ExponentiateBase(a); Element A = params.ExponentiateBase(a);
@ -263,11 +269,6 @@ public:
BB = staticOtherPublicKey; BB = staticOtherPublicKey;
bbs = StaticPublicKeyLength(); bbs = StaticPublicKeyLength();
} }
else
{
CRYPTOPP_ASSERT(0);
return false;
}
// DecodeElement calls ValidateElement at level 1. Level 1 only calls // DecodeElement calls ValidateElement at level 1. Level 1 only calls
// VerifyPoint to ensure the element is in G*. If the other's PublicKey is // VerifyPoint to ensure the element is in G*. If the other's PublicKey is