Crypto++
8.4
Free C++ class library of cryptographic schemes
|
Go to the documentation of this file.
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>
Interface for private keys.
void Load(BufferedTransformation &bt)
Loads a key from a BufferedTransformation.
void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg)
Applies the trapdoor function.
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.
void Initialize(const Integer &n, const Integer &p, const Integer &q, const Integer &u)
Initialize a Rabin-Williams private key.
Integer ApplyFunction(const Integer &x) const
Applies the trapdoor.
Rabin-Williams trapdoor function using the public key.
void AssignFrom(const NameValuePairs &source)
Assign values to this object.
This file contains helper classes/functions for implementing public key algorithms.
virtual void Precompute(unsigned int precomputationStorage)
Perform precomputation.
void Save(BufferedTransformation &bt) const
Saves a key to a BufferedTransformation.
bool Validate(RandomNumberGenerator &rng, unsigned int level) const
Check this object for errors.
virtual void Precompute(unsigned int unused=0)
Perform precomputation.
Interface for random number generators.
void Load(BufferedTransformation &bt)
Loads a key from a BufferedTransformation.
InvertibleRWFunction()
Construct an InvertibleRWFunction.
Interface for public keys.
bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const
Get a named value.
Applies the inverse of the trapdoor function.
Integer ImageBound() const
Returns the maximum size of a message after the trapdoor function is applied.
Rabin-Williams signature scheme.
void Initialize(const Integer &n)
Initialize a Rabin-Williams public key.
void GenerateRandomWithKeySize(RandomNumberGenerator &rng, unsigned int keySize)
Generate a random key or crypto parameters.
void Initialize(RandomNumberGenerator &rng, unsigned int modulusBits)
Create a Rabin-Williams private key.
Crypto++ library namespace.
Integer PreimageBound() const
Returns the maximum size of a message before the trapdoor function is applied.
virtual void LoadPrecomputation(BufferedTransformation &storedPrecomputation)
Retrieve previously saved precomputation.
virtual void SavePrecomputation(BufferedTransformation &storedPrecomputation) const
Save precomputation for later use.
Trapdoor Function (TF) Signature Scheme.
virtual bool SupportsPrecomputation() const
Determines whether the object supports precomputation.
void Save(BufferedTransformation &bt) const
Saves a key to a BufferedTransformation.
void AssignFrom(const NameValuePairs &source)
Assign values to this object.
Interface for retrieving values given their names.
Abstract base classes that provide a uniform interface to this library.
Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const
Calculates the inverse of an element.
Multiple precision integer with arithmetic operations.
Rabin-Williams trapdoor function using the private key.
Multiple precision integer with arithmetic operations.