SM3 acceleration with SM3 hardware instruction on aarch64
authorfangming.fang <fangming.fang@arm.com>
Fri, 24 Dec 2021 08:29:04 +0000 (08:29 +0000)
committerTomas Mraz <tomas@openssl.org>
Fri, 14 Jan 2022 10:40:05 +0000 (11:40 +0100)
commit71396cd048072b69559b46d98cfebfd4474cd712
tree3b29b3ce3f469473600816c6fdabf79e858ce91b
parent79704a88eb5aa70fa506e3e59a29fcda21f428af
SM3 acceleration with SM3 hardware instruction on aarch64

SM3 hardware instruction is optional feature of crypto extension for
aarch64. This implementation accelerates SM3 via SM3 instructions. For
the platform not supporting SM3 instruction, the original C
implementation still works. Thanks to AliBaba for testing and reporting
the following perf numbers for Yitian710:

Benchmark on T-Head Yitian-710 2.75GHz:

Before:
type  16 bytes     64 bytes    256 bytes    1024 bytes   8192 bytes   16384 bytes
sm3   49297.82k   121062.63k   223106.05k   283371.52k   307574.10k   309400.92k

After (33% - 74% faster):
type  16 bytes     64 bytes    256 bytes    1024 bytes   8192 bytes   16384 bytes
sm3   65640.01k   179121.79k   359854.59k   481448.96k   534055.59k   538274.47k

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17454)
crypto/arm64cpuid.pl
crypto/arm_arch.h
crypto/armcap.c
crypto/sm3/asm/sm3-armv8.pl [new file with mode: 0644]
crypto/sm3/build.info
crypto/sm3/sm3_local.h