From ff941db1639626de54904ecc68fb588d20407df6 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 24 Aug 2019 16:59:39 -0400 Subject: Update documentation --- elgamal.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'elgamal.h') diff --git a/elgamal.h b/elgamal.h index a7a892c0..a9e63106 100644 --- a/elgamal.h +++ b/elgamal.h @@ -51,6 +51,8 @@ public: size_t GetMaxSymmetricPlaintextLength(size_t cipherTextLength) const { unsigned int len = GetGroupParameters().GetModulus().ByteCount(); + CRYPTOPP_ASSERT(len >= 3); + if (cipherTextLength == len) return STDMIN(255U, len-3); else @@ -95,6 +97,9 @@ public: }; /// \brief ElGamal key agreement and encryption schemes default implementation +/// \tparam BASE Base class implementation +/// \tparam SCHEME_OPTIONS Scheme options +/// \tparam Key ElGamal key classes /// \since Crypto++ 1.0 template class ElGamalObjectImpl : public DL_ObjectImplBase, public ElGamalBase @@ -116,6 +121,14 @@ protected: const DL_SymmetricEncryptionAlgorithm & GetSymmetricEncryptionAlgorithm() const {return *this;} }; +/// \brief ElGamal Public Key adapter +/// \tparam BASE PublicKey derived class +/// \details DL_PublicKey_ElGamal provides an override for GetAlgorithmID() +/// to utilize 1.3.14.7.2.1.1. Prior to DL_PublicKey_ElGamal, the ElGamal +/// keys used the OID from DSA due to DL_GroupParmaters_GFP(). +/// \sa Issue 876, +/// Issue 567 +/// \since Crypto++ 8.3 template struct DL_PublicKey_ElGamal : public BASE { @@ -125,6 +138,14 @@ struct DL_PublicKey_ElGamal : public BASE } }; +/// \brief ElGamal Private Key adapter +/// \tparam BASE PrivateKey derived class +/// \details DL_PrivateKey_ElGamal provides an override for GetAlgorithmID() +/// to utilize 1.3.14.7.2.1.1. Prior to DL_PrivateKey_ElGamal, the ElGamal +/// keys used the OID from DSA due to DL_GroupParmaters_GFP(). +/// \sa Issue 876, +/// Issue 567 +/// \since Crypto++ 8.3 template struct DL_PrivateKey_ElGamal : public BASE { @@ -136,9 +157,11 @@ struct DL_PrivateKey_ElGamal : public BASE /// \brief ElGamal key agreement and encryption schemes keys /// \details The ElGamalKeys class used DL_PrivateKey_GFP_OldFormat and DL_PublicKey_GFP_OldFormat -/// for the PrivateKey and PublicKey typedef from about Crypto++ 1.0 through Crypto++ 5.6.5. -/// At Crypto++ 6.0 the serialization format was cutover to standard PKCS8 and X509 encodings. -/// \sa Commit a5a684d92986e8e2 +/// for the PrivateKey and PublicKey typedef from about Crypto++ 1.0 through Crypto++ 5.6.5. +/// At Crypto++ 6.0 the serialization format was cutover to standard PKCS8 and X509 encodings. +/// \sa Issue 876, +/// Issue 567 +/// \since Crypto++ 1.0 struct ElGamalKeys { typedef DL_CryptoKeys_GFP::GroupParameters GroupParameters; -- cgit v1.2.1