Add AES-NI acceleration for AES-XTS

Authored by jukivili on Jan 6 2018, 5:53 PM.

Description

Add AES-NI acceleration for AES-XTS

* cipher/cipher-internal.h (gcry_cipher_handle): Change bulk
XTS function to take cipher context.
* cipher/cipher-xts.c (_gcry_cipher_xts_crypt): Ditto.
* cipher/cipher.c (_gcry_cipher_open_internal): Setup AES-NI
XTS bulk function.
* cipher/rijndael-aesni.c (xts_gfmul_const, _gcry_aes_aesni_xts_enc)
(_gcry_aes_aesni_xts_enc, _gcry_aes_aesni_xts_crypt): New.
* cipher/rijndael.c (_gcry_aes_aesni_xts_crypt)
(_gcry_aes_xts_crypt): New.
* src/cipher.h (_gcry_aes_xts_crypt): New.

Benchmarks on Intel Core i7-4790K, 4.0Ghz (no turbo):

Before:

XTS enc |      1.66 ns/B     575.7 MiB/s      6.63 c/B
XTS dec |      1.66 ns/B     575.5 MiB/s      6.63 c/B

After (~6x faster):

XTS enc |     0.270 ns/B    3528.5 MiB/s      1.08 c/B
XTS dec |     0.272 ns/B    3511.5 MiB/s      1.09 c/B
  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Committed
jukiviliJan 9 2018, 5:44 PM
Parents
rCc9e9cb2eb6a1: AES-NI improvements for AMD64
Branches
Unknown
Tags
Unknown