diff options
author | Jeffrey Walton <noloader@gmail.com> | 2015-11-18 15:32:28 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2015-11-18 15:32:28 -0500 |
commit | 6ac1e46a1fb01f01705b67dd553d5ba317b1dc3e (patch) | |
tree | f0d873d0b377a91dce5ee384e60426ef57efc92b /rsa.cpp | |
parent | d2fda9bd4231a7dfcb44e59150f11246d992843f (diff) | |
download | cryptopp-git-6ac1e46a1fb01f01705b67dd553d5ba317b1dc3e.tar.gz |
Cleared issues 11,12,13 (Clang integrated assembler), 58 (RC rollup), 66 (Coverity rollup)
Diffstat (limited to 'rsa.cpp')
-rw-r--r-- | rsa.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -3,14 +3,14 @@ #include "pch.h"
#include "rsa.h"
#include "asn.h"
+#include "sha.h"
#include "oids.h"
#include "modarith.h"
#include "nbtheory.h"
-#include "sha.h"
#include "algparam.h"
#include "fips140.h"
-#if !defined(NDEBUG) && !defined(CRYPTOPP_IS_DLL)
+#if !defined(NDEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING) && !defined(CRYPTOPP_IS_DLL)
#include "pssr.h"
NAMESPACE_BEGIN(CryptoPP)
void RSA_TestInstantiations()
@@ -108,11 +108,13 @@ void InvertibleRSAFunction::GenerateRandom(RandomNumberGenerator &rng, const Nam int modulusSize = 2048;
alg.GetIntValue(Name::ModulusSize(), modulusSize) || alg.GetIntValue(Name::KeySize(), modulusSize);
+ assert(modulusSize >= 16);
if (modulusSize < 16)
throw InvalidArgument("InvertibleRSAFunction: specified modulus size is too small");
m_e = alg.GetValueWithDefault(Name::PublicExponent(), Integer(17));
+ assert(m_e >= 3); assert(!m_e.IsEven());
if (m_e < 3 || m_e.IsEven())
throw InvalidArgument("InvertibleRSAFunction: invalid public exponent");
|