EVP_CIPHER-SM4(7SSL)
π EVP_CIPHER-SM4 π
okay bestie, so this is the EVP_CIPHER-SM4(7SSL) page from the OpenSSL manual set. it's giving "cipher documentation but make it cute." buckle up π
β¨ NAME β¨
EVP_CIPHER-SM4 β the SM4 EVP_CIPHER implementations, aka the whole girlboss lineup of SM4 ciphers you can pull through the EVP API π¦
πΈ DESCRIPTION πΈ
so basically? support for SM4 symmetric encryption using the EVP_CIPHER API. that's the whole vibe. symmetric, slay, encrypted. π
π Algorithm Names π
these are the algorithms available in the default provider β no cap, here's the full roster:
"SM4-CBC:SM4""SM4-ECB""SM4-CTR""SM4-OFB"or"SM4-OFB128""SM4-CFB"or"SM4-CFB128""SM4-GCM""SM4-CCM""SM4-XTS"
not me listing every single one because every single one matters π€ periodt.
π¦ Parameters π¦
this implementation supports the parameters described in "PARAMETERS" in EVP_EncryptInit(3). iykyk π
π NOTES π
okay listen, this part is important so pay attention bestie:
SM4 implementations in OpenSSL may use secret-dependent table lookups and are not guaranteed to be constant-time. in particular, the portable C implementation uses S-box and T-table lookups and may be vulnerable to cache-timing side-channel attacks. π so likeβ¦ treat that accordingly.
which code path is used depends on CPU capabilities β check OPENSSL_armcap(3), OPENSSL_ia32cap(3) and OPENSSL_riscvcap(3). π₯
β οΈ also theSM4-XTSimplementation allows streaming to be performed, but eachEVP_EncryptUpdate(3)orEVP_DecryptUpdate(3)call requires each input to be a multiple of the blocksize. only the finalEVP_EncryptUpdate()orEVP_DecryptUpdate()call can optionally have an input that is not a multiple of the blocksize but is larger than one block. in that case, ciphertext stealing (CTS) is used to fill the block. π
π SEE ALSO π
OPENSSL_armcap(3)OPENSSL_ia32cap(3)OPENSSL_riscvcap(3)OSSL_PROVIDER-default(7)provider-cipher(7)
go read those too, they're iconic in their own right π
π COPYRIGHT π
Copyright 2021-2026 The OpenSSL Project Authors. 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 the whole page, bestie!! this was version 4.0.3 dated 2026-09-29 β thanks for reading, ily, go encrypt something responsibly β¨πππ¦π
π¦ where this page comes from
- ubuntu stonking: openssl 4.0.3-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms