diff options
author | lloyd <[email protected]> | 2010-07-09 20:28:29 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-07-09 20:28:29 +0000 |
commit | 91137b44613c7ed5a12a1c64a6fd3e119828c43c (patch) | |
tree | 60d3728bc11356dc60b37859ac34f1d61138e82d /src/pubkey/nr | |
parent | a2775c5bd9f6979da3e1981cdb1dec250e274fea (diff) | |
parent | 54bac11c5d4e051f996951feb6a037b1de001329 (diff) |
propagate from branch 'net.randombit.botan' (head 161b5c0300b72baa746f101fda1e2b4a7c71818c)
to branch 'net.randombit.botan.c++0x' (head 1fc3875bb8daf4ad0e90ba66db72642203cb9984)
Diffstat (limited to 'src/pubkey/nr')
-rw-r--r-- | src/pubkey/nr/nr.cpp | 6 |
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)); } |