Process CCM/EAX/GCM/Poly1305 AEAD cipher modes input in 24 KiB chucks
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Wed, 2 Jan 2019 19:25:44 +0000 (21:25 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Wed, 2 Jan 2019 19:25:44 +0000 (21:25 +0200)
commit3ee6588de8311b461ef8707c70ff86d2b252966d
tree8d7c30e8145e9035d4c2fd5a3992187ff40a018f
parent4871f11745f33c5c5051bfe6f325ac1c10764b04
Process CCM/EAX/GCM/Poly1305 AEAD cipher modes input in 24 KiB chucks

* cipher/cipher-ccm.c (_gcry_cipher_ccm_encrypt)
(_gcry_cipher_ccm_decrypt): Process data in 24 KiB chunks.
* cipher/cipher-eax.c (_gcry_cipher_eax_encrypt)
(_gcry_cipher_eax_decrypt): Ditto.
* cipher/cipher-gcm.c (_gcry_cipher_gcm_encrypt)
(_gcry_cipher_gcm_decrypt): Ditto.
* cipher/cipher-poly1305.c (_gcry_cipher_poly1305_encrypt)
(_gcry_cipher_poly1305_decrypt): Ditto.
--

Patch changes AEAD modes to process input in 24 KiB chuncks to improve
cache locality when processing large buffers.

Huge buffer test in tests/benchmark show 0.7% improvement for AES-CCM
and AES-EAX, 6% for AES-GCM and 4% for Chacha20-Poly1305 on Intel Core
i7-4790K.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/cipher-ccm.c
cipher/cipher-eax.c
cipher/cipher-gcm.c
cipher/cipher-poly1305.c