rijndael-ppc: enable PowerPC AES-OCB implemention
* cipher/rijndael-ppc.c (ROUND_KEY_VARIABLES, PRELOAD_ROUND_KEYS) (AES_ENCRYPT, AES_DECRYPT): New. (_gcry_aes_ppc8_prepare_decryption): Rename to... (aes_ppc8_prepare_decryption): ... this. (_gcry_aes_ppc8_prepare_decryption): New. (aes_ppc8_encrypt_altivec, aes_ppc8_decrypt_altivec): Remove. (_gcry_aes_ppc8_encrypt): Use AES_ENCRYPT macro. (_gcry_aes_ppc8_decrypt): Use AES_DECRYPT macro. (_gcry_aes_ppc8_ocb_crypt): Uncomment; Optimizations for OCB offset calculations, etc; Use new load/store and encryption/decryption macros. * cipher/rijndaelc [USE_PPC_CRYPTO] (_gcry_aes_ppc8_ocb_crypt): New prototype. (do_setkey, _gcry_aes_ocb_crypt) [USE_PPC_CRYPTO]: Add PowerPC AES OCB encryption/decryption.
Benchmark on POWER8 ~3.8Ghz:
Before:
AES | nanosecs/byte mebibytes/sec cycles/byte
OCB enc | 2.33 ns/B 410.1 MiB/s 8.84 c/B OCB dec | 2.34 ns/B 407.2 MiB/s 8.90 c/B OCB auth | 2.32 ns/B 411.1 MiB/s 8.82 c/B
After:
OCB enc | 0.250 ns/B 3818 MiB/s 0.949 c/B OCB dec | 0.250 ns/B 3820 MiB/s 0.949 c/B OCB auth | 2.31 ns/B 412.5 MiB/s 8.79 c/B
- GnuPG-bug-id: T4529
- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>