27 void Initialize(
const Integer &n)
43 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
46 const Integer& GetModulus()
const {
return m_n;}
47 void SetModulus(
const Integer &n) {m_n = n;}
80 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
85 const Integer& GetPrime1()
const {
return m_p;}
86 const Integer& GetPrime2()
const {
return m_q;}
87 const Integer& GetMultiplicativeInverseOfPrime2ModPrime1()
const {
return m_u;}
89 void SetPrime1(
const Integer &p) {m_p = p;}
90 void SetPrime2(
const Integer &q) {m_q = q;}
91 void SetMultiplicativeInverseOfPrime2ModPrime1(
const Integer &u) {m_u = u;}
94 virtual void Precompute(
unsigned int unused = 0) {CRYPTOPP_UNUSED(unused); PrecomputeTweakedRoots();}
95 virtual void Precompute(
unsigned int unused = 0)
const {CRYPTOPP_UNUSED(unused); PrecomputeTweakedRoots();}
101 void PrecomputeTweakedRoots()
const;
106 mutable Integer m_pre_2_9p, m_pre_2_3q, m_pre_q_p;
107 mutable bool m_precompute;
114 static std::string StaticAlgorithmName() {
return "RW";}
121 template <
class STANDARD,
class H>
virtual void AssignFrom(const NameValuePairs &source)=0
Assign values to this object.
virtual void Precompute(unsigned int precomputationStorage)
Perform precomputation.
Rabin-Williams trapdoor function using the private key.
virtual void SavePrecomputation(BufferedTransformation &storedPrecomputation) const
Save precomputation for later use.
This file contains helper classes/functions for implementing public key algorithms.
void Load(BufferedTransformation &bt)
Loads a key from a BufferedTransformation.
Abstract base classes that provide a uniform interface to this library.
Interface for random number generators.
Integer ImageBound() const
Returns the maximum size of a message after the trapdoor function is applied.
Interface for private keys.
Applies the inverse of the trapdoor function.
virtual void LoadPrecomputation(BufferedTransformation &storedPrecomputation)
Retrieve previously saved precomputation.
Rabin-Williams trapdoor function using the public key.
virtual bool Validate(RandomNumberGenerator &rng, unsigned int level) const =0
Check this object for errors.
virtual bool SupportsPrecomputation() const
Determines whether the object supports precomputation.
Multiple precision integer with arithmetic operations.
virtual bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const =0
Get a named value.
Applies the trapdoor function.
void Load(BufferedTransformation &bt)
Loads a key from a BufferedTransformation.
virtual Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const =0
Calculates the inverse of an element.
void Save(BufferedTransformation &bt) const
Saves a key to a BufferedTransformation.
Rabin-Williams 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)
Generate a random key or crypto parameters.
Multiple precision integer with arithmetic operations.
Interface for public keys.
Crypto++ library namespace.
virtual void Precompute(unsigned int unused=0)
Perform precomputation.
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
void Save(BufferedTransformation &bt) const
Saves a key to a BufferedTransformation.
Rabin-Williams algorithm.
Interface for retrieving values given their names.
Trapdoor Function (TF) Signature Scheme.