EVP_SHA224(3ossl)
π NAME π
ok so bestie, this whole page is about the SHA-2 For EVP squad β that's EVP_sha224, EVP_sha256, EVP_sha512_224, EVP_sha512_256, EVP_sha384, and EVP_sha512. that's the lineup. that's the girlies. from the 3ossl manual, mwah π
β¨ SYNOPSIS β¨
like literally just include the header first, no biggie:
#include <openssl/evp.h>
and then these six icons, each one handing you back a const EVP_MD *:
const EVP_MD *EVP_sha224(void);
const EVP_MD *EVP_sha256(void);
const EVP_MD *EVP_sha512_224(void);
const EVP_MD *EVP_sha512_256(void);
const EVP_MD *EVP_sha384(void);
const EVP_MD *EVP_sha512(void);
π¦ DESCRIPTION π¦
okay so context first: SHA-2 (Secure Hash Algorithm 2) is a whole family of cryptographic hash functions, standardized in NIST FIPS 180-4, first published in 2001. vintage! but still slaying π
πΈ the functions πΈ
EVP_sha224(),EVP_sha256(),EVP_sha512_224,EVP_sha512_256,EVP_sha384(),EVP_sha512()β these are the SHA-2SHA-224,SHA-256,SHA-512/224,SHA512/256,SHA-384andSHA-512algorithms, and they generate 224, 256, 224, 256, 384 and 512 bits respectively of output from a given input. yes the 224 shows up twice, that's not a typo, that's just how it is bestie π
and here's the part that trips people up, so listen: the two algorithms SHA-512/224 and SHA512/256 are truncated forms of the SHA-512 algorithm. they are distinct from SHA-224 and SHA-256 even though their outputs are of the same size. same size β same thing, no cap. don't be out here swapping them like they're dupes π«Ά
π NOTES π
ok real talk, this one matters: developers should be aware of the negative performance implications of calling these functions multiple times, and should consider using EVP_MD_fetch(3) with EVP_MD-SHA2(7) instead. that's a "do better for your perf" moment fr fr. see "Performance" in crypto(7) for further information β go read it, i'll wait π
π RETURN VALUES π
these functions return a EVP_MD structure that contains the implementation of the message digest. that's the whole vibe. see EVP_MD_meth_new(3) for details of the EVP_MD structure if you wanna get into the lore β¨
π CONFORMING TO π
NIST FIPS 180-4. that's it. that's the standard. periodt β
π SEE ALSO π
go click around, it's giving rabbit hole in the best way iykyk π§
π COPYRIGHT π
Copyright 2017-2023 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>.
ok that's the page!! mwah, love u, go hash something responsibly πβ¨ version 3.5.0, dated 2026-09-25 β and it's EVP_SHA224(3ossl), signing off ππ¦
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 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