diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-02-12 12:02:16 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-02-12 15:12:21 +0100 |
commit | e5d72b7c92d5af171855c8267c57f5e33ff6cc2e (patch) | |
tree | 07c780f8eb954cd98926d52a08914f60522b1c49 /ipc | |
parent | 567d70df3b889bf862a18be7b17473efddf993c8 (diff) |
openpgp: Add optional plaintext length to Decryptor::decrypt.
- If we know the length of the plaintext, we can reduce the
side-channel leakage of the RSA decryption operation.
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/src/gnupg.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ipc/src/gnupg.rs b/ipc/src/gnupg.rs index 561c749b..dd74ef77 100644 --- a/ipc/src/gnupg.rs +++ b/ipc/src/gnupg.rs @@ -743,7 +743,8 @@ impl<'a> crypto::Decryptor for KeyPair<'a> { self.public } - fn decrypt(&mut self, ciphertext: &crypto::mpis::Ciphertext) + fn decrypt(&mut self, ciphertext: &crypto::mpis::Ciphertext, + _plaintext_len: Option<usize>) -> Result<crypto::SessionKey> { use crate::openpgp::crypto::mpis::{PublicKey, Ciphertext}; |