summaryrefslogtreecommitdiff
path: root/rsa.cpp
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2003-07-16 01:53:45 +0000
committerweidai <weidai11@users.noreply.github.com>2003-07-16 01:53:45 +0000
commit38b49e454399c81aac16279f78a834de26245bec (patch)
tree1f90c9ea7a31679b5c416408a3ffeba23e87d165 /rsa.cpp
parent8cd6a9256d78953d6e99097fb4508a077e8e2ebe (diff)
downloadcryptopp-git-38b49e454399c81aac16279f78a834de26245bec.tar.gz
added support for using encoding parameters and key derivation parameters
Diffstat (limited to 'rsa.cpp')
-rw-r--r--rsa.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/rsa.cpp b/rsa.cpp
index 79e49bbb..1e00a6cf 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)