diff options
author | lloyd <[email protected]> | 2010-10-13 03:25:16 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-13 03:25:16 +0000 |
commit | ba142ed2eaa21445d49cbbc8ae3b3d4dc625b9d7 (patch) | |
tree | be1a9fa07d0ea26fd7713bb52205f7a3bcc3e907 /src/pubkey/rsa/rsa.cpp | |
parent | 406d4f8556d41083bfa551e7a777b0cb02925b6c (diff) | |
parent | 5913bf42b4c32e43d0db11bf9299130f3b0b62a4 (diff) |
propagate from branch 'net.randombit.botan' (head 2898d79f992f27a328a3e41d34b46eb1052da0de)
to branch 'net.randombit.botan.c++0x' (head 6cba76268fd69a73195760c021b7f881b8a6552c)
Diffstat (limited to 'src/pubkey/rsa/rsa.cpp')
-rw-r--r-- | src/pubkey/rsa/rsa.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pubkey/rsa/rsa.cpp b/src/pubkey/rsa/rsa.cpp index 40c3968af..ebc06ddb7 100644 --- a/src/pubkey/rsa/rsa.cpp +++ b/src/pubkey/rsa/rsa.cpp @@ -10,7 +10,7 @@ #include <botan/parsing.h> #include <botan/numthry.h> #include <botan/keypair.h> -#include <botan/internal/assert.h> +#include <future> namespace Botan { @@ -22,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"); @@ -78,8 +78,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)); |