aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/nr/nr.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-11-04 20:46:52 +0000
committerlloyd <[email protected]>2010-11-04 20:46:52 +0000
commite19a323006287c4dba58c6b530fbcafa47a8c8c5 (patch)
treec9da529f446e9a8b0119dfbb79dcd9787219deb4 /src/pubkey/nr/nr.cpp
parent5c1ca36f06ba06e2ba2e22efd7742571c8a7dcd3 (diff)
parentedf4cd93eedf8e6972edaccaea4b7b7ab45faded (diff)
propagate from branch 'net.randombit.botan' (head 303b2518a80553214b1e5ab4d9b96ef54629cbc7)
to branch 'net.randombit.botan.c++0x' (head d734eefabe4816be4dd3e3e6e7bb13b7ab5be148)
Diffstat (limited to 'src/pubkey/nr/nr.cpp')
-rw-r--r--src/pubkey/nr/nr.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pubkey/nr/nr.cpp b/src/pubkey/nr/nr.cpp
index 61cf7eb3f..e1c5e51da 100644
--- a/src/pubkey/nr/nr.cpp
+++ b/src/pubkey/nr/nr.cpp
@@ -8,6 +8,7 @@
#include <botan/nr.h>
#include <botan/numthry.h>
#include <botan/keypair.h>
+#include <future>
namespace Botan {
@@ -132,7 +133,10 @@ NR_Verification_Operation::verify_mr(const byte msg[], size_t msg_len)
if(c.is_zero() || c >= q || d >= q)
throw Invalid_Argument("NR verification: Invalid signature");
- BigInt i = mod_p.multiply(powermod_g_p(d), powermod_y_p(c));
+ auto future_y_c = std::async(std::launch::async, powermod_y_p, c);
+ BigInt g_d = powermod_g_p(d);
+
+ BigInt i = mod_p.multiply(g_d, future_y_c.get());
return BigInt::encode(mod_q.reduce(c - i));
}