1 #ifndef CRYPTOPP_RABIN_H
2 #define CRYPTOPP_RABIN_H
11 NAMESPACE_BEGIN(CryptoPP)
20 {m_n = n; m_r = r; m_s = s;}
26 Integer PreimageBound()
const {
return m_n;}
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 const Integer& GetQuadraticResidueModPrime1()
const {
return m_r;}
35 const Integer& GetQuadraticResidueModPrime2()
const {
return m_s;}
37 void SetModulus(
const Integer &n) {m_n = n;}
38 void SetQuadraticResidueModPrime1(
const Integer &r) {m_r = r;}
39 void SetQuadraticResidueModPrime2(
const Integer &s) {m_s = s;}
53 {m_n = n; m_r = r; m_s = s; m_p = p; m_q = q; m_u = u;}
63 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
68 const Integer& GetPrime1()
const {
return m_p;}
69 const Integer& GetPrime2()
const {
return m_q;}
70 const Integer& GetMultiplicativeInverseOfPrime2ModPrime1()
const {
return m_u;}
72 void SetPrime1(
const Integer &p) {m_p = p;}
73 void SetPrime2(
const Integer &q) {m_q = q;}
74 void SetMultiplicativeInverseOfPrime2ModPrime1(
const Integer &u) {m_u = u;}
83 static std::string StaticAlgorithmName() {
return "Rabin-Crypto++Variant";}
89 template <
class STANDARD>
95 template <
class STANDARD,
class H>
interface for random number generators
interface for private keys
multiple precision integer and basic arithmetics
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg)
void AssignFrom(const NameValuePairs &source)
assign values from source to this object
Trapdoor Function Based Signature Scheme.
void GenerateRandomWithKeySize(RandomNumberGenerator &rng, unsigned int keySize)
calls the above function with a NameValuePairs object that just specifies "KeySize" ...
interface for public keys
Trapdoor Function Based Encryption Scheme.
bool Validate(RandomNumberGenerator &rng, unsigned int level) const
check this object for errors
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
to be implemented by derived classes, users should use one of the above functions instead ...
interface for retrieving values given their names
A template implementing constructors for public key algorithm classes.