Home GnuPG

Add ARM/NEON implementation for SHA-1
fc7dcf616937Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Add ARM/NEON implementation for SHA-1

* cipher/Makefile.am: Add 'sha1-armv7-neon.S'.
* cipher/sha1-armv7-neon.S: New.
* cipher/sha1.c (USE_NEON): New.
(SHA1_CONTEXT, sha1_init) [USE_NEON]: Add and initialize 'use_neon'.
[USE_NEON] (_gcry_sha1_transform_armv7_neon): New.
(transform) [USE_NEON]: Use ARM/NEON assembly if enabled.
* configure.ac: Add 'sha1-armv7-neon.lo'.

Patch adds ARM/NEON implementation for SHA-1.

Benchmarks show 1.72x improvement on ARM Cortex-A8, 1008 Mhz:

jussi@cubie:~/libgcrypt$ tests/bench-slope --cpu-mhz 1008 hash sha1
Hash:

|  nanosecs/byte   mebibytes/sec   cycles/byte

SHA1 | 7.80 ns/B 122.3 MiB/s 7.86 c/B

=

jussi@cubie:~/libgcrypt$ tests/bench-slope --disable-hwf arm-neon --cpu-mhz 1008 hash sha1
Hash:

|  nanosecs/byte   mebibytes/sec   cycles/byte

SHA1 | 13.41 ns/B 71.10 MiB/s 13.52 c/B

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

Details

Provenance
jukiviliAuthored on Dec 17 2013, 2:35 PM
Parents
rCdf629ba53a66: Improve performance of SHA-512/ARM/NEON implementation
Branches
Unknown
Tags
Unknown

Event Timeline

Jussi Kivilinna <jussi.kivilinna@iki.fi> committed rCfc7dcf616937: Add ARM/NEON implementation for SHA-1 (authored by Jussi Kivilinna <jussi.kivilinna@iki.fi>).Dec 18 2013, 4:00 PM