19NAMESPACE_BEGIN(CryptoPP)
47 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
50 const Integer& GetModulus()
const {
return m_n;}
51 void SetModulus(
const Integer &n) {m_n = n;}
96 bool GetVoidValue(
const char *name,
const std::type_info &valueType,
void *pValue)
const;
101 const Integer& GetPrime1()
const {
return m_p;}
102 const Integer& GetPrime2()
const {
return m_q;}
103 const Integer& GetMultiplicativeInverseOfPrime2ModPrime1()
const {
return m_u;}
105 void SetPrime1(
const Integer &p) {m_p = p;}
106 void SetPrime2(
const Integer &q) {m_q = q;}
107 void SetMultiplicativeInverseOfPrime2ModPrime1(
const Integer &u) {m_u = u;}
110 virtual void Precompute(
unsigned int unused = 0) {CRYPTOPP_UNUSED(unused); PrecomputeTweakedRoots();}
111 virtual void Precompute(
unsigned int unused = 0)
const {CRYPTOPP_UNUSED(unused); PrecomputeTweakedRoots();}
117 void PrecomputeTweakedRoots()
const;
122 mutable Integer m_pre_2_9p, m_pre_2_3q, m_pre_q_p;
123 mutable bool m_precompute;
130 CRYPTOPP_STATIC_CONSTEXPR
const char* StaticAlgorithmName() {
return "RW";}
139template <
class STANDARD,
class H>
virtual void LoadPrecomputation(BufferedTransformation &storedPrecomputation)
Retrieve previously saved precomputation.
virtual void SavePrecomputation(BufferedTransformation &storedPrecomputation) const
Save precomputation for later use.
virtual void Precompute(unsigned int precomputationStorage)
Perform precomputation.
void GenerateRandomWithKeySize(RandomNumberGenerator &rng, unsigned int keySize)
Generate a random key or crypto parameters.
virtual void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs ¶ms=g_nullNameValuePairs)
Generate a random key or crypto parameters.
Multiple precision integer with arithmetic operations.
Rabin-Williams trapdoor function using the private key.
void Save(BufferedTransformation &bt) const
Saves a key to a BufferedTransformation.
void Load(BufferedTransformation &bt)
Loads a key from a BufferedTransformation.
void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits)
Create a Rabin-Williams private key.
virtual bool SupportsPrecomputation() const
Determines whether the object supports precomputation.
InvertibleRWFunction()
Construct an InvertibleRWFunction.
virtual void Precompute(unsigned int unused=0)
Perform precomputation.
Interface for retrieving values given their names.
Interface for private keys.
Interface for public keys.
Rabin-Williams trapdoor function using the public key.
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
Integer ImageBound() const
Returns the maximum size of a representation after the trapdoor function is applied.
void Save(BufferedTransformation &bt) const
Saves a key to a BufferedTransformation.
void Initialize(const Integer &n)
Initialize a Rabin-Williams public key.
void AssignFrom(const NameValuePairs &source)
Assign values to this object.
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
Get a named value.
void Load(BufferedTransformation &bt)
Loads a key from a BufferedTransformation.
bool Validate(RandomNumberGenerator &rng, unsigned int level) const
Check this object for errors.
Interface for random number generators.
Trapdoor Function (TF) Signature Scheme.
Applies the trapdoor function.
Applies the inverse of the trapdoor function.
virtual Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const =0
Calculates the inverse of an element.
Abstract base classes that provide a uniform interface to this library.
Multiple precision integer with arithmetic operations.
This file contains helper classes/functions for implementing public key algorithms.
Rabin-Williams signature scheme.