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";}
139 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.
void Save(BufferedTransformation &bt) const
Saves a key to a BufferedTransformation.
This file contains helper classes/functions for implementing public key algorithms.
void Load(BufferedTransformation &bt)
Loads a key from a BufferedTransformation.
virtual bool SupportsPrecomputation() const
Determines whether the object supports precomputation.
Abstract base classes that provide a uniform interface to this library.
Interface for random number generators.
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 message after the trapdoor function is applied.
Interface for private keys.
virtual void SavePrecomputation(BufferedTransformation &storedPrecomputation) const
Save precomputation for later use.
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.
void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits)
Create a Rabin-Williams private key.
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 Initialize(const Integer &n)
Initialize a Rabin-Williams public key.
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.
void Save(BufferedTransformation &bt) const
Saves a key to a BufferedTransformation.
InvertibleRWFunction()
Construct an InvertibleRWFunction.
Interface for retrieving values given their names.
Trapdoor Function (TF) Signature Scheme.