EVP_SM4_CBC(3SSL)
π NAME π
okay so bestie, welcome to the SM4 cipher corner of OpenSSL β¨ β these are the EVP functions: EVP_sm4_cbc, EVP_sm4_ecb, EVP_sm4_cfb, EVP_sm4_cfb128, EVP_sm4_ofb, EVP_sm4_ctr β collectively known as the EVP SM4 cipher. This is the EVP_SM4_CBC(3SSL) manual page and it's lowkey iconic.
πΈ SYNOPSIS πΈ
#include <openssl/evp.h>
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);
no cap, that's the whole vibe right there π
π¦ DESCRIPTION π¦
So the SM4 blockcipher (that's GB/T 32907-2016 if you're keeping receipts π) β but for EVP.
Every single mode listed below uses a key length of 128 bits and acts on blocks of 128 bits. periodt.
β¨ the functions β¨
EVP_sm4_cbc(),EVP_sm4_ecb(),EVP_sm4_cfb(),EVP_sm4_cfb128(),EVP_sm4_ofb(),EVP_sm4_ctr()β these are the SM4 blockcipher with a 128-bit key, in CBC, ECB, CFB, OFB and CTR modes respectively. that's the whole lineup, they're all eating π₯
π NOTES π
bestie, listen, this part is important π
Developers should be aware that calling these functions multiple times has negative performance implications β like, it's giving "why are you doing this to yourself" energy. You should consider using EVP_CIPHER_fetch(3) with EVP_CIPHER-SM4(7) instead. For the full tea, go look at "Performance" in crypto(7).
fr fr, don't be calling these in a loop and then acting surprised. fetch instead π«Ά
π RETURN VALUES π
These functions hand you back an EVP_CIPHER structure that contains the implementation of the symmetric cipher. that's it, that's the gift π
β SEE ALSO β
π COPYRIGHT π
Copyright 2017-2023 The OpenSSL Project Authors. All Rights Reserved.
Copyright 2017 Ribose Inc. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
and that's a wrap, bestie π§π this was EVP_SM4_CBC(3SSL), version 4.0.3, dated 2026-09-29, straight from the OpenSSL girlies. slay, stay encrypted, mwah π
β¨π·
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms