7 #if CRYPTOPP_MSC_VERSION 8 # pragma warning(disable: 4589) 21 #if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) 22 void ESIGN_TestInstantiations()
64 pass = pass &&
m_e >= 8 && m_e <
m_n;
88 int modulusSize = 1023*2;
92 throw InvalidArgument(
"InvertibleESIGNFunction: specified modulus size is too small");
94 if (modulusSize % 3 != 0)
95 throw InvalidArgument(
"InvertibleESIGNFunction: modulus size must be divisible by 3");
100 throw InvalidArgument(
"InvertibleESIGNFunction: public exponents less than 8 may not be secure");
110 if (param.
GetValue(
"Seed", seedParam))
122 m_p.GenerateRandom(rng, primeParam);
123 m_q.GenerateRandom(rng, primeParam);
126 m_n = m_p * m_p * m_q;
136 m_p.BERDecode(privateKey);
137 m_q.BERDecode(privateKey);
146 m_p.DEREncode(privateKey);
147 m_q.DEREncode(privateKey);
162 z = x << (2*
GetK()+2);
172 while ((w1 >> (2*
GetK()+1)).IsPositive());
180 cout <<
"f = " << x << endl;
181 cout <<
"r = " << r << endl;
182 cout <<
"z = " << z << endl;
183 cout <<
"a = " << a << endl;
184 cout <<
"w0 = " << w0 << endl;
185 cout <<
"w1 = " << w1 << endl;
186 cout <<
"t = " << t << endl;
187 cout <<
"s = " << s << endl;
197 pass = pass && m_p.
BitCount() == m_q.BitCount();
199 pass = pass && m_p * m_p * m_q ==
m_n;
207 return GetValueHelper<ESIGNFunction>(
this,
name, valueType, pValue).Assignable()
215 AssignFromHelper<ESIGNFunction>(
this,
source)
Used to pass byte array input as part of a NameValuePairs object.
Integer CalculateRandomizedInverse(RandomNumberGenerator &rng, const Integer &x) const
Applies the inverse of the trapdoor function, using random data if required.
An invalid argument was detected.
Classes for working with NameValuePairs.
a number which is probabilistically prime
bool NotZero() const
Determines if the Integer is non-0.
bool IsOdd() const
Determines if the Integer is odd parity.
T GetValueWithDefault(const char *name, T defaultValue) const
Get a named value.
PK_FinalTemplate< TF_VerifierImpl< SchemeOptions > > Verifier
implements PK_Verifier interface
unsigned int GetK() const
void resize(size_type newSize)
Change size and preserve contents.
void PutWord(bool assumeAligned, ByteOrder order, byte *block, T value, const byte *xorBlock=NULL)
Access a block of memory.
#define NAMESPACE_BEGIN(x)
CRYPTOPP_DLL bool GetIntValue(const char *name, int &value) const
Get a named value with type int.
size_t size() const
Length of the memory block.
Library configuration file.
Ring of congruence classes modulo n.
std::hash for asio::adress
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.
void Randomize(RandomNumberGenerator &rng, size_t bitCount)
Set this Integer to random integer.
Combines two sets of NameValuePairs.
const byte * begin() const
Pointer to the first byte in the memory block.
static const Integer &CRYPTOPP_API One()
Integer representing 1.
Classes providing ESIGN signature schemes as defined in IEEE P1363a.
bool VerifyPrime(RandomNumberGenerator &rng, const Integer &p, unsigned int level)
Verifies a prime number.
unsigned int BitCount() const
Determines the number of bits required to represent the Integer.
void BERDecode(BufferedTransformation &bt)
Decode this object from a BufferedTransformation.
bool Validate(RandomNumberGenerator &rng, unsigned int level) const
Check this object for errors.
bool GetValue(const char *name, T &value) const
Get a named value.
AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed=true)
Create an object that implements NameValuePairs.
void AssignFrom(const NameValuePairs &source)
Assign values to this object.
static Integer CRYPTOPP_API Power2(size_t e)
Exponentiates to a power of 2.
Multiple precision integer with arithmetic operations.
virtual Integer MaxImage() const
Returns the maximum size of a message after the trapdoor function is applied bound to a public key...
void BERDecode(BufferedTransformation &bt)
Decode this object from a BufferedTransformation.
AssignFromHelperClass< T, BASE > AssignFromHelper(T *pObject, const NameValuePairs &source)
const T & STDMIN(const T &a, const T &b)
Replacement function for std::min.
#define CRYPTOPP_ASSERT(exp)
static void CRYPTOPP_API Divide(Integer &r, Integer &q, const Integer &a, const Integer &d)
calculate r and q such that (a == d*q + r) && (0 <= r < abs(d))
const Integer & Divide(const Integer &a, const Integer &b) const
Divides elements in the ring.
Classes and functions for working with ANS.1 objects.
Classes for SHA-1 and SHA-2 family of message digests.
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
Get a named value.
#define CRYPTOPP_SET_FUNCTION_ENTRY(name)
Classes and functions for number theoretic operations.
void DEREncode(BufferedTransformation &bt) const
Encode in DER format.
#define pass(a, b, c, mul, X)
#define CRYPTOPP_GET_FUNCTION_ENTRY(name)
void * memcpy(void *a, const void *b, size_t c)
#define CRYPTOPP_UNUSED(x)
RandomNumberGenerator & NullRNG()
Random Number Generator that does not produce random numbers.
An object that implements NameValuePairs.
Multiple precision integer with arithmetic operations.
static const Integer &CRYPTOPP_API Zero()
Integer representing 0.
void BERDecode(const byte *input, size_t inputLen)
Decode from BER format.
void AssignFrom(const NameValuePairs &source)
Assign values to this object.
Class file for performing modular arithmetic.
Integer a_exp_b_mod_c(const Integer &x, const Integer &e, const Integer &m)
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg)
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
Get a named value.
void DEREncode(BufferedTransformation &bt) const
Encode this object into a BufferedTransformation.
Integer ApplyFunction(const Integer &x) const
Applies the trapdoor.
Interface for retrieving values given their names.
void DoQuickSanityCheck() const
Perform a quick sanity check.
Template implementing constructors for public key algorithm classes.
GetValueHelperClass< T, BASE > GetValueHelper(const T *pObject, const char *name, const std::type_info &valueType, void *pValue, const NameValuePairs *searchFirst=NULL)