SM4
China's national 128-bit block cipher, an unbalanced Feistel design
Overview
SM4 (formerly SMS4) is the block cipher of the Chinese commercial cryptography standards, published in 2006 for wireless LAN security and later standardised as GB/T 32907-2016 and in ISO/IEC 18033-3. It has a 128-bit block and 128-bit key.
SM4 uses 32 rounds of an unbalanced Feistel structure on four 32-bit words. Each round XORs three words with a round key, applies a byte-wise 8-bit S-box and a linear transformation of XORed rotations, and XORs the result into the fourth word. The key schedule uses the same structure with different linear transformations and constants.
SM4 is used in Chinese TLS profiles (RFC 8998), WAPI wireless security and national banking systems. SM4 has dedicated instructions on some recent ARM and x86 processors, and it is commonly used in GCM and CCM modes defined for Chinese TLS cipher suites. Its 128-bit key gives security comparable to AES-128.
History
2006–2021SMS4 published for Chinese wireless LAN (WAPI)
Specified in ISO/IEC 18033-3:2010/Amd 1
Standardised as GB/T 32907-2016
Added to ISO/IEC 18033-3
Security notes
No practical attacks on full SM4 are known; published cryptanalysis reaches about 23 of its 32 rounds.
Typical uses
Variants in NextSSL
1| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| SM4 sm4 |
standard | key 16 · block 16 | GB/T 32907-2016, ISO/IEC 18033-3:2010/Amd 1 | safe |
Frequently asked questions
Which SM4 variants does NextSSL include?
NextSSL registers 1 SM4 variant: sm4.