6#ifndef CRYPTOPP_IMPORTS
11#ifndef CRYPTOPP_IS_DLL
12template<>
const byte EMSA2HashId<SHA1>::id = 0x33;
13template<>
const byte EMSA2HashId<SHA224>::id = 0x38;
14template<>
const byte EMSA2HashId<SHA256>::id = 0x34;
15template<>
const byte EMSA2HashId<SHA384>::id = 0x36;
16template<>
const byte EMSA2HashId<SHA512>::id = 0x35;
20 const byte* recoverableMessage,
size_t recoverableMessageLength,
22 byte *representative,
size_t representativeBitLength)
const
24 CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength), CRYPTOPP_UNUSED(representativeBitLength);
27 if (representativeBitLength % 8 != 7)
28 throw PK_SignatureScheme::InvalidKeyLength(
"EMSA2: EMSA2 requires a key length that is a multiple of 8");
31 size_t representativeByteLength =
BitsToBytes(representativeBitLength);
33 representative[0] = messageEmpty ? 0x4b : 0x6b;
34 std::memset(representative+1, 0xbb, representativeByteLength-digestSize-4);
35 byte *afterP2 = representative+representativeByteLength-digestSize-3;
37 hash.
Final(afterP2+1);
38 representative[representativeByteLength-2] = *hashIdentifier.first;
39 representative[representativeByteLength-1] = 0xcc;
Interface for random number generators.
Classes and functions for various padding schemes used in public key algorithms.
size_t BitsToBytes(size_t bitCount)
Returns the number of 8-bit bytes or octets required for the specified number of bits.
Crypto++ library namespace.
#define CRYPTOPP_ASSERT(exp)
Debugging and diagnostic assertion.