1 #ifndef CRYPTOPP_ESIGN_H
2 #define CRYPTOPP_ESIGN_H
13 NAMESPACE_BEGIN(CryptoPP)
30 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
35 Integer PreimageBound()
const {
return m_n;}
39 const Integer & GetModulus()
const {
return m_n;}
40 const Integer & GetPublicExponent()
const {
return m_e;}
42 void SetModulus(
const Integer &n) {m_n = n;}
43 void SetPublicExponent(
const Integer &e) {m_e = e;}
46 unsigned int GetK()
const {
return m_n.
BitCount()/3-1;}
58 {m_n = n; m_e = e; m_p = p; m_q = q;}
70 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
75 const Integer& GetPrime1()
const {
return m_p;}
76 const Integer& GetPrime2()
const {
return m_q;}
78 void SetPrime1(
const Integer &p) {m_p = p;}
79 void SetPrime2(
const Integer &q) {m_q = q;}
90 static const char *StaticAlgorithmName() {
return "EMSA5";}
93 const byte *recoverableMessage,
size_t recoverableMessageLength,
95 byte *representative,
size_t representativeBitLength)
const
99 size_t representativeByteLength = BitsToBytes(representativeBitLength);
101 mgf.GenerateAndMask(hash, representative, representativeByteLength, digest, digest.size(),
false);
102 if (representativeBitLength % 8 != 0)
103 representative[0] = (byte)Crop(representative[0], representativeBitLength % 8);
115 static std::string StaticAlgorithmName() {
return "ESIGN";}
121 template <
class H,
class STANDARD = P1363_EMSA5>