diff options
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())); |