EVP_CIPHER-SM4(7ossl)
π EVP_CIPHER-SM4
okay bestie, welcome to the glow-up era of symmetric encryption β¨ this little page lives in the OpenSSL 7ossl manual fam, and it's all about the SM4 EVP_CIPHER implementations β like, the whole squad of them π
πΈ NAME
EVP_CIPHER-SM4 β the SM4 EVP_CIPHER implementations, periodt π
β¨ DESCRIPTION
So basically: this is support for SM4 symmetric encryption using the EVP_CIPHER API π¦ that's it, that's the vibe. no cap.
π₯ Algorithm Names
these beauties are all available in the default provider β like, they're already in the group chat, no invite needed π
"SM4-CBC:SM4""SM4-ECB""SM4-CTR""SM4-OFB"or"SM4-OFB128""SM4-CFB"or"SM4-CFB128""SM4-GCM""SM4-CCM""SM4-XTS"
π Parameters
this implementation supports the parameters described in "PARAMETERS" in EVP_EncryptInit(3) β go read that one, it's giving essential lore πβ¨
π NOTES
okay so this is the part where you actually listen, bestie π
The SM4-XTS implementation does allow streaming to be performed, but each EVP_EncryptUpdate(3) or EVP_DecryptUpdate(3) call requires each input to be a multiple of the blocksize. like, every single one. no exceptions, fr fr.
Only the final EVP_EncryptUpdate() or EVP_DecryptUpdate() call can optionally have an input that is not a multiple of the blocksize β but that input still has to be larger than one block. In that case, ciphertext stealing (CTS) is used to fill the block π«Άβ¨
lowkey important: get the block sizes wrong on a non-final call and the vibe check fails. respect the blocksize π
π SEE ALSO
π COPYRIGHT
Copyright 2021 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 one's from OpenSSL version 3.5.0, dated 2026-09-25, filed under EVP_CIPHER-SM4(7ossl) β slay, go encrypt something cute π
πΈ
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms