7 #ifndef CRYPTOPP_ESIGN_H 8 #define CRYPTOPP_ESIGN_H 39 bool GetVoidValue(
const char *
name,
const std::type_info &valueType,
void *pValue)
const;
95 bool GetVoidValue(
const char *
name,
const std::type_info &valueType,
void *pValue)
const;
121 const byte *recoverableMessage,
size_t recoverableMessageLength,
123 byte *representative,
size_t representativeBitLength)
const 129 size_t representativeByteLength =
BitsToBytes(representativeBitLength);
131 mgf.GenerateAndMask(hash, representative, representativeByteLength, digest, digest.size(),
false);
132 if (representativeBitLength % 8 != 0)
133 representative[0] = (
byte)
Crop(representative[0], representativeBitLength % 8);
157 template <
class H,
class STANDARD = P1363_EMSA5>
Integer CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const
Applies the inverse of the trapdoor function, using random data if required.
InvertibleESIGNFunction PrivateKey
Utility functions for the Crypto++ library.
#define CRYPTOPP_STATIC_CONSTEXPR
const Integer & GetModulus() const
size_t BitsToBytes(size_t bitCount)
Returns the number of 8-bit bytes or octets required for the specified number of bits.
unsigned int GetK() const
CRYPTOPP_STATIC_CONSTEXPR const char * StaticAlgorithmName()
Integer ImageBound() const
Returns the maximum size of a message after the trapdoor function is applied.
ESIGN signature scheme, IEEE P1363a.
#define NAMESPACE_BEGIN(x)
Abstract base classes that provide a uniform interface to this library.
CRYPTOPP_STATIC_CONSTEXPR const char * StaticAlgorithmName()
void Initialize(const Integer &n, const Integer &e, const Integer &p, const Integer &q)
Initialize a ESIGN private key with {n,e,p,q}.
void Initialize(const Integer &n, const Integer &e)
Initialize a ESIGN public key with {n,e}.
void DEREncode(BufferedTransformation &bt) const
Encode this object into a BufferedTransformation.
Interface for random number generators.
bool Validate(RandomNumberGenerator &rng, unsigned int level) const
Check this object for errors.
Interface for private keys.
Base class for public key signature standard classes.
void BERDecode(BufferedTransformation &bt)
Decode this object from a BufferedTransformation.
Interface for message encoding method for public key signature schemes.
void SetPublicExponent(const Integer &e)
T Crop(T value, size_t bits)
Truncates the value to the specified number of bits.
void AssignFrom(const NameValuePairs &source)
Assign values to this object.
void SetPrime1(const Integer &p)
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
const Integer & GetPrime2() const
static Integer CRYPTOPP_API Power2(size_t e)
Exponentiates to a power of 2.
bool Validate(int, bool, const char *)
ESIGN trapdoor function using the private key.
Multiple precision integer with arithmetic operations.
void ComputeMessageRepresentative(RandomNumberGenerator &rng, const byte *recoverableMessage, size_t recoverableMessageLength, HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty, byte *representative, size_t representativeBitLength) const
T1 SaturatingSubtract(const T1 &a, const T2 &b)
Performs a saturating subtract clamped at 0.
Applies the trapdoor function.
EMSA5 padding method, for use with ESIGN.
const Integer & GetPublicExponent() const
Classes and functions for working with ANS.1 objects.
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
Get a named value.
void SetModulus(const Integer &n)
ESIGN trapdoor function using the public key.
#define CRYPTOPP_UNUSED(x)
void GenerateRandomWithKeySize(RandomNumberGenerator &rng, unsigned int keySize)
Generate a random key or crypto parameters.
Multiple precision integer with arithmetic operations.
void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits)
Create a ESIGN private key.
InvertibleESIGNFunction ThisClass
Interface for public keys.
Applies the inverse of the trapdoor function, using random data if required.
std::pair< const byte *, unsigned int > HashIdentifier
EMSA5Pad< P1363_MGF1 > SignatureMessageEncodingMethod
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg)
void SetPrime2(const Integer &q)
Encode and decode ASN.1 objects with additional information.
const Integer & GetPrime1() const
Interface for retrieving values given their names.
Trapdoor Function (TF) Signature Scheme.