Fabcoin Core  0.16.2
P2P Digital Currency
emsa2.h
Go to the documentation of this file.
1 // emsa2.h - written and placed in the public domain by Wei Dai
2 
5 
6 #ifndef CRYPTOPP_EMSA2_H
7 #define CRYPTOPP_EMSA2_H
8 
9 #include "cryptlib.h"
10 #include "pubkey.h"
11 #include "misc.h"
12 
13 #ifdef CRYPTOPP_IS_DLL
14 # include "sha.h"
15 #endif
16 
18 
19 template <class H> class EMSA2HashId
20 {
21 public:
22  static const byte id;
23 };
24 
25 template <class BASE>
26 class EMSA2HashIdLookup : public BASE
27 {
28 public:
30  {
31  template <class H> struct HashIdentifierLookup2
32  {
34  {
36  }
37  };
38  };
39 };
40 
41 // EMSA2HashId can be instantiated with the following classes.
42 class SHA1;
43 class SHA224;
44 class SHA256;
45 class SHA384;
46 class SHA512;
47 class RIPEMD128;
48 class RIPEMD160;
49 class Whirlpool;
50 // end of list
51 
52 #ifdef CRYPTOPP_IS_DLL
58 #endif
59 
61 class CRYPTOPP_DLL EMSA2Pad : public EMSA2HashIdLookup<PK_DeterministicSignatureMessageEncodingMethod>
62 {
63 public:
65 
66  size_t MinRepresentativeBitLength(size_t hashIdentifierLength, size_t digestLength) const
67  {CRYPTOPP_UNUSED(hashIdentifierLength); return 8*digestLength + 31;}
68 
69  void ComputeMessageRepresentative(RandomNumberGenerator &rng,
70  const byte *recoverableMessage, size_t recoverableMessageLength,
71  HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,
72  byte *representative, size_t representativeBitLength) const;
73 };
74 
76 
82 {
84 };
85 
87 
88 #endif
SHA-384 message digest.
Definition: sha.h:81
uint8_t byte
Definition: Common.h:57
Utility functions for the Crypto++ library.
#define CRYPTOPP_STATIC_CONSTEXPR
Definition: config.h:892
SHA-256 message digest.
Definition: sha.h:39
CRYPTOPP_STATIC_CONSTEXPR const char *CRYPTOPP_API StaticAlgorithmName()
Definition: emsa2.h:64
#define NAMESPACE_BEGIN(x)
Definition: config.h:200
#define CRYPTOPP_DLL_TEMPLATE_CLASS
Definition: config.h:720
Abstract base classes that provide a uniform interface to this library.
RIPEMD-160 message digest.
Definition: ripemd.h:17
Interface for random number generators.
Definition: cryptlib.h:1188
_
Definition: emsa2.h:61
Base class for public key signature standard classes.
Definition: pubkey.h:2071
EMSA2, for use with RWSS and RSA_ISO.
Definition: emsa2.h:81
Whirlpool
Definition: whrlpool.h:10
SHA-512 message digest.
Definition: sha.h:69
EMSA2Pad SignatureMessageEncodingMethod
Definition: emsa2.h:83
#define H(x, y, z)
Definition: Hash.cpp:81
SHA-1 message digest.
Definition: sha.h:25
#define CRYPTOPP_API
Definition: config.h:705
static const byte id
Definition: emsa2.h:22
Classes for SHA-1 and SHA-2 family of message digests.
size_t MinRepresentativeBitLength(size_t hashIdentifierLength, size_t digestLength) const
Definition: emsa2.h:66
#define CRYPTOPP_UNUSED(x)
Definition: config.h:741
Interface for hash functions and data processing part of MACs.
Definition: cryptlib.h:930
#define NAMESPACE_END
Definition: config.h:201
std::pair< const byte *, unsigned int > HashIdentifier
Definition: pubkey.h:314
#define CRYPTOPP_DLL
Definition: config.h:704
RIPEMD-128 message digest.
Definition: ripemd.h:42
SHA-224 message digest.
Definition: sha.h:54