Home GnuPG

aria: add generic 2-way bulk processing

Description

aria: add generic 2-way bulk processing

* cipher/aria.c (ARIA_context): Add 'bulk_prefetch_ready'.
(aria_crypt_2blks, aria_crypt_blocks, aria_enc_blocks, aria_dec_blocks)
(_gcry_aria_ctr_enc, _gcry_aria_cbc_enc, _gcry_aria_cbc_dec)
(_gcry_aria_cfb_enc, _gcry_aria_cfb_dec, _gcry_aria_ecb_crypt)
(_gcry_aria_xts_crypt, _gcry_aria_ctr32le_enc, _gcry_aria_ocb_crypt)
(_gcry_aria_ocb_auth): New.
(aria_setkey): Setup 'bulk_ops' function pointers.

Patch adds 2-way parallel generic ARIA implementation for modest
performance increase.

Benchmark on AMD Ryzen 9 7900X (x86-64) shows ~40% performance
improvement for parallelizable modes:

ARIA128 | nanosecs/byte mebibytes/sec cycles/byte auto Mhz

     ECB enc |      2.62 ns/B     364.0 MiB/s     14.74 c/B      5625
     ECB dec |      2.61 ns/B     365.2 MiB/s     14.69 c/B      5625
     CBC enc |      3.62 ns/B     263.7 MiB/s     20.34 c/B      5625
     CBC dec |      2.63 ns/B     363.0 MiB/s     14.78 c/B      5625
     CFB enc |      3.59 ns/B     265.3 MiB/s     20.22 c/B      5625
     CFB dec |      2.63 ns/B     362.0 MiB/s     14.82 c/B      5625
     OFB enc |      3.98 ns/B     239.7 MiB/s     22.38 c/B      5625
     OFB dec |      4.00 ns/B     238.2 MiB/s     22.52 c/B      5625
     CTR enc |      2.64 ns/B     360.6 MiB/s     14.87 c/B      5624
     CTR dec |      2.65 ns/B     360.0 MiB/s     14.90 c/B      5625
     XTS enc |      2.68 ns/B     355.8 MiB/s     15.08 c/B      5625
     XTS dec |      2.67 ns/B     356.9 MiB/s     15.03 c/B      5625
     CCM enc |      6.24 ns/B     152.7 MiB/s     35.12 c/B      5625
     CCM dec |      6.25 ns/B     152.5 MiB/s     35.18 c/B      5625
    CCM auth |      3.59 ns/B     265.4 MiB/s     20.21 c/B      5625
     EAX enc |      6.23 ns/B     153.0 MiB/s     35.06 c/B      5625
     EAX dec |      6.23 ns/B     153.1 MiB/s     35.05 c/B      5625
    EAX auth |      3.59 ns/B     265.4 MiB/s     20.22 c/B      5625
     GCM enc |      2.68 ns/B     355.8 MiB/s     15.08 c/B      5625
     GCM dec |      2.69 ns/B     354.7 MiB/s     15.12 c/B      5625
    GCM auth |     0.031 ns/B     30832 MiB/s     0.174 c/B      5625
     OCB enc |      2.71 ns/B     351.4 MiB/s     15.27 c/B      5625
     OCB dec |      2.74 ns/B     347.6 MiB/s     15.43 c/B      5625
    OCB auth |      2.64 ns/B     360.8 MiB/s     14.87 c/B      5625
     SIV enc |      6.24 ns/B     152.9 MiB/s     35.08 c/B      5625
     SIV dec |      6.24 ns/B     152.8 MiB/s     35.10 c/B      5625
    SIV auth |      3.59 ns/B     266.0 MiB/s     20.17 c/B      5625
 GCM-SIV enc |      2.67 ns/B     356.7 MiB/s     15.04 c/B      5625
 GCM-SIV dec |      2.68 ns/B     355.7 MiB/s     15.08 c/B      5625
GCM-SIV auth |     0.034 ns/B     28303 MiB/s     0.190 c/B      5625

Cc: Taehee Yoo <ap420073@gmail.com>

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on Jan 4 2023, 6:48 PM
Parents
rC316c6d7715d9: Add ARIA block cipher
Branches
Unknown
Tags
Unknown