SM4CTR
SM4-CTR is a mode of operation for the SM4 block cipher that provides symmetric-key encryption of data streams. SM4 is a 128-bit block cipher with a 128-bit key standardized in China (GB/T 32907). In SM4-CTR, a 128-bit counter is constructed from a nonce (IV) and an incrementing counter. For each block, the counter value is encrypted under key K using SM4 to produce a keystream block, Si = E_K(CTR_i). The plaintext block Pi is XORed with Si to yield ciphertext Ci. The counter is incremented for the next block. Decryption mirrors encryption by XORing Ci with the same keystream blocks in the same order.
Security considerations: The security of SM4-CTR relies on the keystream being unique for every encryption under
Usage and performance: SM4-CTR is used in contexts where SM4 is mandated by Chinese standards, including certain