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 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