AVX-Optimized SM3 Hashing For The Linux Kernel Nets Up To 38% Improvement

SM3 is another Chinese hashing function standard for digital signatures and other use-cases similar to SHA256 and part of the Chinese Commercial Cryptography suite. There has been SM3 hashing code in the Linux kernel since 2017 as well as support within Arm's TrustZone CryptoCell "CCREE" driver.
While the use of SM3 within the Linux kernel has been limited, Alibaba has been working to improve the implementation and introduce an AVX-optimized implementation for faster performance on modern Intel and AMD processors.
This patch series provides that updated implementation for this Chinese alternative to SHA256. Benchmarks of the SM3 AVX code on an Intel Skylake processor show up to a 38% performance improvement over the generic path.
At the moment these patches are just residing on the kernel mailing list and haven't yet been queued into the crypto branch for mainlining. Similarly, a few months back Alibaba also provided an AVX2-optimized SM4 block cipher implementation for that Chinese crypto algorithm used within their WLAN WAPI and other domestic purposes.
18 Comments