Blake2b: Use OSSL_DIGEST_PARAM_SIZE as settable instead of XOFLEN
authorTomas Mraz <tomas@openssl.org>
Tue, 24 Oct 2023 11:44:26 +0000 (13:44 +0200)
committerMatt Caswell <matt@openssl.org>
Wed, 25 Oct 2023 19:13:39 +0000 (20:13 +0100)
commit6a0ae393dd554eb718e5148696e8f437d4faae5b
treec263d550046a8373339a7b2241df3b1e6ab9c66e
parentc7ed5e4697a71012e0a2d9dd5eaf997754ae5156
Blake2b: Use OSSL_DIGEST_PARAM_SIZE as settable instead of XOFLEN

BLAKE2 is not really an extensible output function unlike SHAKE
as the digest size must be set during the context initialization.
Thus it makes no sense to use OSSL_DIGEST_PARAM_XOFLEN.

We also need to adjust EVP_DigestFinal_ex() to query the
OSSL_DIGEST_PARAM_SIZE as gettable ctx param for the size.

Fixes #22488

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22491)
crypto/evp/digest.c
doc/man3/EVP_DigestInit.pod
doc/man7/EVP_MD-BLAKE2.pod
providers/implementations/digests/blake2_prov.c
providers/implementations/digests/blake2b_prov.c
providers/implementations/include/prov/blake2.h
providers/implementations/kdfs/argon2.c
test/evp_test.c
test/recipes/30-test_evp_data/evpmd_blake.txt