Paper 2022/1154

Efficient Constant-Time Implementation of SM4 with Intel GFNI instruction set extension and Arm NEON coprocessor

Weiji Guo, bilibili
Abstract

The efficiency of constant-time SM4 implementation has been lagging behind that of AES for most internet traffic and applicable data encryption scenarios. The best performance before our works was 3.77 cpb for x86 platform (AESNI + AVX2), and 8.62 cpb for Arm platform (NEON). Meanwhile the state of art constant-time AES implementation could reach 0.63 cpb. Dedicated SM4 instruction set extensions like those optionally available in Armv8.2, could achieve comparable cpb to AES. But they are only available in limited processors, therefore does not impact much to real-world uses. To fill the gap we explored some novel techniques with Intel GFNI instruction set extension and Arm NEON coprocessor. We achieved 1.51 cpb with GFNI + AVX512 and 2.62 cpb with GFNI + AVX2 for Intel processors; we also achieved 6.74 cpb with NEON. In addition, we simplified the algebraic expression of SM4 S-Box. And our technique to exploit L1 cache could also be applied to other applications and hardware platforms if the circumstances apply.

Note: Revision: an algebraic expression of the SM4 S-Box, equivalent to ours, had been listed in a now-withdrawn preprint paper before our works. It could be found in the archived earlier version of that paper. This paper was revised to reflect the new findings.

Metadata
Available format(s)
PDF
Category
Implementation
Publication info
Preprint.
Keywords
Constant-Time SM4 S-Box SIMD Intel GFNI Arm NEON Cache
Contact author(s)
guoweiji @ bilibili com
History
2022-09-07: revised
2022-09-05: received
See all versions
Short URL
https://ia.cr/2022/1154
License
Creative Commons Attribution
CC BY

BibTeX

@misc{cryptoeprint:2022/1154,
      author = {Weiji Guo},
      title = {Efficient Constant-Time Implementation of {SM4} with Intel {GFNI} instruction set extension and Arm {NEON} coprocessor},
      howpublished = {Cryptology {ePrint} Archive, Paper 2022/1154},
      year = {2022},
      url = {https://eprint.iacr.org/2022/1154}
}
Note: In order to protect the privacy of readers, eprint.iacr.org does not use cookies or embedded third party content.