Crypto++
8.6
Free C++ class library of cryptographic schemes
|
Go to the documentation of this file.
7 #ifndef CRYPTOPP_ESIGN_H
8 #define CRYPTOPP_ESIGN_H
38 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
47 const Integer & GetModulus()
const {
return m_n;}
48 const Integer & GetPublicExponent()
const {
return m_e;}
50 void SetModulus(
const Integer &n) {m_n = n;}
51 void SetPublicExponent(
const Integer &e) {m_e = e;}
75 {m_n = n; m_e = e; m_p = p; m_q = q;}
101 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
106 const Integer& GetPrime1()
const {
return m_p;}
107 const Integer& GetPrime2()
const {
return m_q;}
109 void SetPrime1(
const Integer &p) {m_p = p;}
110 void SetPrime2(
const Integer &q) {m_q = q;}
123 CRYPTOPP_STATIC_CONSTEXPR
const char* StaticAlgorithmName() {
return "EMSA5";}
126 const byte *recoverableMessage,
size_t recoverableMessageLength,
128 byte *representative,
size_t representativeBitLength)
const
130 CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength);
131 CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier);
134 size_t representativeByteLength =
BitsToBytes(representativeBitLength);
136 mgf.GenerateAndMask(hash, representative, representativeByteLength, digest, digest.
size(),
false);
137 if (representativeBitLength % 8 != 0)
138 representative[0] = (
byte)
Crop(representative[0], representativeBitLength % 8);
153 CRYPTOPP_STATIC_CONSTEXPR
const char* StaticAlgorithmName() {
return "ESIGN";}
162 template <
class H,
class STANDARD = P1363_EMSA5>
virtual void BEREncode(BufferedTransformation &bt) const
Encode this object into a BufferedTransformation.
ESIGN trapdoor function using the public key.
void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits)
Create a ESIGN private key.
Interface for private keys.
static Integer Power2(size_t e)
Exponentiates to a power of 2.
Applies the trapdoor function.
unsigned char byte
8-bit unsigned datatype
Integer ImageBound() const
Returns the maximum size of a representation after the trapdoor function is applied.
Encode and decode ASN.1 objects with additional information.
void DEREncode(BufferedTransformation &bt) const
Encode this object into a BufferedTransformation.
bool Validate(RandomNumberGenerator &rng, unsigned int level) const
Check this object for errors.
This file contains helper classes/functions for implementing public key algorithms.
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
void Save(BufferedTransformation &bt) const
Saves a key to a BufferedTransformation.
Interface for message encoding method for public key signature schemes.
void Initialize(const Integer &n, const Integer &e)
Initialize a ESIGN public key with {n,e}.
Interface for random number generators.
void Initialize(const Integer &n, const Integer &e, const Integer &p, const Integer &q)
Initialize a ESIGN private key with {n,e,p,q}.
size_t BitsToBytes(size_t bitCount)
Returns the number of 8-bit bytes or octets required for the specified number of bits.
Utility functions for the Crypto++ library.
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg)
Interface for public keys.
void BERDecode(BufferedTransformation &bt)
Decode this object from a BufferedTransformation.
EMSA5 padding method, for use with ESIGN.
Classes and functions for working with ANS.1 objects.
Integer CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const
Applies the inverse of the trapdoor function, using random data if required.
size_type size() const
Provides the count of elements in the SecBlock.
void GenerateRandomWithKeySize(RandomNumberGenerator &rng, unsigned int keySize)
Generate a random key or crypto parameters.
void AssignFrom(const NameValuePairs &source)
Assign values to this object.
ESIGN signature scheme, IEEE P1363a.
Applies the inverse of the trapdoor function, using random data if required.
T Crop(T value, size_t bits)
Truncates the value to the specified number of bits.
Crypto++ library namespace.
T1 SaturatingSubtract(const T1 &a, const T2 &b)
Performs a saturating subtract clamped at 0.
Trapdoor Function (TF) Signature Scheme.
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
Get a named value.
ESIGN trapdoor function using the private key.
void Load(BufferedTransformation &bt)
Loads a key from a BufferedTransformation.
Interface for retrieving values given their names.
Abstract base classes that provide a uniform interface to this library.
Multiple precision integer with arithmetic operations.
Multiple precision integer with arithmetic operations.
Base class for public key signature standard classes.