1
#ifndef CRYPTOPP_EMSA2_H
2
#define CRYPTOPP_EMSA2_H
5
This file contains various padding schemes for public key algorithms.
11
#ifdef CRYPTOPP_IS_DLL
15
NAMESPACE_BEGIN(CryptoPP)
17
template <class H> class EMSA2HashId
24
class EMSA2HashIdLookup : public BASE
27
struct HashIdentifierLookup
29
template <class H> struct HashIdentifierLookup2
31
static HashIdentifier Lookup()
33
return HashIdentifier(&EMSA2HashId<H>::id, 1);
39
// EMSA2HashId can be instantiated with the following classes.
50
#ifdef CRYPTOPP_IS_DLL
51
CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId<SHA1>;
52
CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId<SHA224>;
53
CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId<SHA256>;
54
CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId<SHA384>;
55
CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId<SHA512>;
59
class CRYPTOPP_DLL EMSA2Pad : public EMSA2HashIdLookup<PK_DeterministicSignatureMessageEncodingMethod>
62
static const char * CRYPTOPP_API StaticAlgorithmName() {return "EMSA2";}
64
size_t MinRepresentativeBitLength(size_t hashIdentifierLength, size_t digestLength) const
65
{return 8*digestLength + 31;}
67
void ComputeMessageRepresentative(RandomNumberGenerator &rng,
68
const byte *recoverableMessage, size_t recoverableMessageLength,
69
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
70
byte *representative, size_t representativeBitLength) const;
73
//! EMSA2, for use with RWSS and RSA_ISO
74
/*! Only the following hash functions are supported by this signature standard:
76
\skip EMSA2HashId can be instantiated
79
struct P1363_EMSA2 : public SignatureStandard
81
typedef EMSA2Pad SignatureMessageEncodingMethod;