EVP_SM3(3ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

πŸ’œ 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 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 the OpenSSL EVP_SM3(3ossl) page, version 3.5.6, dated 2026-04-07. mwah, go hash something safely πŸ’–πŸ§š
πŸ“¦ where this page comes from