6 #ifndef CRYPTOPP_RABIN_H 7 #define CRYPTOPP_RABIN_H 29 {m_n = n; m_r = r; m_s = s;}
39 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
42 const Integer& GetModulus()
const {
return m_n;}
43 const Integer& GetQuadraticResidueModPrime1()
const {
return m_r;}
44 const Integer& GetQuadraticResidueModPrime2()
const {
return m_s;}
46 void SetModulus(
const Integer &n) {m_n = n;}
47 void SetQuadraticResidueModPrime1(
const Integer &r) {m_r = r;}
48 void SetQuadraticResidueModPrime2(
const Integer &s) {m_s = s;}
71 {m_n = n; m_r = r; m_s = s; m_p = p; m_q = q; m_u = u;}
88 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
93 const Integer& GetPrime1()
const {
return m_p;}
94 const Integer& GetPrime2()
const {
return m_q;}
95 const Integer& GetMultiplicativeInverseOfPrime2ModPrime1()
const {
return m_u;}
97 void SetPrime1(
const Integer &p) {m_p = p;}
98 void SetPrime2(
const Integer &q) {m_q = q;}
99 void SetMultiplicativeInverseOfPrime2ModPrime1(
const Integer &u) {m_u = u;}
108 static std::string StaticAlgorithmName() {
return "Rabin-Crypto++Variant";}
115 template <
class STANDARD>
123 template <
class STANDARD,
class H>
Trapdoor Function (TF) encryption scheme.
Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const
Calculates the inverse of an element.
Abstract base classes that provide a uniform interface to this library.
Interface for random number generators.
Interface for private keys.
Rabin trapdoor function using the public key.
Applies the inverse of the trapdoor function.
Multiple precision integer with arithmetic operations.
Applies the trapdoor function.
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg)
void Initialize(const Integer &n, const Integer &r, const Integer &s, const Integer &p, const Integer &q, const Integer &u)
Initialize a Rabin private key.
Classes for optimal asymmetric encryption padding.
bool Validate(RandomNumberGenerator &rng, unsigned int level) const
Check this object for errors.
Integer ImageBound() const
Returns the maximum size of a message after the trapdoor function is applied.
void AssignFrom(const NameValuePairs &source)
Assign values to this object.
void GenerateRandomWithKeySize(RandomNumberGenerator &rng, unsigned int keySize)
Generate a random key or crypto parameters.
Multiple precision integer with arithmetic operations.
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
Get a named value.
Interface for public keys.
Crypto++ library namespace.
Rabin trapdoor function using the private key.
Classes for probablistic signature schemes.
void Initialize(const Integer &n, const Integer &r, const Integer &s)
Initialize a Rabin public key.
void Initialize(RandomNumberGenerator &rng, unsigned int keybits)
Create a Rabin private key.
Interface for retrieving values given their names.
Template implementing constructors for public key algorithm classes.
Trapdoor Function (TF) Signature Scheme.