11 NAMESPACE_BEGIN(CryptoPP)
19 void Initialize(
const Integer &n)
31 Integer PreimageBound()
const {
return ++(m_n>>1);}
32 Integer ImageBound()
const {
return m_n;}
35 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
38 const Integer& GetModulus()
const {
return m_n;}
39 void SetModulus(
const Integer &n) {m_n = n;}
52 {m_n = n; m_p = p; m_q = q; m_u = u;}
69 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
74 const Integer& GetPrime1()
const {
return m_p;}
75 const Integer& GetPrime2()
const {
return m_q;}
76 const Integer& GetMultiplicativeInverseOfPrime2ModPrime1()
const {
return m_u;}
78 void SetPrime1(
const Integer &p) {m_p = p;}
79 void SetPrime2(
const Integer &q) {m_q = q;}
80 void SetMultiplicativeInverseOfPrime2ModPrime1(
const Integer &u) {m_u = u;}
89 static std::string StaticAlgorithmName() {
return "RW";}
95 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.
void Load(BufferedTransformation &bt)
load key from a BufferedTransformation
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 ...
void Load(BufferedTransformation &bt)
load key from a BufferedTransformation
void Save(BufferedTransformation &bt) const
save key into a BufferedTransformation
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
void Save(BufferedTransformation &bt) const
save key into a BufferedTransformation
interface for retrieving values given their names
Trapdoor Function Based Signature Scheme.