diff options
author | lloyd <[email protected]> | 2009-11-18 01:41:31 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-11-18 01:41:31 +0000 |
commit | 061733a4f765a4a40ae12108bc8e61a9bcf3a4d8 (patch) | |
tree | 31103313f7da55dd22b196e161c5db242bb43b44 /src/pubkey/elgamal/elg_op.cpp | |
parent | d5310f79218a960fea4b8522d4529305971334ce (diff) |
Use async in ElGamal encryption and Nyberg-Rueppel verification
Diffstat (limited to 'src/pubkey/elgamal/elg_op.cpp')
-rw-r--r-- | src/pubkey/elgamal/elg_op.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pubkey/elgamal/elg_op.cpp b/src/pubkey/elgamal/elg_op.cpp index 1e476ab7a..db828a300 100644 --- a/src/pubkey/elgamal/elg_op.cpp +++ b/src/pubkey/elgamal/elg_op.cpp @@ -1,11 +1,12 @@ /* * ElGamal Operations -* (C) 1999-2007 Jack Lloyd +* (C) 1999-2009 Jack Lloyd * * Distributed under the terms of the Botan license */ #include <botan/elg_op.h> +#include <botan/async.h> namespace Botan { @@ -33,8 +34,9 @@ SecureVector<byte> Default_ELG_Op::encrypt(const byte in[], u32bit length, if(m >= p) throw Invalid_Argument("Default_ELG_Op::encrypt: Input is too large"); - BigInt a = powermod_g_p(k); + auto future_a = std_async([&]() { return powermod_g_p(k); }); BigInt b = mod_p.multiply(m, powermod_y_p(k)); + BigInt a = future_a.get(); SecureVector<byte> output(2*p.bytes()); a.binary_encode(output + (p.bytes() - a.bytes())); |