From af53092c2b67a8a0b76ae73385414cb1815ea7cc Mon Sep 17 00:00:00 2001 From: Shane Lontis Date: Thu, 17 Dec 2020 16:42:05 +1000 Subject: Replace provider digest flags with separate param fields Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/13830) --- providers/implementations/digests/sha3_prov.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'providers/implementations/digests/sha3_prov.c') diff --git a/providers/implementations/digests/sha3_prov.c b/providers/implementations/digests/sha3_prov.c index 6b44792529..6e731fd842 100644 --- a/providers/implementations/digests/sha3_prov.c +++ b/providers/implementations/digests/sha3_prov.c @@ -18,6 +18,10 @@ #include "prov/implementations.h" #include "prov/providercommonerr.h" +#define SHA3_FLAGS PROV_DIGEST_FLAG_ALGID_ABSENT +#define SHAKE_FLAGS PROV_DIGEST_FLAG_XOF +#define KMAC_FLAGS PROV_DIGEST_FLAG_XOF + /* * Forward declaration of any unique methods implemented here. This is not strictly * necessary for the compiler, but provides an assurance that the signatures @@ -286,18 +290,18 @@ static int shake_set_ctx_params(void *vctx, const OSSL_PARAM params[]) SHA3_newctx(sha3, SHA3_##bitlen, sha3_##bitlen, bitlen, '\x06') \ PROV_FUNC_SHA3_DIGEST(sha3_##bitlen, bitlen, \ SHA3_BLOCKSIZE(bitlen), SHA3_MDSIZE(bitlen), \ - EVP_MD_FLAG_DIGALGID_ABSENT) + SHA3_FLAGS) #define IMPLEMENT_SHAKE_functions(bitlen) \ SHA3_newctx(shake, SHAKE_##bitlen, shake_##bitlen, bitlen, '\x1f') \ PROV_FUNC_SHAKE_DIGEST(shake_##bitlen, bitlen, \ SHA3_BLOCKSIZE(bitlen), SHA3_MDSIZE(bitlen), \ - EVP_MD_FLAG_XOF) + SHAKE_FLAGS) #define IMPLEMENT_KMAC_functions(bitlen) \ KMAC_newctx(keccak_kmac_##bitlen, bitlen, '\x04') \ PROV_FUNC_SHAKE_DIGEST(keccak_kmac_##bitlen, bitlen, \ SHA3_BLOCKSIZE(bitlen), KMAC_MDSIZE(bitlen), \ - EVP_MD_FLAG_XOF) + KMAC_FLAGS) /* ossl_sha3_224_functions */ IMPLEMENT_SHA3_functions(224) -- cgit v1.2.1