AVX-Accelerated SM3 Secure Hashing Queued For Linux 5.18

Last year I wrote about Alibaba wanting to contribute AVX-optimized SM3 hashing for the Linux kernel to speed up that Chinese hashing algorithm that has use-cases similar to that of SHA256 while having similar security and performance. That work is now queued up into the crypto subsystem's "-next" branch for Linux 5.18.

SM3 is part of the Chinese Commercial Cryptography Suite and while there has been support for this algorithm within the Linux kernel - including within Arm's TrustZone CrpytoCell driver - there hasn't been any x86_64 optimized version. The work from Alibaba is optimized for modern Intel/AMD CPUs with Advanced Vector Extensions (AVX) and can dramatically speed-up the hashing process.

Last week the code was merged into cryptodev for creating an SM3 standalone library within the kernel and then introducing the AVX optimized code .


Alibaba's Tianjia Zhang is reporting up to a 38% increase in performance with this AVX code on a Skylake system. Look for this in Linux 5.18 should you have a use for SM3 not fulfilled by the likes of SHA256.