EVP_CIPHER-SM4(7ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… 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 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