---
name: "libressl-EVP_sm4_cbc"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-EVP_sm4_cbc"
---

# libressl-EVP\_sm4\_cbc(3)

EVP SM4 cipher

## NAME

**EVP\_sm4\_cbc**, **EVP\_sm4\_ecb**, **EVP\_sm4\_cfb**, **EVP\_sm4\_cfb128**, **EVP\_sm4\_ofb**, **EVP\_sm4\_ctr** – EVP SM4 cipher

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#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*);

## DESCRIPTION

These functions provide the SM4 blockcipher in the evp(3) framework.

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

**EVP\_sm4\_cfb**() is an alias for **EVP\_sm4\_cfb128**(), implemented as a macro.

With an argument of "sm4" or "SM4", EVP\_get\_cipherbyname(3) returns **EVP\_sm4\_cbc**().

## RETURN VALUES

These functions return an *EVP\_CIPHER* structure that provides the implementation of the symmetric cipher.

## SEE ALSO

evp(3), EVP\_EncryptInit(3)

## STANDARDS

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