aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/elgamal/elgamal.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-03-19 22:52:48 -0400
committerJack Lloyd <[email protected]>2016-03-20 09:38:22 -0400
commitb8966d0f89e520cecf3e822241aef38ed9a6d876 (patch)
tree9b5c0f6afa89e8e91ef230e3d7824b10e037802c /src/lib/pubkey/elgamal/elgamal.cpp
parentada363473a9491a3b07e3bb6fa2b5fd9f12aec98 (diff)
Clean up PK decryption encoding.
Previously RSA and ElGamal stripped off leading zeros which were then assumed by the padding decoders. Instead have them produce ciphertexts with leading zeros. Changes EME_Raw to strip leading zeros to match existing behavior.
Diffstat (limited to 'src/lib/pubkey/elgamal/elgamal.cpp')
-rw-r--r--src/lib/pubkey/elgamal/elgamal.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/pubkey/elgamal/elgamal.cpp b/src/lib/pubkey/elgamal/elgamal.cpp
index 10dc195a8..37dfe89cf 100644
--- a/src/lib/pubkey/elgamal/elgamal.cpp
+++ b/src/lib/pubkey/elgamal/elgamal.cpp
@@ -174,7 +174,7 @@ ElGamal_Decryption_Operation::raw_decrypt(const byte msg[], size_t msg_len)
BigInt r = m_mod_p.multiply(b, inverse_mod(m_powermod_x_p(a), p));
- return BigInt::encode_locked(m_blinder.unblind(r));
+ return BigInt::encode_1363(m_blinder.unblind(r), p_bytes);
}
BOTAN_REGISTER_PK_ENCRYPTION_OP("ElGamal", ElGamal_Encryption_Operation);