aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/elgamal/elgamal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubkey/elgamal/elgamal.cpp')
-rw-r--r--src/pubkey/elgamal/elgamal.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pubkey/elgamal/elgamal.cpp b/src/pubkey/elgamal/elgamal.cpp
index 837528af8..3e22aee1a 100644
--- a/src/pubkey/elgamal/elgamal.cpp
+++ b/src/pubkey/elgamal/elgamal.cpp
@@ -7,7 +7,6 @@
#include <botan/elgamal.h>
#include <botan/numthry.h>
-#include <botan/libstate.h>
#include <botan/keypair.h>
#include <botan/internal/workfactor.h>
@@ -98,14 +97,15 @@ ElGamal_Encryption_Operation::encrypt(const byte msg[], size_t msg_len,
return output;
}
-ElGamal_Decryption_Operation::ElGamal_Decryption_Operation(const ElGamal_PrivateKey& key)
+ElGamal_Decryption_Operation::ElGamal_Decryption_Operation(const ElGamal_PrivateKey& key,
+ RandomNumberGenerator& rng)
{
const BigInt& p = key.group_p();
powermod_x_p = Fixed_Exponent_Power_Mod(key.get_x(), p);
mod_p = Modular_Reducer(p);
- BigInt k(global_state().global_rng(), std::min<size_t>(160, p.bits() - 1));
+ BigInt k(rng, p.bits() - 1);
blinder = Blinder(k, powermod_x_p(k), p);
}