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";}
115template <
class STANDARD>
123template <
class STANDARD,
class H>
void GenerateRandomWithKeySize(RandomNumberGenerator &rng, unsigned int keySize)
Generate a random key or crypto parameters.
Multiple precision integer with arithmetic operations.
Rabin trapdoor function using the private key.
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.
Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const
Calculates the inverse of an element.
void Initialize(RandomNumberGenerator &rng, unsigned int keybits)
Create a Rabin private key.
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg)
void AssignFrom(const NameValuePairs &source)
Assign values to this object.
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
Get a named value.
Interface for retrieving values given their names.
Template implementing constructors for public key algorithm classes.
Interface for private keys.
Interface for public keys.
Rabin trapdoor function using the public key.
Integer ImageBound() const
Returns the maximum size of a representation after the trapdoor function is applied.
void Initialize(const Integer &n, const Integer &r, const Integer &s)
Initialize a Rabin public key.
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
Interface for random number generators.
Trapdoor Function (TF) encryption scheme.
Trapdoor Function (TF) Signature Scheme.
Applies the trapdoor function.
Applies the inverse of the trapdoor function.
Abstract base classes that provide a uniform interface to this library.
Multiple precision integer with arithmetic operations.
Crypto++ library namespace.
Classes for optimal asymmetric encryption padding.
Classes for probabilistic signature schemes.