]> git.ipfire.org Git - thirdparty/openssl.git/commit
XOF / EVP_MD_size() changes.
authorslontis <shane.lontis@oracle.com>
Sun, 25 Aug 2024 23:38:56 +0000 (09:38 +1000)
committerTomas Mraz <tomas@openssl.org>
Thu, 29 Aug 2024 08:29:53 +0000 (10:29 +0200)
commitc48e56874c5c7d3af3d522e4cae7cb9069143667
treef1605f54ec1f8d7629fe9b1aaa9a26b4b6fe3ea1
parent6dacee485fad2c4d334e08af48891636205ddb6b
XOF / EVP_MD_size() changes.

Added the function EVP_MD_CTX_get_size_ex() which checks for XOF and
does a ctx get rather than just returning EVP_MD_size().
SHAKE did not have a get_ctx_params() so that had to be added to return the xoflen.

Added a helper function EVP_MD_xof()
EVP_MD_CTX_size() was just an aliased macro for EVP_MD_size(), so to
keep it the same I added an extra function.

EVP_MD_size() always returns 0 for SHAKE now, since it caches the value
of md_size at the time of an EVP_MD_fetch(). This is probably better
than returning the incorrect initial value it was before e.g (16 for
SHAKE128) and returning tht always instead of the set xoflen.

Note BLAKE2B uses "size" instead of "xoflen" to do a similar thing.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25285)
CHANGES.md
crypto/evp/digest.c
crypto/evp/evp_lib.c
doc/man3/EVP_DigestInit.pod
doc/man7/EVP_MD-BLAKE2.pod
doc/man7/EVP_MD-SHAKE.pod
doc/man7/EVP_MD-common.pod
include/openssl/evp.h
providers/implementations/digests/sha3_prov.c
test/evp_xof_test.c