diff options
| author | Jussi Kivilinna <[email protected]> | 2022-02-08 16:31:54 +0000 |
|---|---|---|
| committer | Jussi Kivilinna <[email protected]> | 2022-02-08 17:21:18 +0000 |
| commit | ab177eed514f7f3432d78e7e6521ad24cc0f4762 (patch) | |
| tree | 0dc5e790466c7f2f007fee334e9b0dbb106f754a /sm/call-dirmngr.c | |
| parent | sm: New option --ignore-cert-with-oid. (diff) | |
| download | gnupg-ab177eed514f7f3432d78e7e6521ad24cc0f4762.tar.gz gnupg-ab177eed514f7f3432d78e7e6521ad24cc0f4762.zip | |
g10/mainproc: avoid extra hash contexts when decrypting MDC input
* g10/mainproc.c (mainproc_context): New member
'seen_pkt_encrypted_mdc'.
(release_list): Clear 'seen_pkt_encrypted_mdc'.
(proc_encrypted): Set 'seen_pkt_encrypted_mdc'.
(have_seen_pkt_encrypted_aead): Rename to...
(have_seen_pkt_encrypted_aead_or_mdc): ...this and add check for
'seen_pkt_encrypted_mdc'.
(proc_plaintext): Do not enable extra hash contexts when decrypting
MDC input.
--
Avoiding extra hash contexts speeds up CFB/MDC decryption quite
a lot. For example, decrypting symmetric-key AES-256 encrypted
4 GiB file from RAM to /dev/null sees ~3.4x speed increase on
AMD Ryzen 5800X:
AES256.CFB encryption: 783 MB/s
AES256.CFB decryption: 386 MB/s (before)
AES256.CFB encryption: 1.3 GB/s (after patch)
Note, AEAD is still significantly faster:
AES256.OCB encryption: 2.2 GB/s
AES256.OCB decryption: 3.0 GB/s
GnuPG-bug-id: T5820
Signed-off-by: Jussi Kivilinna <[email protected]>
Diffstat (limited to 'sm/call-dirmngr.c')
0 files changed, 0 insertions, 0 deletions
