aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/nr/nr_op.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-12-16 22:54:39 +0000
committerlloyd <[email protected]>2009-12-16 22:54:39 +0000
commit1d595f8976483078c292e365bde3949c9de26332 (patch)
tree874f7cb1b2ba23405bc69330e6233eb567bf2ec4 /src/pubkey/nr/nr_op.cpp
parentf3f36611db8c3f6c67c818d454973a0165b0fcf2 (diff)
parent85b961ff87c1d6300451538c939c99a2ff74b505 (diff)
propagate from branch 'net.randombit.botan' (head 22c82e10d78ad0e2cdaa56cb02f3d846ed0ead5e)
to branch 'net.randombit.botan.c++0x' (head 74dbf310b7fcc11f94a16cd63046219acd5d62bc)
Diffstat (limited to 'src/pubkey/nr/nr_op.cpp')
-rw-r--r--src/pubkey/nr/nr_op.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pubkey/nr/nr_op.cpp b/src/pubkey/nr/nr_op.cpp
index b5efa3d37..da104802d 100644
--- a/src/pubkey/nr/nr_op.cpp
+++ b/src/pubkey/nr/nr_op.cpp
@@ -1,11 +1,12 @@
/*
* NR Operations
-* (C) 1999-2007 Jack Lloyd
+* (C) 1999-2009 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
#include <botan/nr_op.h>
+#include <botan/internal/async.h>
namespace Botan {
@@ -37,7 +38,10 @@ SecureVector<byte> Default_NR_Op::verify(const byte in[], u32bit length) const
if(c.is_zero() || c >= q || d >= q)
throw Invalid_Argument("Default_NR_Op::verify: Invalid signature");
- BigInt i = mod_p.multiply(powermod_g_p(d), powermod_y_p(c));
+ auto future_y_c = std_async([&]() { return 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));
}