diff options
author | lloyd <[email protected]> | 2009-12-21 13:53:40 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-12-21 13:53:40 +0000 |
commit | 93e8fd697d009dfef3b994a77936cbf88d2d2ba3 (patch) | |
tree | e31140bd8a9f4de3fa0a4705dce389acf50197a0 /src/pubkey/nr/nr_op.cpp | |
parent | 75f32d61c6a78e4e63cfadd084730f20b5896493 (diff) | |
parent | 1d595f8976483078c292e365bde3949c9de26332 (diff) |
propagate from branch 'net.randombit.botan' (head 14c1d4dc8696d2705a70ec3d2403e01d2ca95265)
to branch 'net.randombit.botan.c++0x' (head c567fa7310ba082a837562092728c4b4b882bf82)
Diffstat (limited to 'src/pubkey/nr/nr_op.cpp')
-rw-r--r-- | src/pubkey/nr/nr_op.cpp | 8 |
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)); } |