From 242d67fb17619670d9b757c442dcf2e26d8478a1 Mon Sep 17 00:00:00 2001 From: weidai Date: Thu, 20 Jan 2005 04:19:35 +0000 Subject: changes done for FIPS-140 lab code drop git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@195 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- pssr.h | 44 +++----------------------------------------- 1 file changed, 3 insertions(+), 41 deletions(-) (limited to 'pssr.h') diff --git a/pssr.h b/pssr.h index 6389bea..39df8c0 100644 --- a/pssr.h +++ b/pssr.h @@ -2,7 +2,7 @@ #define CRYPTOPP_PSSR_H #include "pubkey.h" -#include +#include "emsa2.h" #ifdef CRYPTOPP_IS_DLL #include "sha.h" @@ -18,6 +18,7 @@ class CRYPTOPP_DLL PSSR_MEM_Base : public PK_RecoverableSignatureMessageEncoding virtual const MaskGeneratingFunction & GetMGF() const =0; public: + unsigned int MinRepresentativeBitLength(unsigned int hashIdentifierLength, unsigned int digestLength) const; unsigned int MaxRecoverableLength(unsigned int representativeBitLength, unsigned int hashIdentifierLength, unsigned int digestLength) const; bool IsProbabilistic() const; bool AllowNonrecoverablePart() const; @@ -32,45 +33,6 @@ public: byte *recoverableMessage) const; }; -template class EMSA2HashId -{ -public: - static const byte id; -}; - -// EMSA2HashId can be instantiated with the following classes. -class SHA; -class RIPEMD160; -class RIPEMD128; -class SHA256; -class SHA384; -class SHA512; -class Whirlpool; -// end of list - -#ifdef CRYPTOPP_IS_DLL -CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; -CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; -CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; -CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; -#endif - -template -class EMSA2HashIdLookup : public BASE -{ -public: - struct HashIdentifierLookup - { - template struct HashIdentifierLookup2 - { - static HashIdentifier Lookup() - { - return HashIdentifier(&EMSA2HashId::id, 1); - } - }; - }; -}; - template class PSSR_MEM_BaseWithHashId; template<> class PSSR_MEM_BaseWithHashId : public EMSA2HashIdLookup {}; template<> class PSSR_MEM_BaseWithHashId : public PSSR_MEM_Base {}; @@ -84,7 +46,7 @@ class PSSR_MEM : public PSSR_MEM_BaseWithHashId virtual const MaskGeneratingFunction & GetMGF() const {static MGF mgf; return mgf;} public: - static std::string StaticAlgorithmName() {return std::string(ALLOW_RECOVERY ? "PSSR-" : "PSS-") + MGF::StaticAlgorithmName();} + static std::string CRYPTOPP_API StaticAlgorithmName() {return std::string(ALLOW_RECOVERY ? "PSSR-" : "PSS-") + MGF::StaticAlgorithmName();} }; //! PSSR-MGF1 -- cgit v1.2.1