Home GnuPG

aes-ppc: use target and optimize attributes for P8 and P9

Description

aes-ppc: use target and optimize attributes for P8 and P9

* cipher/rijndael-ppc-functions.h: Add PPC_OPT_ATTR attribute
macro for all functions.
* cipher/rijndael-ppc.c (FUNC_ATTR_OPT, PPC_OPT_ATTR): New.
(_gcry_aes_ppc8_setkey, _gcry_aes_ppc8_prepare_decryption): Add
PPC_OPT_ATTR attribute macro.
* cipher/rijndael-ppc9le.c (FUNC_ATTR_OPT, PPC_OPT_ATTR): New.

This change makes sure that PPC accelerated AES gets compiled
with proper optimization level and right target setting.

Benchmark on POWER9:
AES | nanosecs/byte mebibytes/sec cycles/byte

     ECB enc |     0.305 ns/B      3129 MiB/s     0.701 c/B
     ECB dec |     0.305 ns/B      3127 MiB/s     0.701 c/B
     CBC enc |      1.66 ns/B     575.3 MiB/s      3.81 c/B
     CBC dec |     0.318 ns/B      2997 MiB/s     0.732 c/B
     CFB enc |      1.66 ns/B     574.7 MiB/s      3.82 c/B
     CFB dec |     0.319 ns/B      2987 MiB/s     0.734 c/B
     OFB enc |      2.15 ns/B     443.4 MiB/s      4.95 c/B
     OFB dec |      2.15 ns/B     443.3 MiB/s      4.95 c/B
     CTR enc |     0.328 ns/B      2907 MiB/s     0.754 c/B
     CTR dec |     0.328 ns/B      2906 MiB/s     0.755 c/B
     XTS enc |     0.516 ns/B      1849 MiB/s      1.19 c/B
     XTS dec |     0.515 ns/B      1850 MiB/s      1.19 c/B
     CCM enc |      1.98 ns/B     480.6 MiB/s      4.56 c/B
     CCM dec |      1.98 ns/B     480.5 MiB/s      4.56 c/B
    CCM auth |      1.66 ns/B     574.9 MiB/s      3.82 c/B
     EAX enc |      1.99 ns/B     480.2 MiB/s      4.57 c/B
     EAX dec |      1.99 ns/B     480.2 MiB/s      4.57 c/B
    EAX auth |      1.66 ns/B     575.2 MiB/s      3.81 c/B
     GCM enc |     0.552 ns/B      1727 MiB/s      1.27 c/B
     GCM dec |     0.552 ns/B      1728 MiB/s      1.27 c/B
    GCM auth |     0.225 ns/B      4240 MiB/s     0.517 c/B
     OCB enc |     0.381 ns/B      2504 MiB/s     0.876 c/B
     OCB dec |     0.385 ns/B      2477 MiB/s     0.886 c/B
    OCB auth |     0.356 ns/B      2682 MiB/s     0.818 c/B
     SIV enc |      1.98 ns/B     480.9 MiB/s      4.56 c/B
     SIV dec |      2.11 ns/B     452.9 MiB/s      4.84 c/B
    SIV auth |      1.66 ns/B     575.4 MiB/s      3.81 c/B
 GCM-SIV enc |     0.726 ns/B      1314 MiB/s      1.67 c/B
 GCM-SIV dec |     0.843 ns/B      1131 MiB/s      1.94 c/B
GCM-SIV auth |     0.377 ns/B      2527 MiB/s     0.868 c/B
  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on Feb 26 2023, 12:47 PM
Parents
rC84f2e2d0b51b: aes-ppc: add CTR32LE bulk acceleration
Branches
Unknown
Tags
Unknown