From 24d24925644811c17218f832bfaf09bae1342ae0 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 29 Feb 2016 10:37:36 -0500 Subject: [PATCH] Update documentation --- pssr.h | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/pssr.h b/pssr.h index a7047d30..9cfab26e 100644 --- a/pssr.h +++ b/pssr.h @@ -1,7 +1,6 @@ // pssr.h - written and placed in the public domain by Wei Dai -//! \file -//! \headerfile pssr.h +//! \file pssr.h //! \brief Classes for probablistic signature schemes #ifndef CRYPTOPP_PSSR_H @@ -17,8 +16,15 @@ NAMESPACE_BEGIN(CryptoPP) +//! \brief PSSR Message Encoding Method interface class CRYPTOPP_DLL PSSR_MEM_Base : public PK_RecoverableSignatureMessageEncodingMethod { +public: +#ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 + virtual ~PSSR_MEM_Base() {} +#endif + +private: virtual bool AllowRecovery() const =0; virtual size_t SaltLen(size_t hashLen) const =0; virtual size_t MinPadLen(size_t hashLen) const =0; @@ -40,10 +46,27 @@ public: byte *recoverableMessage) const; }; +//! \brief PSSR Message Encoding Method with Hash Identifier +//! \tparam USE_HASH_ID flag indicating whether the HashId is used template class PSSR_MEM_BaseWithHashId; + +//! \brief PSSR Message Encoding Method with Hash Identifier +//! \tparam true flag indicating HashId is used template<> class PSSR_MEM_BaseWithHashId : public EMSA2HashIdLookup {}; + +//! \brief PSSR Message Encoding Method without Hash Identifier +//! \tparam false flag indicating HashId is not used template<> class PSSR_MEM_BaseWithHashId : public PSSR_MEM_Base {}; +//! \brief PSSR Message Encoding Method +//! \tparam ALLOW_RECOVERY flag indicating whether the scheme provides message recovery +//! \tparam MGF mask generation function +//! \tparam SALT_LEN length of the salt +//! \tparam MIN_PAD_LEN minimum length of the pad +//! \tparam USE_HASH_ID flag indicating whether the HashId is used +//! \details If ALLOW_RECOVERY is true, the the signature scheme provides message recovery. If +//! ALLOW_RECOVERY is false, the the signature scheme is appendix, and the message must be +//! provided during verification. template class PSSR_MEM : public PSSR_MEM_BaseWithHashId { @@ -56,13 +79,17 @@ public: static std::string CRYPTOPP_API StaticAlgorithmName() {return std::string(ALLOW_RECOVERY ? "PSSR-" : "PSS-") + MGF::StaticAlgorithmName();} }; -//! PSSR-MGF1 +//! \brief Probabilistic Signature Scheme with Recovery +//! \details Signature Schemes with Recovery encode the message with the signature. +//! \sa PSSR-MGF1 struct PSSR : public SignatureStandard { typedef PSSR_MEM SignatureMessageEncodingMethod; }; -//! PSS-MGF1 +//! \brief Probabilistic Signature Scheme with Appendix +//! \details Signature Schemes with Appendix require the message to be provided during verification. +//! \sa PSS-MGF1 struct PSS : public SignatureStandard { typedef PSSR_MEM SignatureMessageEncodingMethod;