diff options
author | lloyd <[email protected]> | 2010-02-14 06:18:15 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-02-14 06:18:15 +0000 |
commit | 7424a5b5102b569e3c052cb195c98b5d1b60ce30 (patch) | |
tree | 70ab6872b9980969a7dea97bccdcdbb4e4916f7a /src/pubkey/elgamal/elg_op.cpp | |
parent | 12e07d37e9622cfb24b2102090550a0260c6665c (diff) | |
parent | 16c3b54220d6e80f713a4d6321deb53a7b1e1fec (diff) |
propagate from branch 'net.randombit.botan' (head 5bfc3e699003b86615c584f8ae40bd6e761f96c0)
to branch 'net.randombit.botan.c++0x' (head 8c64a107b58d41f376bfffc69dfab4514d722c5c)
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..49db44251 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/internal/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())); |