Add ARMv8/AArch32 Crypto Extension implementation of SHA-1
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Thu, 14 Jul 2016 14:55:28 +0000 (17:55 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Thu, 14 Jul 2016 14:55:28 +0000 (17:55 +0300)
commit3d6334f8d94c2a4df10eed203ae928298a4332ef
tree1ccdb5ff48d2c5cce9f1839527a10be8776c5402
parenteee78f6e1fbce7d54c43fb7efc5aa8be9f52755f
Add ARMv8/AArch32 Crypto Extension implementation of SHA-1

* cipher/Makefile.am: Add 'sha1-armv8-aarch32-ce.S'.
* cipher/sha1-armv7-neon.S (_gcry_sha1_transform_armv7_neon): Add
missing size.
* cipher/sha1-armv8-aarch32-ce.S: New.
* cipher/sha1.c (USE_ARM_CE): New.
(sha1_init): Check features for HWF_ARM_SHA1.
[USE_ARM_CE] (_gcry_sha1_transform_armv8_ce): New.
(transform) [USE_ARM_CE]: Use ARMv8 CE implementation if HW supports
it.
* cipher/sha1.h (SHA1_CONTEXT): Add 'use_arm_ce'.
* configure.ac: Add 'sha1-armv8-aarch32-ce.lo'.
--

Benchmark on Cortex-A53 (1152 Mhz):

Before (SHA-1 NEON):

                 |  nanosecs/byte   mebibytes/sec   cycles/byte
  SHA1           |      6.62 ns/B     144.2 MiB/s      7.62 c/B

After (~3.8x faster):

                 |  nanosecs/byte   mebibytes/sec   cycles/byte
  SHA1           |      1.73 ns/B     552.2 MiB/s      1.99 c/B

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
cipher/Makefile.am
cipher/sha1-armv7-neon.S
cipher/sha1-armv8-aarch32-ce.S [new file with mode: 0644]
cipher/sha1.c
cipher/sha1.h
configure.ac