Home GnuPG

camellia: accelerate ECB (for benchmarking)

Description

camellia: accelerate ECB (for benchmarking)

* cipher/bulkhelp.h (bulk_ecb_crypt_128): New.
* cipher/camellia-glue.c (_gcry_camellia_ecb_crypt): New.
(camellia_setkey): Select ECB bulk function with AESNI/AVX2, VAES/AVX2
and GFNI/AVX2.

Benchmark on AMD Ryzen 9 7900X:

Before:
CAMELLIA128 | nanosecs/byte mebibytes/sec cycles/byte auto Mhz

ECB enc |      3.27 ns/B     291.8 MiB/s     18.38 c/B      5625
ECB dec |      3.25 ns/B     293.3 MiB/s     18.29 c/B      5625

After (OCB for reference):
CAMELLIA128 | nanosecs/byte mebibytes/sec cycles/byte auto Mhz

ECB enc |     0.146 ns/B      6533 MiB/s     0.803 c/B      5500
ECB dec |     0.149 ns/B      6384 MiB/s     0.822 c/B      5500
OCB enc |     0.170 ns/B      5608 MiB/s     0.957 c/B      5625
OCB dec |     0.175 ns/B      5452 MiB/s     0.984 c/B      5625
  • GnuPG-bug-id: T6242
  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>