summaryrefslogtreecommitdiff
path: root/fat-arm.c
diff options
context:
space:
mode:
authorYuriy M. Kaminskiy <yumkam@gmail.com>2019-01-02 19:41:32 +0300
committerNiels Möller <nisse@lysator.liu.se>2019-01-19 09:21:40 +0100
commit67bae1b9e595a03dccea92b39f3cbad64345f3f8 (patch)
treeb08030e2811ebd7400cb169d74024040d05787ee /fat-arm.c
parentf9f14f18d917a4a4fcb678a9e90961e5fd7114ef (diff)
downloadnettle-67bae1b9e595a03dccea92b39f3cbad64345f3f8.tar.gz
Add --enable-fat support for arm neon chacha20
On BCM2837B0 (Cortex-A53) @1.4GHz (Raspberry Pi 3B+), Before: `gnutls-cli --benchmark-ciphers` CHACHA20-POLY1305 (16384) 51.54 MB/sec `gnutls-cli --benchmark-tls-ciphers`: ECDHE_RSA_CHACHA20_POLY1305 (payload 1400) 21.31 MB/sec ECDHE_RSA_CHACHA20_POLY1305 (payload 15360) 24.60 MB/sec `nettle-benchmark` chacha encrypt 71.90 chacha decrypt 71.89 chacha_poly1305 encrypt 48.17 chacha_poly1305 decrypt 48.17 chacha_poly1305 update 146.03 After: `gnutls-cli --benchmark-ciphers` CHACHA20-POLY1305 (16384) 68.44 MB/sec `gnutls-cli --benchmark-tls-ciphers`: ECDHE_RSA_CHACHA20_POLY1305 (payload 1400) 27.25 MB/sec ECDHE_RSA_CHACHA20_POLY1305 (payload 15360) 32.41 MB/sec `nettle-benchmark` chacha encrypt 106.00 chacha decrypt 105.94 chacha_poly1305 encrypt 65.94 chacha_poly1305 decrypt 65.96 chacha_poly1305 update 175.24
Diffstat (limited to 'fat-arm.c')
-rw-r--r--fat-arm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fat-arm.c b/fat-arm.c
index 5e656359..56099e6f 100644
--- a/fat-arm.c
+++ b/fat-arm.c
@@ -171,6 +171,10 @@ DECLARE_FAT_FUNC(_nettle_umac_nh_n, umac_nh_n_func)
DECLARE_FAT_FUNC_VAR(umac_nh_n, umac_nh_n_func, c);
DECLARE_FAT_FUNC_VAR(umac_nh_n, umac_nh_n_func, neon);
+DECLARE_FAT_FUNC(_nettle_chacha_core, chacha_core_func)
+DECLARE_FAT_FUNC_VAR(_chacha_core, chacha_core_func, c);
+DECLARE_FAT_FUNC_VAR(_chacha_core, chacha_core_func, neon);
+
static void CONSTRUCTOR
fat_init (void)
{
@@ -212,6 +216,7 @@ fat_init (void)
nettle_sha3_permute_vec = _nettle_sha3_permute_neon;
_nettle_umac_nh_vec = _nettle_umac_nh_neon;
_nettle_umac_nh_n_vec = _nettle_umac_nh_n_neon;
+ _nettle_chacha_core_vec = _nettle_chacha_core_neon;
}
else
{
@@ -222,6 +227,7 @@ fat_init (void)
nettle_sha3_permute_vec = _nettle_sha3_permute_c;
_nettle_umac_nh_vec = _nettle_umac_nh_c;
_nettle_umac_nh_n_vec = _nettle_umac_nh_n_c;
+ _nettle_chacha_core_vec = _nettle_chacha_core_c;
}
}
@@ -267,3 +273,7 @@ DEFINE_FAT_FUNC(_nettle_umac_nh_n, void,
unsigned length, const uint8_t *msg),
(out, n, key, length, msg))
+DEFINE_FAT_FUNC(_nettle_chacha_core, void,
+ (uint32_t *dst, const uint32_t *src, unsigned rounds),
+ (dst, src, rounds))
+