EVP_SM3(3ossl)
π EVP_SM3 β like, the SM3 era of EVP, bestie
okay so real talk, this is an OpenSSL page (manual section 3ossl, iykyk) and it's genuinely short and sweet. Let's get into it π«Ά
β¨ NAME β¨
EVP_sm3 β SM3, but make it EVP πΈ
β¨ SYNOPSIS β¨
#include <openssl/evp.h>
const EVP_MD *EVP_sm3(void);
like, that's the whole thing. one include, one function. iconic behavior honestly π
β¨ DESCRIPTION β¨
so SM3 is a cryptographic hash function, and it gives you a 256-bit output β yes bestie, 256 bits, she's not doing the small stuff. it's defined in GB/T 32905-2016. periodt. π₯
EVP_sm3()β this is literally the SM3 hash function itself. that's it, that's the vibe. π¦
π NOTES π
okay so this is the part where I gotta be the responsible friend for a sec π β developers should be aware of the negative performance implications of calling this function multiple times. like, don't just spam it, okay?
the move instead: consider using EVP_MD_fetch(3) with EVP_MD-SM3(7). and if you want the whole deep dive, go read "Performance" in crypto(7) β it's giving study session but make it useful. πβ¨
ngl, this note matters. calling it over and over is a performance L, and the fetch route is the glow-up. π―
π RETURN VALUES π
these functions return an EVP_MD structure that contains the implementation of the message digest. if you want the deets on what's actually inside that EVP_MD structure, check EVP_MD_meth_new(3). slay. π
β CONFORMING TO β
GB/T 32905-2016 and GM/T 0004-2012. she's standards-compliant and she knows it π
π¦ SEE ALSO π¦
go read those next bestie, they're the main characters of the surrounding lore πΈ
π COPYRIGHT π
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 the whole page, bestie β no cap, that was a short one π
sign-off time: this was theOpenSSLEVP_SM3(3ossl)page, version3.5.6, dated2026-04-07. mwah, go hash something safely ππ§
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms