aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/rsa/rsa.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-07-09 20:28:29 +0000
committerlloyd <[email protected]>2010-07-09 20:28:29 +0000
commit91137b44613c7ed5a12a1c64a6fd3e119828c43c (patch)
tree60d3728bc11356dc60b37859ac34f1d61138e82d /src/pubkey/rsa/rsa.cpp
parenta2775c5bd9f6979da3e1981cdb1dec250e274fea (diff)
parent54bac11c5d4e051f996951feb6a037b1de001329 (diff)
propagate from branch 'net.randombit.botan' (head 161b5c0300b72baa746f101fda1e2b4a7c71818c)
to branch 'net.randombit.botan.c++0x' (head 1fc3875bb8daf4ad0e90ba66db72642203cb9984)
Diffstat (limited to 'src/pubkey/rsa/rsa.cpp')
-rw-r--r--src/pubkey/rsa/rsa.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pubkey/rsa/rsa.cpp b/src/pubkey/rsa/rsa.cpp
index 133164c31..4a673e2b4 100644
--- a/src/pubkey/rsa/rsa.cpp
+++ b/src/pubkey/rsa/rsa.cpp
@@ -10,6 +10,7 @@
#include <botan/parsing.h>
#include <botan/numthry.h>
#include <botan/keypair.h>
+#include <future>
namespace Botan {
@@ -21,7 +22,7 @@ RSA_PrivateKey::RSA_PrivateKey(RandomNumberGenerator& rng,
{
if(bits < 512)
throw Invalid_Argument(algo_name() + ": Can't make a key that is only " +
- to_string(bits) + " bits long");
+ std::to_string(bits) + " bits long");
if(exp < 3 || exp % 2 == 0)
throw Invalid_Argument(algo_name() + ": Invalid encryption exponent");
@@ -76,8 +77,9 @@ BigInt RSA_Private_Operation::private_op(const BigInt& m) const
if(m >= n)
throw Invalid_Argument("RSA private op - input is too large");
- BigInt j1 = powermod_d1_p(m);
+ auto future_j1 = std::async(std::launch::async, powermod_d1_p, m);
BigInt j2 = powermod_d2_q(m);
+ BigInt j1 = future_j1.get();
j1 = mod_p.reduce(sub_mul(j1, j2, c));