EVP_SM4_CBC(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’– EVP_SM4_CBC(3) πŸ’–

Okay bestie, settle in: this is the EVP_SM4_CBC(3) page from the Library Functions Manual, and it's all about the SM4 cipher squad. It's giving "block cipher family, but make it EVP." Let's get into it. πŸ’…


✨ NAME ✨

The whole function fam is here:

  • EVP_sm4_cbc
  • EVP_sm4_ecb
  • EVP_sm4_cfb
  • EVP_sm4_cfb128
  • EVP_sm4_ofb
  • EVP_sm4_ctr

Collectively: the EVP SM4 cipher. periodt.

🌸 SYNOPSIS 🌸

The library line is literally:

library β€œlibcrypto” #include <openssl/evp.h>

Then the declared besties all return const EVP_CIPHER * and look like this:

const EVP_CIPHER *
EVP_sm4_cbc(void);

const EVP_CIPHER *
EVP_sm4_ecb(void);

const EVP_CIPHER *
EVP_sm4_cfb(void);

const EVP_CIPHER *
EVP_sm4_cfb128(void);

const EVP_CIPHER *
EVP_sm4_ofb(void);

const EVP_CIPHER *
EVP_sm4_ctr(void);

πŸ’– DESCRIPTION πŸ’–

These functions provide the SM4 blockcipher in the evp(3) framework. That's the whole assignment. πŸ’–

All modes use a key length of 128 bits and act on blocks of 128 bits. No cap.

EVP_sm4_cfb() is an alias for EVP_sm4_cfb128(), implemented as a macro. So yes, same energy, macro-style. 🫢

With an argument of "sm4" or "SM4", EVP_get_cipherbyname(3) returns EVP_sm4_cbc(). Iykyk.

πŸŽ€ RETURN VALUES πŸŽ€

These functions return an EVP_CIPHER structure that provides the implementation of the symmetric cipher. That's the return-value tea. πŸ“

πŸ¦‹ SEE ALSO πŸ¦‹

Go read those if you wanna keep the cipher lore going, bestie. πŸ’œ

🌈 STANDARDS 🌈

The standard citation is:

Information security technology - SM4 block cipher algorithm, National Standards of People's Republic of China, GB/T 32907-2016, August 29, 2016.

⭐ HISTORY ⭐

These functions appeared in OpenSSL 1.1.1 and have been available since OpenBSD 6.5. Iconic timeline behavior. ✨


Catch you later β€” this page's footer is from Debian, dated June 8, 2025, page name EVP_SM4_CBC(3). Mwah. πŸ’‹

πŸ“¦ where this page comes from