diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2021-12-19 16:11:39 +0200 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2022-01-11 20:10:12 +0200 |
commit | f664333a4749eab03c6b19bae2f28863b8501a24 (patch) | |
tree | f99e8ca20138ad712533f0751c4f9c21472ef654 /tests/basic.c | |
parent | 560943805a525a6f479b666578b0ff7d51e6f833 (diff) | |
download | libgcrypt-f664333a4749eab03c6b19bae2f28863b8501a24.tar.gz |
Add SM3 ARM/AArch64 assembly implementation
* cipher/Makefile.am: Add 'sm3-aarch64.S'.
* cipher/sm3-aarch64.S: New.
* cipher/sm3.c (USE_AARCH64_SIMD): New.
[USE_AARCH64_SIMD] (_gcry_sm3_transform_aarch64)
(do_sm3_transform_aarch64): New.
(sm3_init) [USE_AARCH64_SIMD]: New.
* configure.ac: Add 'sm3-aarch64.lo'.
* tests/basic.c (main): Add command-line option '--hash' for running
only hash algorithm tests.
--
Benchmark on AWS Graviton2:
Before:
| nanosecs/byte mebibytes/sec cycles/byte auto Mhz
SM3 | 4.24 ns/B 224.8 MiB/s 10.61 c/B 2500
After (~34% faster):
| nanosecs/byte mebibytes/sec cycles/byte auto Mhz
SM3 | 3.15 ns/B 302.4 MiB/s 7.88 c/B 2500
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'tests/basic.c')
-rw-r--r-- | tests/basic.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/basic.c b/tests/basic.c index e619c2e3..9e0444f6 100644 --- a/tests/basic.c +++ b/tests/basic.c @@ -16285,6 +16285,7 @@ main (int argc, char **argv) int selftest_only = 0; int pubkey_only = 0; int cipher_modes_only = 0; + int hash_only = 0; int loop = 0; unsigned int loopcount = 0; @@ -16330,6 +16331,11 @@ main (int argc, char **argv) cipher_modes_only = 1; argc--; argv++; } + else if (!strcmp (*argv, "--hash")) + { + hash_only = 1; + argc--; argv++; + } else if (!strcmp (*argv, "--die")) { die_on_error = 1; @@ -16395,6 +16401,12 @@ main (int argc, char **argv) check_ciphers (); check_cipher_modes (); } + else if (hash_only) + { + check_digests (); + check_hmac (); + check_mac (); + } else if (!selftest_only) { check_ciphers (); |