aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/elgamal/elgamal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/pubkey/elgamal/elgamal.cpp')
-rw-r--r--src/lib/pubkey/elgamal/elgamal.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/lib/pubkey/elgamal/elgamal.cpp b/src/lib/pubkey/elgamal/elgamal.cpp
index 4d0344610..5bcdd5689 100644
--- a/src/lib/pubkey/elgamal/elgamal.cpp
+++ b/src/lib/pubkey/elgamal/elgamal.cpp
@@ -145,16 +145,13 @@ class ElGamal_Decryption_Operation : public PK_Ops::Decryption_with_EME
ElGamal_Decryption_Operation::ElGamal_Decryption_Operation(const ElGamal_PrivateKey& key,
const std::string& eme) :
- PK_Ops::Decryption_with_EME(eme)
+ PK_Ops::Decryption_with_EME(eme),
+ powermod_x_p(Fixed_Exponent_Power_Mod(key.get_x(), key.group_p())),
+ mod_p(Modular_Reducer(key.group_p())),
+ blinder(key.group_p(),
+ [](const BigInt& k) { return k; },
+ [this](const BigInt& k) { return powermod_x_p(k); })
{
- const BigInt& p = key.group_p();
-
- powermod_x_p = Fixed_Exponent_Power_Mod(key.get_x(), p);
- mod_p = Modular_Reducer(p);
-
- blinder = Blinder(p,
- [](const BigInt& k) { return k; },
- [this](const BigInt& k) { return powermod_x_p(k); });
}
secure_vector<byte>