11 NAMESPACE_BEGIN(CryptoPP)
19 void Initialize(
const Integer &n)
26 Integer PreimageBound()
const {
return ++(m_n>>1);}
27 Integer ImageBound()
const {
return m_n;}
30 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
33 const Integer& GetModulus()
const {
return m_n;}
34 void SetModulus(
const Integer &n) {m_n = n;}
47 {m_n = n; m_p = p; m_q = q; m_u = u;}
59 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
64 const Integer& GetPrime1()
const {
return m_p;}
65 const Integer& GetPrime2()
const {
return m_q;}
66 const Integer& GetMultiplicativeInverseOfPrime2ModPrime1()
const {
return m_u;}
68 void SetPrime1(
const Integer &p) {m_p = p;}
69 void SetPrime2(
const Integer &q) {m_q = q;}
70 void SetMultiplicativeInverseOfPrime2ModPrime1(
const Integer &u) {m_u = u;}
79 static std::string StaticAlgorithmName() {
return "RW";}
85 template <
class STANDARD,
class H>
virtual void AssignFrom(const NameValuePairs &source)=0
assign values from source to this object
This file contains helper classes/functions for implementing public key algorithms.
interface for random number generators
interface for private keys
virtual bool Validate(RandomNumberGenerator &rng, unsigned int level) const =0
check this object for errors
multiple precision integer and basic arithmetics
virtual bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const =0
to be implemented by derived classes, users should use one of the above functions instead ...
Trapdoor Function Based Signature Scheme.
virtual void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶ms=g_nullNameValuePairs)
generate a random key or crypto parameters
void GenerateRandomWithKeySize(RandomNumberGenerator &rng, unsigned int keySize)
calls the above function with a NameValuePairs object that just specifies "KeySize" ...
interface for public keys
interface for retrieving values given their names