aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/nr/nr.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-21 23:30:14 +0000
committerlloyd <[email protected]>2010-03-21 23:30:14 +0000
commitf8a77dd91e8b3aed644c2c206ff9b8822fb3ae02 (patch)
tree315cbc118a8ba2afda674154e7c65e8900a00cb8 /src/pubkey/nr/nr.cpp
parent572c106e868821da13447ca7349523ef4a90ec2c (diff)
parent634f3d27f7faad1dc558821382f71ecc2194637d (diff)
propagate from branch 'net.randombit.botan' (head 96d0a1885774b624812fd143d541c8bcda319217)
to branch 'net.randombit.botan.c++0x' (head e14368ab9d7976f3e111c6bc0adf24eebeb7c114)
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 3c5b71ad2..7eaa75581 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[], u32bit 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));
}