aboutsummaryrefslogtreecommitdiffstats
path: root/src/elgamal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/elgamal.cpp')
-rw-r--r--src/elgamal.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/elgamal.cpp b/src/elgamal.cpp
index 4389e3457..02257af03 100644
--- a/src/elgamal.cpp
+++ b/src/elgamal.cpp
@@ -33,12 +33,11 @@ void ElGamal_PublicKey::X509_load_hook()
/*************************************************
* ElGamal Encryption Function *
*************************************************/
-SecureVector<byte> ElGamal_PublicKey::encrypt(const byte in[],
- u32bit length) const
+SecureVector<byte>
+ElGamal_PublicKey::encrypt(const byte in[], u32bit length,
+ RandomNumberGenerator& rng) const
{
- BigInt k(global_state().prng_reference(),
- 2 * dl_work_factor(group_p().bits()));
-
+ BigInt k(rng, 2 * dl_work_factor(group_p().bits()));
return core.encrypt(in, length, k);
}