Add ARMv7/NEON accelerated GCM implementation
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Sat, 23 Mar 2019 14:15:49 +0000 (16:15 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Sat, 23 Mar 2019 19:07:44 +0000 (21:07 +0200)
commit2445cf7431fab921f6c1870da7084ee698992064
tree495a5bb97eccf133255eb5e939346ffceb5a6424
parent6f2391d2df029b0e1a4e5dde17c3d97cc594a1c7
Add ARMv7/NEON accelerated GCM implementation

* cipher/Makefile.am: Add 'cipher-gcm-armv7-neon.S'.
* cipher/cipher-gcm-armv7-neon.S: New.
* cipher/cipher-gcm.c [GCM_USE_ARM_NEON] (_gcry_ghash_setup_armv7_neon)
(_gcry_ghash_armv7_neon, ghash_setup_armv7_neon)
(ghash_armv7_neon): New.
(setupM) [GCM_USE_ARM_NEON]: Use armv7/neon implementation if have
HWF_ARM_NEON.
* cipher/cipher-internal.h (GCM_USE_ARM_NEON): New.
--

Benchmark on Cortex-A53 (816 Mhz):

Before:
                    |  nanosecs/byte   mebibytes/sec   cycles/byte
 GMAC_AES           |     34.81 ns/B     27.40 MiB/s     28.41 c/B

After (3.0x faster):
                    |  nanosecs/byte   mebibytes/sec   cycles/byte
 GMAC_AES           |     11.49 ns/B     82.99 MiB/s      9.38 c/B

Reported-by: Yuriy M. Kaminskiy <yumkam@gmail.com>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/Makefile.am
cipher/cipher-gcm-armv7-neon.S [new file with mode: 0644]
cipher/cipher-gcm.c
cipher/cipher-internal.h