EVP_SM4_CBC(3)
π 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_cbcEVP_sm4_ecbEVP_sm4_cfbEVP_sm4_cfb128EVP_sm4_ofbEVP_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
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2017 Ribose Inc
- Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms