chacha20: add ARMv7/NEON implementation
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Wed, 6 Aug 2014 17:05:16 +0000 (20:05 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Sun, 2 Nov 2014 14:00:48 +0000 (16:00 +0200)
commitc584f44543883346d5a565581ff99a0afce9c5e1
tree622f1578883dad739eaca3ea222ddc00a1222db7
parent669a83ba86c38b271d85ed4bf1cabc7cc8160583
chacha20: add ARMv7/NEON implementation

* cipher/Makefile.am: Add 'chacha20-armv7-neon.S'.
* cipher/chacha20-armv7-neon.S: New.
* cipher/chacha20.c (USE_NEON): New.
[USE_NEON] (_gcry_chacha20_armv7_neon_blocks): New.
(chacha20_do_setkey) [USE_NEON]: Use Neon implementation if
HWF_ARM_NEON flag set.
(selftest): Self-test encrypting buffer byte by byte.
* configure.ac [neonsupport=yes]: Add 'chacha20-armv7-neon.lo'.
--

Add Andrew Moon's public domain ARMv7/NEON implementation of ChaCha20. Original
source is available at: https://github.com/floodyberry/chacha-opt

Benchmark on Cortex-A8 (--cpu-mhz 1008):

Old:
 CHACHA20       |  nanosecs/byte   mebibytes/sec   cycles/byte
     STREAM enc |     13.45 ns/B     70.92 MiB/s     13.56 c/B
     STREAM dec |     13.45 ns/B     70.90 MiB/s     13.56 c/B

New:
 CHACHA20       |  nanosecs/byte   mebibytes/sec   cycles/byte
     STREAM enc |      6.20 ns/B     153.9 MiB/s      6.25 c/B
     STREAM dec |      6.20 ns/B     153.9 MiB/s      6.25 c/B

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