From 42c3d8f3aa593c224174558fd6f3d2709e08f7d0 Mon Sep 17 00:00:00 2001 From: weidai Date: Wed, 16 Jul 2003 01:53:45 +0000 Subject: 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 --- rsa.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'rsa.cpp') diff --git a/rsa.cpp b/rsa.cpp index 79e49bb..1e00a6c 100644 --- a/rsa.cpp +++ b/rsa.cpp @@ -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) -- cgit v1.2.1