diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2022-07-27 21:29:57 +0300 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2022-07-31 18:03:35 +0300 |
commit | 2ac6c24aa53024eb415d49f52229e868f72f47f8 (patch) | |
tree | 68bea988a5d46c963d23d756228f9e536d2d5e6a /cipher/rijndael-ppc-common.h | |
parent | e51d3b8330a1d4b15e3484df90646e075c02f54b (diff) | |
download | libgcrypt-2ac6c24aa53024eb415d49f52229e868f72f47f8.tar.gz |
rijndael-ppc: small speed-up for CBC and CFB encryption
* cipher/rijndael-ppc-common.h (AES_ENCRYPT_ALL): Remove
* cipher/rijndael-ppc-functions.h (CFB_ENC_FUNC)
(CBC_ENC_FUNC): Removed two block unrolled loop; Optimized single
block loop for shorter critical-path.
--
Patch gives small ~3% performance increase for CBC and CFB
encryption, tested with POWER8.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/rijndael-ppc-common.h')
-rw-r--r-- | cipher/rijndael-ppc-common.h | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/cipher/rijndael-ppc-common.h b/cipher/rijndael-ppc-common.h index bbbeaac0..3fa9a0b9 100644 --- a/cipher/rijndael-ppc-common.h +++ b/cipher/rijndael-ppc-common.h @@ -158,31 +158,6 @@ typedef union rkeylast = ALIGNED_LOAD (rk, nrounds); \ } while (0) -#define AES_ENCRYPT_ALL(blk, nrounds) \ - do { \ - blk ^= rkey0; \ - blk = asm_cipher_be (blk, rkey1); \ - blk = asm_cipher_be (blk, rkey2); \ - blk = asm_cipher_be (blk, rkey3); \ - blk = asm_cipher_be (blk, rkey4); \ - blk = asm_cipher_be (blk, rkey5); \ - blk = asm_cipher_be (blk, rkey6); \ - blk = asm_cipher_be (blk, rkey7); \ - blk = asm_cipher_be (blk, rkey8); \ - blk = asm_cipher_be (blk, rkey9); \ - if (nrounds >= 12) \ - { \ - blk = asm_cipher_be (blk, rkey10); \ - blk = asm_cipher_be (blk, rkey11); \ - if (rounds > 12) \ - { \ - blk = asm_cipher_be (blk, rkey12); \ - blk = asm_cipher_be (blk, rkey13); \ - } \ - } \ - blk = asm_cipherlast_be (blk, rkeylast); \ - } while (0) - static ASM_FUNC_ATTR_INLINE block asm_aligned_ld(unsigned long offset, const void *ptr) |