diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2003-07-16 01:53:45 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2003-07-16 01:53:45 +0000 |
commit | 42c3d8f3aa593c224174558fd6f3d2709e08f7d0 (patch) | |
tree | 1f90c9ea7a31679b5c416408a3ffeba23e87d165 /rsa.cpp | |
parent | 09326fa9f564c09ebecff7c56d0e33555dec65b6 (diff) | |
download | cryptopp-42c3d8f3aa593c224174558fd6f3d2709e08f7d0.tar.gz |
added support for using encoding parameters and key derivation parameters
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@98 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'rsa.cpp')
-rw-r--r-- | rsa.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -16,8 +16,6 @@ NAMESPACE_BEGIN(CryptoPP) -byte OAEP_P_DEFAULT[1]; - #if !defined(NDEBUG) && !defined(CRYPTOPP_IS_DLL) void RSA_TestInstantiations() { @@ -107,19 +105,19 @@ public: void InvertibleRSAFunction::GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg) { int modulusSize = 2048; - alg.GetIntValue("ModulusSize", modulusSize) || alg.GetIntValue("KeySize", modulusSize); + alg.GetIntValue(Name::ModulusSize(), modulusSize) || alg.GetIntValue(Name::KeySize(), modulusSize); if (modulusSize < 16) throw InvalidArgument("InvertibleRSAFunction: specified modulus size is too small"); - m_e = alg.GetValueWithDefault("PublicExponent", Integer(17)); + m_e = alg.GetValueWithDefault(Name::PublicExponent(), Integer(17)); if (m_e < 3 || m_e.IsEven()) throw InvalidArgument("InvertibleRSAFunction: invalid public exponent"); RSAPrimeSelector selector(m_e); const NameValuePairs &primeParam = MakeParametersForTwoPrimesOfEqualSize(modulusSize) - ("PointerToPrimeSelector", selector.GetSelectorPointer()); + (Name::PointerToPrimeSelector(), selector.GetSelectorPointer()); m_p.GenerateRandom(rng, primeParam); m_q.GenerateRandom(rng, primeParam); @@ -145,7 +143,7 @@ void InvertibleRSAFunction::GenerateRandom(RandomNumberGenerator &rng, const Nam void InvertibleRSAFunction::Initialize(RandomNumberGenerator &rng, unsigned int keybits, const Integer &e) { - GenerateRandom(rng, MakeParameters("ModulusSize", (int)keybits)("PublicExponent", e+e.IsEven())); + GenerateRandom(rng, MakeParameters(Name::ModulusSize(), (int)keybits)(Name::PublicExponent(), e+e.IsEven())); } void InvertibleRSAFunction::Initialize(const Integer &n, const Integer &e, const Integer &d) |