Diffusion GnuPG e8142cc69a2a

g10/armor: optimize binary to radix64 conversion

Authored by jukivili on Nov 8 2018, 8:31 PM.

Description

g10/armor: optimize binary to radix64 conversion

* g10/armor.c (bintoasc): Change to read-only.
(initialize): Use const pointer for 'bintoasc'.
(armor_output_buf_as_radix64): New function for faster binary to
radix64 conversion.
(armor_filter): Use new conversion function.

This patch adds faster binary to radix64 conversion to speed up
armored encryption.

Benchmark results below, tested on Intel Core i7-4790K (turbo off).
Encrypted 2 GiB through pipe to ramfs file using AES128. Decrypt
ramfs file out through pipe to /dev/null.

before patch-set

gpg process

armor: user time pipe transfer rate
encrypt-aead: 13.8 140 MB/s
decrypt-aead: 30.6 68 MB/s
encrypt-cfb: 17.4 114 MB/s
decrypt-cfb: 32.6 64 MB/s

after (decrypt+iobuf+crc+radix64 opt)

gpg process

armor: user time pipe transfer rate
encrypt-aead: 2.7 523 MB/s
encrypt-cfb: 6.7 264 MB/s

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Committed
jukiviliNov 8 2018, 8:31 PM
Parents
rGe486d4f0259f: g10/armor: use libgcrypt's CRC24 implementation
Branches
Unknown
Tags
Unknown