The branch master has been updated
       via  5acb2be58b693f504c76eb07f5b9133b02895f3b (commit)
       via  f1d3df3e69601f6f9f8070705543794f9b6696e2 (commit)
       via  3d214461bf78d1fdd9b1b69e0555428a3d65030a (commit)
       via  6a3b7c6887346d37c5771fc1fa755a59add44d0b (commit)
       via  2893111fc624b33f59ab78ac7333740adac6d00d (commit)
      from  246a1f3dfafc4a377bc7d7da65d9f8981a696abd (commit)


- Log -----------------------------------------------------------------
commit 5acb2be58b693f504c76eb07f5b9133b02895f3b
Author: Richard Levitte <levi...@openssl.org>
Date:   Wed Jul 24 22:19:37 2019 +0200

    HMAC: use EVP_MD_flags(), not EVP_MD_meth_get_flags()
    
    The latter should only be ussed with legacy methods.
    
    Reviewed-by: Matt Caswell <m...@openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9391)

commit f1d3df3e69601f6f9f8070705543794f9b6696e2
Author: Richard Levitte <levi...@openssl.org>
Date:   Tue Jul 16 06:06:26 2019 +0200

    Adapt the provider digests for more use of OSSL_PARAM
    
    Reviewed-by: Matt Caswell <m...@openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9391)

commit 3d214461bf78d1fdd9b1b69e0555428a3d65030a
Author: Richard Levitte <levi...@openssl.org>
Date:   Tue Jul 16 06:05:08 2019 +0200

    Rework the provider digest constructor to provide implementation get_params
    
    Reviewed-by: Matt Caswell <m...@openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9391)

commit 6a3b7c6887346d37c5771fc1fa755a59add44d0b
Author: Richard Levitte <levi...@openssl.org>
Date:   Tue Jul 16 06:03:12 2019 +0200

    Adapt diverse EVP_MD functions to use get_params and set_params interfaces
    
    Also clean up EVP_MD_CTX_ctrl(), which did use these interfaces, but
    development since allows for more elegant code.
    
    Reviewed-by: Matt Caswell <m...@openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9391)

commit 2893111fc624b33f59ab78ac7333740adac6d00d
Author: Richard Levitte <levi...@openssl.org>
Date:   Tue Jul 16 05:59:50 2019 +0200

    Make more use of OSSL_PARAM for digests
    
    A lot of the different numbers associated with digests are really
    algorithm parameters.  block size, digest length, that sort of
    thing.
    
    Reviewed-by: Matt Caswell <m...@openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9391)

-----------------------------------------------------------------------

Summary of changes:
 crypto/evp/digest.c                               | 105 ++++++++++++----------
 crypto/evp/evp_lib.c                              |  29 ++++--
 crypto/evp/evp_locl.h                             |   5 ++
 crypto/evp/evp_utils.c                            |   2 -
 crypto/hmac/hmac.c                                |   2 +-
 crypto/include/internal/evp_int.h                 |   5 +-
 doc/man7/provider-digest.pod                      |  77 +++++++++++++---
 include/openssl/core_names.h                      |   3 +
 include/openssl/core_numbers.h                    |  36 ++++----
 providers/common/digests/sha2_prov.c              |  10 ++-
 providers/common/digests/sha3_prov.c              |  64 +++++++------
 providers/common/include/internal/core_mkdigest.h |  63 ++++++++-----
 providers/default/digests/blake2_prov.c           |   4 +-
 providers/default/digests/md5_prov.c              |   2 +-
 providers/default/digests/md5_sha1_prov.c         |   4 +-
 providers/default/digests/null_prov.c             |  34 ++++---
 providers/default/digests/sm3_prov.c              |   2 +-
 providers/legacy/digests/md2_prov.c               |   2 +-
 providers/legacy/digests/md4_prov.c               |   2 +-
 providers/legacy/digests/mdc2_prov.c              |   4 +-
 providers/legacy/digests/ripemd_prov.c            |   2 +-
 providers/legacy/digests/wp_prov.c                |   2 +-
 22 files changed, 289 insertions(+), 170 deletions(-)

diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c
index 78e8756f2a..afcd73609b 100644
--- a/crypto/evp/digest.c
+++ b/crypto/evp/digest.c
@@ -526,55 +526,66 @@ int EVP_Digest(const void *data, size_t count,
 
 int EVP_MD_CTX_set_params(EVP_MD_CTX *ctx, const OSSL_PARAM params[])
 {
-    if (ctx->digest != NULL && ctx->digest->set_params != NULL)
-        return ctx->digest->set_params(ctx->provctx, params);
+    if (ctx->digest != NULL && ctx->digest->ctx_set_params != NULL)
+        return ctx->digest->ctx_set_params(ctx->provctx, params);
     return 0;
 }
 
 int EVP_MD_CTX_get_params(EVP_MD_CTX *ctx, OSSL_PARAM params[])
 {
     if (ctx->digest != NULL && ctx->digest->get_params != NULL)
-        return ctx->digest->get_params(ctx->provctx, params);
+        return ctx->digest->ctx_get_params(ctx->provctx, params);
     return 0;
 }
 
 /* TODO(3.0): Remove legacy code below - only used by engines & DigestSign */
 int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)
 {
-    if (ctx->digest != NULL) {
-        if (ctx->digest->prov != NULL) {
-            OSSL_PARAM params[2];
-            size_t i, n = 0;
-
-            switch (cmd) {
-            case EVP_MD_CTRL_XOF_LEN:
-                if (ctx->digest->set_params == NULL)
-                    break;
-                i = (size_t)p1;
-                params[n++] =
-                    OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_XOFLEN, &i);
-                params[n++] = OSSL_PARAM_construct_end();
-                return ctx->digest->set_params(ctx->provctx, params);
-            case EVP_MD_CTRL_MICALG:
-                if (ctx->digest->get_params == NULL)
-                    break;
-                params[n++] =
-                    OSSL_PARAM_construct_utf8_string(OSSL_DIGEST_PARAM_MICALG,
+    int ret = EVP_CTRL_RET_UNSUPPORTED;
+    int set_params = 1;
+    size_t sz;
+    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+
+    if (ctx == NULL || ctx->digest == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL);
+        return 0;
+    }
+
+    if (ctx->digest->prov == NULL)
+        goto legacy;
+
+    switch (cmd) {
+    case EVP_MD_CTRL_XOF_LEN:
+        sz = (size_t)p1;
+        params[0] = OSSL_PARAM_construct_size_t(OSSL_DIGEST_PARAM_XOFLEN, &sz);
+        break;
+    case EVP_MD_CTRL_MICALG:
+        set_params = 0;
+        params[0] = OSSL_PARAM_construct_utf8_string(OSSL_DIGEST_PARAM_MICALG,
                                                      p2, p1 ? p1 : 9999);
-                params[n++] = OSSL_PARAM_construct_end();
-                return ctx->digest->get_params(ctx->provctx, params);
-            }
-            return 0;
-        }
-        /* legacy code */
-        if (ctx->digest->md_ctrl != NULL) {
-            int ret = ctx->digest->md_ctrl(ctx, cmd, p1, p2);
-            if (ret <= 0)
-                return 0;
-            return 1;
-        }
+        break;
+    default:
+        return EVP_CTRL_RET_UNSUPPORTED;
     }
-    return 0;
+
+    if (set_params)
+        ret = evp_do_md_ctx_setparams(ctx->digest, ctx->provctx, params);
+    else
+        ret = evp_do_md_ctx_getparams(ctx->digest, ctx->provctx, params);
+    return ret;
+
+
+/* TODO(3.0): Remove legacy code below */
+ legacy:
+    if (ctx->digest->md_ctrl == NULL) {
+        ERR_raise(ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED);
+        return 0;
+    }
+
+    ret = ctx->digest->md_ctrl(ctx, cmd, p1, p2);
+    if (ret <= 0)
+        return 0;
+    return ret;
 }
 
 static void *evp_md_from_dispatch(const char *name, const OSSL_DISPATCH *fns,
@@ -632,27 +643,22 @@ static void *evp_md_from_dispatch(const char *name, const 
OSSL_DISPATCH *fns,
             if (md->dupctx == NULL)
                 md->dupctx = OSSL_get_OP_digest_dupctx(fns);
             break;
-        case OSSL_FUNC_DIGEST_SIZE:
-            if (md->size == NULL)
-                md->size = OSSL_get_OP_digest_size(fns);
-            break;
-        case OSSL_FUNC_DIGEST_BLOCK_SIZE:
-            if (md->dblock_size == NULL)
-                md->dblock_size = OSSL_get_OP_digest_block_size(fns);
-            break;
-        case OSSL_FUNC_DIGEST_SET_PARAMS:
-            if (md->set_params == NULL)
-                md->set_params = OSSL_get_OP_digest_set_params(fns);
-            break;
         case OSSL_FUNC_DIGEST_GET_PARAMS:
             if (md->get_params == NULL)
                 md->get_params = OSSL_get_OP_digest_get_params(fns);
             break;
+        case OSSL_FUNC_DIGEST_CTX_SET_PARAMS:
+            if (md->ctx_set_params == NULL)
+                md->ctx_set_params = OSSL_get_OP_digest_ctx_set_params(fns);
+            break;
+        case OSSL_FUNC_DIGEST_CTX_GET_PARAMS:
+            if (md->ctx_get_params == NULL)
+                md->ctx_get_params = OSSL_get_OP_digest_ctx_get_params(fns);
+            break;
         }
     }
     if ((fncnt != 0 && fncnt != 5)
-        || (fncnt == 0 && md->digest == NULL)
-        || md->size == NULL) {
+        || (fncnt == 0 && md->digest == NULL)) {
         /*
          * In order to be a consistent set of functions we either need the
          * whole set of init/update/final etc functions or none of them.
@@ -660,6 +666,7 @@ static void *evp_md_from_dispatch(const char *name, const 
OSSL_DISPATCH *fns,
          * generate digests.
          */
         EVP_MD_meth_free(md);
+        ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS);
         return NULL;
     }
     md->prov = prov;
diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c
index 0d6a7722a7..460a5db003 100644
--- a/crypto/evp/evp_lib.c
+++ b/crypto/evp/evp_lib.c
@@ -475,15 +475,18 @@ const OSSL_PROVIDER *EVP_MD_provider(const EVP_MD *md)
 
 int EVP_MD_block_size(const EVP_MD *md)
 {
+    int ok, v = md->block_size;
+    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+
     if (md == NULL) {
         EVPerr(EVP_F_EVP_MD_BLOCK_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL);
         return -1;
     }
 
-    if (md->prov != NULL && md->dblock_size != NULL)
-        return (int)md->dblock_size();
+    params[0] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_BLOCK_SIZE, &v);
+    ok = evp_do_md_getparams(md, params);
 
-    return md->block_size;
+    return ok != 0 ? v : -1;
 }
 
 int EVP_MD_type(const EVP_MD *md)
@@ -498,20 +501,30 @@ int EVP_MD_pkey_type(const EVP_MD *md)
 
 int EVP_MD_size(const EVP_MD *md)
 {
-    if (!md) {
+    int ok, v = md->md_size;
+    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+
+    if (md == NULL) {
         EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL);
         return -1;
     }
 
-    if (md->prov != NULL && md->size != NULL)
-        return (int)md->size();
+    params[0] = OSSL_PARAM_construct_int(OSSL_DIGEST_PARAM_SIZE, &v);
+    ok = evp_do_md_getparams(md, params);
 
-    return md->md_size;
+    return ok != 0 ? v : -1;
 }
 
 unsigned long EVP_MD_flags(const EVP_MD *md)
 {
-    return md->flags;
+    int ok;
+    unsigned long v = md->flags;
+    OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
+
+    params[0] = OSSL_PARAM_construct_ulong(OSSL_CIPHER_PARAM_FLAGS, &v);
+    ok = evp_do_md_getparams(md, params);
+
+    return ok != 0 ? v : 0;
 }
 
 EVP_MD *EVP_MD_meth_new(int md_type, int pkey_type)
diff --git a/crypto/evp/evp_locl.h b/crypto/evp/evp_locl.h
index 17ab24c07a..59072e368b 100644
--- a/crypto/evp/evp_locl.h
+++ b/crypto/evp/evp_locl.h
@@ -170,6 +170,11 @@ int evp_do_ciph_ctx_getparams(const EVP_CIPHER *ciph, void 
*provctx,
                               OSSL_PARAM params[]);
 int evp_do_ciph_ctx_setparams(const EVP_CIPHER *ciph, void *provctx,
                               OSSL_PARAM params[]);
+int evp_do_md_getparams(const EVP_MD *md, OSSL_PARAM params[]);
+int evp_do_md_ctx_getparams(const EVP_MD *md, void *provctx,
+                            OSSL_PARAM params[]);
+int evp_do_md_ctx_setparams(const EVP_MD *md, void *provctx,
+                            OSSL_PARAM params[]);
 
 OSSL_PARAM *evp_pkey_to_param(EVP_PKEY *pkey, size_t *sz);
 
diff --git a/crypto/evp/evp_utils.c b/crypto/evp/evp_utils.c
index e24bee1c0c..6355299707 100644
--- a/crypto/evp/evp_utils.c
+++ b/crypto/evp/evp_utils.c
@@ -73,9 +73,7 @@ PARAM_FUNCTIONS(EVP_CIPHER,
                 evp_do_ciph_ctx_getparams, ctx_get_params,
                 evp_do_ciph_ctx_setparams, ctx_set_params)
 
-#if 0
 PARAM_FUNCTIONS(EVP_MD,
                 evp_do_md_getparams, get_params,
                 evp_do_md_ctx_getparams, ctx_get_params,
                 evp_do_md_ctx_setparams, ctx_set_params)
-#endif
diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c
index 5d934e9588..d392753c49 100644
--- a/crypto/hmac/hmac.c
+++ b/crypto/hmac/hmac.c
@@ -39,7 +39,7 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
      * The HMAC construction is not allowed to be used with the
      * extendable-output functions (XOF) shake128 and shake256.
      */
-    if ((EVP_MD_meth_get_flags(md) & EVP_MD_FLAG_XOF) != 0)
+    if ((EVP_MD_flags(md) & EVP_MD_FLAG_XOF) != 0)
         return 0;
 
     if (key != NULL) {
diff --git a/crypto/include/internal/evp_int.h 
b/crypto/include/internal/evp_int.h
index 9d878987bc..cdb5aab87c 100644
--- a/crypto/include/internal/evp_int.h
+++ b/crypto/include/internal/evp_int.h
@@ -212,10 +212,9 @@ struct evp_md_st {
     OSSL_OP_digest_digest_fn *digest;
     OSSL_OP_digest_freectx_fn *freectx;
     OSSL_OP_digest_dupctx_fn *dupctx;
-    OSSL_OP_digest_size_fn *size;
-    OSSL_OP_digest_block_size_fn *dblock_size;
-    OSSL_OP_digest_set_params_fn *set_params;
     OSSL_OP_digest_get_params_fn *get_params;
+    OSSL_OP_digest_ctx_set_params_fn *ctx_set_params;
+    OSSL_OP_digest_ctx_get_params_fn *ctx_get_params;
 
 } /* EVP_MD */ ;
 
diff --git a/doc/man7/provider-digest.pod b/doc/man7/provider-digest.pod
index f6c3286528..08428428fa 100644
--- a/doc/man7/provider-digest.pod
+++ b/doc/man7/provider-digest.pod
@@ -31,10 +31,11 @@ provider-digest - The digest library E<lt>-E<gt> provider 
functions
                       unsigned char *out, size_t *outl, size_t outsz);
 
  /* Digest parameters */
- size_t OP_digest_size(void);
- size_t OP_digest_block_size(void);
- int OP_digest_set_params(void *dctx, const OSSL_PARAM params[]);
- int OP_digest_get_params(void *dctx, OSSL_PARAM params[]);
+ int OP_digest_get_params(OSSL_PARAM params[]);
+
+ /* Digest context parameters */
+ int OP_digest_ctx_set_params(void *dctx, const OSSL_PARAM params[]);
+ int OP_digest_ctx_get_params(void *dctx, OSSL_PARAM params[]);
 
 =head1 DESCRIPTION
 
@@ -129,18 +130,72 @@ exceed B<outsz> bytes.
 
 =head2 Digest Parameters
 
-OP_digest_size() should return the size of the digest.
+OP_digest_get_params() gets details of the algorithm implementation
+and stores them in B<params>.
+See L<OSSL_PARAM(3)> for further details on the parameters structure.
+
+Parameters currently recognised by built-in digests with this function
+are as follows. Not all parametes are relevant to, or are understood
+by all digests:
+
+=over 4
+
+=item B<OSSL_DIGEST_PARAM_BLOCK_SIZE> (int)
+
+The digest block size.
+
+=item B<OSSL_DIGEST_PARAM_SIZE> (int)
+
+The digest output size.
+
+=item B<OSSL_DIGEST_PARAM_FLAGS> (unsigned long)
+
+Diverse flags that describe exceptional behaviour for the digest:
+
+=over 4
+
+=item B<EVP_MD_FLAG_ONESHOT>
+
+This digest method can only handle one block of input.
+
+=item B<EVP_MD_FLAG_XOF>
+
+This digest method is an extensible-output function (XOF) and supports
+setting the B<OSSL_DIGEST_PARAM_XOFLEN> parameter.
+
+=item B<EVP_MD_FLAG_DIGALGID_NULL>
+
+When setting up a DigestAlgorithmIdentifier, this flag will have the
+parameter set to NULL by default.  Use this for PKCS#1.  I<Note: if
+combined with EVP_MD_FLAG_DIGALGID_ABSENT, the latter will override.>
+
+=item B<EVP_MD_FLAG_DIGALGID_ABSENT>
+
+When setting up a DigestAlgorithmIdentifier, this flag will have the
+parameter be left absent by default.  I<Note: if combined with
+EVP_MD_FLAG_DIGALGID_NULL, the latter will be overridden.>
+
+=item B<EVP_MD_FLAG_DIGALGID_CUSTOM>
+
+Custom DigestAlgorithmIdentifier handling via ctrl, with
+B<EVP_MD_FLAG_DIGALGID_ABSENT> as default.  I<Note: if combined with
+EVP_MD_FLAG_DIGALGID_NULL, the latter will be overridden.>
+Currently unused.
+
+=back
+
+=back
 
-OP_digest_block_size() should return the size of the block size of the
-underlying digest algorithm.
+=head2 Digest Context Parameters
 
-OP_digest_set_params() set digest parameters associated with the given provider
-side digest context B<dctx> to B<params>.
+OP_digest_ctx_set_params() sets digest parameters associated with the
+given provider side digest context B<dctx> to B<params>.
 Any parameter settings are additional to any that were previously set.
 See L<OSSL_PARAM(3)> for further details on the parameters structure.
 
-OP_digest_get_params() gets details of currently set parameters values 
associated
-with the give provider side digest context B<dctx> and stores them in 
B<params>.
+OP_digest_ctx_get_params() gets details of currently set parameters
+values associated with the give provider side digest context B<dctx>
+and stores them in B<params>.
 See L<OSSL_PARAM(3)> for further details on the parameters structure.
 
 Parameters currently recognised by built-in digests are as follows. Not all
diff --git a/include/openssl/core_names.h b/include/openssl/core_names.h
index d1ba624d65..bf57d15d38 100644
--- a/include/openssl/core_names.h
+++ b/include/openssl/core_names.h
@@ -55,6 +55,9 @@ extern "C" {
 #define OSSL_DIGEST_PARAM_SSL3_MS   "ssl3-ms"
 #define OSSL_DIGEST_PARAM_PAD_TYPE  "pad_type"
 #define OSSL_DIGEST_PARAM_MICALG    "micalg"
+#define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize" /* OSSL_PARAM_INTEGER */
+#define OSSL_DIGEST_PARAM_SIZE      "size" /* OSSL_PARAM_INTEGER */
+#define OSSL_DIGEST_PARAM_FLAGS     "flags" /* OSSL_PARAM_UNSIGNED_INTEGER */
 
 /* PKEY parameters */
 /* Diffie-Hellman Parameters */
diff --git a/include/openssl/core_numbers.h b/include/openssl/core_numbers.h
index f4c4a61ada..e4d3f5d60f 100644
--- a/include/openssl/core_numbers.h
+++ b/include/openssl/core_numbers.h
@@ -136,19 +136,18 @@ OSSL_CORE_MAKE_FUNC(const OSSL_ITEM 
*,provider_get_reason_strings,
 
 /* Digests */
 
-# define OSSL_OP_DIGEST                     1
-
-# define OSSL_FUNC_DIGEST_NEWCTX            1
-# define OSSL_FUNC_DIGEST_INIT              2
-# define OSSL_FUNC_DIGEST_UPDATE            3
-# define OSSL_FUNC_DIGEST_FINAL             4
-# define OSSL_FUNC_DIGEST_DIGEST            5
-# define OSSL_FUNC_DIGEST_FREECTX           6
-# define OSSL_FUNC_DIGEST_DUPCTX            7
-# define OSSL_FUNC_DIGEST_SIZE              8
-# define OSSL_FUNC_DIGEST_BLOCK_SIZE        9
-# define OSSL_FUNC_DIGEST_SET_PARAMS        10
-# define OSSL_FUNC_DIGEST_GET_PARAMS        11
+# define OSSL_OP_DIGEST                              1
+
+# define OSSL_FUNC_DIGEST_NEWCTX                     1
+# define OSSL_FUNC_DIGEST_INIT                       2
+# define OSSL_FUNC_DIGEST_UPDATE                     3
+# define OSSL_FUNC_DIGEST_FINAL                      4
+# define OSSL_FUNC_DIGEST_DIGEST                     5
+# define OSSL_FUNC_DIGEST_FREECTX                    6
+# define OSSL_FUNC_DIGEST_DUPCTX                     7
+# define OSSL_FUNC_DIGEST_GET_PARAMS                 8
+# define OSSL_FUNC_DIGEST_CTX_SET_PARAMS             9
+# define OSSL_FUNC_DIGEST_CTX_GET_PARAMS            10
 
 OSSL_CORE_MAKE_FUNC(void *, OP_digest_newctx, (void *provctx))
 OSSL_CORE_MAKE_FUNC(int, OP_digest_init, (void *dctx))
@@ -164,12 +163,11 @@ OSSL_CORE_MAKE_FUNC(int, OP_digest_digest,
 OSSL_CORE_MAKE_FUNC(void, OP_digest_freectx, (void *dctx))
 OSSL_CORE_MAKE_FUNC(void *, OP_digest_dupctx, (void *dctx))
 
-OSSL_CORE_MAKE_FUNC(size_t, OP_digest_size, (void))
-OSSL_CORE_MAKE_FUNC(size_t, OP_digest_block_size, (void))
-OSSL_CORE_MAKE_FUNC(int, OP_digest_set_params,
-                    (void *dctx, const OSSL_PARAM params[]))
-OSSL_CORE_MAKE_FUNC(int, OP_digest_get_params,
-                    (void *dctx, OSSL_PARAM params[]))
+OSSL_CORE_MAKE_FUNC(int, OP_digest_get_params, (OSSL_PARAM params[]))
+OSSL_CORE_MAKE_FUNC(int, OP_digest_ctx_set_params,
+                    (void *vctx, const OSSL_PARAM params[]))
+OSSL_CORE_MAKE_FUNC(int, OP_digest_ctx_get_params,
+                    (void *vctx, OSSL_PARAM params[]))
 
 /* Symmetric Ciphers */
 
diff --git a/providers/common/digests/sha2_prov.c 
b/providers/common/digests/sha2_prov.c
index 0e49ae679c..e823c27039 100644
--- a/providers/common/digests/sha2_prov.c
+++ b/providers/common/digests/sha2_prov.c
@@ -9,6 +9,7 @@
 
 #include <openssl/crypto.h>
 #include <openssl/core_numbers.h>
+#include <openssl/evp.h>
 #include <openssl/sha.h>
 #include <openssl/evp.h>
 #include <openssl/params.h>
@@ -17,7 +18,7 @@
 #include "internal/provider_algs.h"
 #include "internal/sha.h"
 
-static OSSL_OP_digest_set_params_fn sha1_set_params;
+static OSSL_OP_digest_ctx_set_params_fn sha1_set_params;
 
 /* Special set_params method for SSL3 */
 static int sha1_set_params(void *vctx, const OSSL_PARAM params[])
@@ -36,30 +37,37 @@ static int sha1_set_params(void *vctx, const OSSL_PARAM 
params[])
 
 OSSL_FUNC_DIGEST_CONSTRUCT_PARAMS(sha1, SHA_CTX,
                            SHA_CBLOCK, SHA_DIGEST_LENGTH,
+                           EVP_MD_FLAG_DIGALGID_ABSENT,
                            SHA1_Init, SHA1_Update, SHA1_Final,
                            sha1_set_params)
 
 OSSL_FUNC_DIGEST_CONSTRUCT(sha224, SHA256_CTX,
                            SHA256_CBLOCK, SHA224_DIGEST_LENGTH,
+                           EVP_MD_FLAG_DIGALGID_ABSENT,
                            SHA224_Init, SHA224_Update, SHA224_Final)
 
 OSSL_FUNC_DIGEST_CONSTRUCT(sha256, SHA256_CTX,
                            SHA256_CBLOCK, SHA256_DIGEST_LENGTH,
+                           EVP_MD_FLAG_DIGALGID_ABSENT,
                            SHA256_Init, SHA256_Update, SHA256_Final)
 
 OSSL_FUNC_DIGEST_CONSTRUCT(sha384, SHA512_CTX,
                            SHA512_CBLOCK, SHA384_DIGEST_LENGTH,
+                           EVP_MD_FLAG_DIGALGID_ABSENT,
                            SHA384_Init, SHA384_Update, SHA384_Final)
 
 OSSL_FUNC_DIGEST_CONSTRUCT(sha512, SHA512_CTX,
                            SHA512_CBLOCK, SHA512_DIGEST_LENGTH,
+                           EVP_MD_FLAG_DIGALGID_ABSENT,
                            SHA512_Init, SHA512_Update, SHA512_Final)
 
 OSSL_FUNC_DIGEST_CONSTRUCT(sha512_224, SHA512_CTX,
                            SHA512_CBLOCK, SHA224_DIGEST_LENGTH,
+                           EVP_MD_FLAG_DIGALGID_ABSENT,
                            sha512_224_init, SHA512_Update, SHA512_Final)
 
 OSSL_FUNC_DIGEST_CONSTRUCT(sha512_256, SHA512_CTX,
                            SHA512_CBLOCK, SHA256_DIGEST_LENGTH,
+                           EVP_MD_FLAG_DIGALGID_ABSENT,
                            sha512_256_init, SHA512_Update, SHA512_Final)
 
diff --git a/providers/common/digests/sha3_prov.c 
b/providers/common/digests/sha3_prov.c
index 15cd670a0e..63a57dbcb3 100644
--- a/providers/common/digests/sha3_prov.c
+++ b/providers/common/digests/sha3_prov.c
@@ -26,7 +26,7 @@ static OSSL_OP_digest_update_fn keccak_update;
 static OSSL_OP_digest_final_fn keccak_final;
 static OSSL_OP_digest_freectx_fn keccak_freectx;
 static OSSL_OP_digest_dupctx_fn keccak_dupctx;
-static OSSL_OP_digest_set_params_fn shake_set_params;
+static OSSL_OP_digest_ctx_set_params_fn shake_set_params;
 static sha3_absorb_fn generic_sha3_absorb;
 static sha3_final_fn generic_sha3_final;
 
@@ -202,27 +202,33 @@ static void *uname##_newctx(void *provctx) \
     return ctx; \
 }
 
-#define OSSL_FUNC_SHA3_DIGEST(name, bitlen, dgstsize, stparams) \
-static OSSL_OP_digest_size_fn name##_size; \
-static OSSL_OP_digest_block_size_fn name##_block_size; \
-static size_t name##_block_size(void) \
-{ \
-    return SHA3_BLOCKSIZE(bitlen); \
-} \
-static size_t name##_size(void) \
-{ \
-    return dgstsize; \
-} \
-const OSSL_DISPATCH name##_functions[] = { \
-    { OSSL_FUNC_DIGEST_NEWCTX, (void (*)(void))name##_newctx }, \
-    { OSSL_FUNC_DIGEST_INIT, (void (*)(void))keccak_init }, \
-    { OSSL_FUNC_DIGEST_UPDATE, (void (*)(void))keccak_update }, \
-    { OSSL_FUNC_DIGEST_FINAL, (void (*)(void))keccak_final }, \
-    { OSSL_FUNC_DIGEST_FREECTX, (void (*)(void))keccak_freectx }, \
-    { OSSL_FUNC_DIGEST_DUPCTX, (void (*)(void))keccak_dupctx }, \
-    { OSSL_FUNC_DIGEST_SIZE, (void (*)(void))name##_size }, \
-    { OSSL_FUNC_DIGEST_BLOCK_SIZE, (void (*)(void))name##_block_size }, \
-    { OSSL_FUNC_DIGEST_SET_PARAMS, (void (*)(void))stparams },\
+#define OSSL_FUNC_SHA3_DIGEST(name, bitlen, blksize, dgstsize, flags,   \
+                              stparams)                                 \
+static OSSL_OP_digest_get_params_fn name##_get_params;                  \
+static int name##_get_params(OSSL_PARAM params[])                       \
+{                                                                       \
+    OSSL_PARAM *p = NULL;                                               \
+                                                                        \
+    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_BLOCK_SIZE);        \
+    if (p != NULL && !OSSL_PARAM_set_int(p, (blksize)))                 \
+        return 0;                                                       \
+    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_SIZE);              \
+    if (p != NULL && !OSSL_PARAM_set_int(p, (dgstsize)))                \
+        return 0;                                                       \
+    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_FLAGS);             \
+    if (p != NULL && !OSSL_PARAM_set_ulong(p, (flags)))                 \
+        return 0;                                                       \
+    return 1;                                                           \
+}                                                                       \
+const OSSL_DISPATCH name##_functions[] = {                              \
+    { OSSL_FUNC_DIGEST_NEWCTX, (void (*)(void))name##_newctx },         \
+    { OSSL_FUNC_DIGEST_INIT, (void (*)(void))keccak_init },             \
+    { OSSL_FUNC_DIGEST_UPDATE, (void (*)(void))keccak_update },         \
+    { OSSL_FUNC_DIGEST_FINAL, (void (*)(void))keccak_final },           \
+    { OSSL_FUNC_DIGEST_FREECTX, (void (*)(void))keccak_freectx },       \
+    { OSSL_FUNC_DIGEST_DUPCTX, (void (*)(void))keccak_dupctx },         \
+    { OSSL_FUNC_DIGEST_GET_PARAMS, (void (*)(void))name##_get_params }, \
+    { OSSL_FUNC_DIGEST_CTX_SET_PARAMS, (void (*)(void))stparams },      \
 OSSL_FUNC_DIGEST_CONSTRUCT_END
 
 static void keccak_freectx(void *vctx)
@@ -257,16 +263,20 @@ static int shake_set_params(void *vctx, const OSSL_PARAM 
params[])
 
 #define SHA3(bitlen) \
     SHA3_newctx(sha3, SHA3_##bitlen, sha3_##bitlen, bitlen, '\x06') \
-    OSSL_FUNC_SHA3_DIGEST(sha3_##bitlen, bitlen, SHA3_MDSIZE(bitlen), NULL)
+    OSSL_FUNC_SHA3_DIGEST(sha3_##bitlen, bitlen, \
+                          SHA3_BLOCKSIZE(bitlen), SHA3_MDSIZE(bitlen), \
+                          EVP_MD_FLAG_DIGALGID_ABSENT, NULL)
 
 #define SHAKE(bitlen) \
     SHA3_newctx(shake, SHAKE_##bitlen, shake_##bitlen, bitlen, '\x1f') \
-    OSSL_FUNC_SHA3_DIGEST(shake_##bitlen, bitlen, SHA3_MDSIZE(bitlen), \
-                          shake_set_params)
+    OSSL_FUNC_SHA3_DIGEST(shake_##bitlen, bitlen, \
+                          SHA3_BLOCKSIZE(bitlen), SHA3_MDSIZE(bitlen), \
+                          EVP_MD_FLAG_XOF, shake_set_params)
 #define KMAC(bitlen) \
     KMAC_newctx(keccak_kmac_##bitlen, bitlen, '\x04') \
-    OSSL_FUNC_SHA3_DIGEST(keccak_kmac_##bitlen, bitlen, KMAC_MDSIZE(bitlen), \
-                          shake_set_params)
+    OSSL_FUNC_SHA3_DIGEST(keccak_kmac_##bitlen, bitlen, \
+                          SHA3_BLOCKSIZE(bitlen), KMAC_MDSIZE(bitlen), \
+                          EVP_MD_FLAG_XOF, shake_set_params)
 
 SHA3(224)
 SHA3(256)
diff --git a/providers/common/include/internal/core_mkdigest.h 
b/providers/common/include/internal/core_mkdigest.h
index 7225196d62..8a077aec47 100644
--- a/providers/common/include/internal/core_mkdigest.h
+++ b/providers/common/include/internal/core_mkdigest.h
@@ -11,6 +11,8 @@
 # define OSSL_CORE_MKDIGEST_H
 
 # include <openssl/core_numbers.h>
+# include <openssl/core_names.h>
+# include <openssl/params.h>
 
 # ifdef __cplusplus
 extern "C" {
@@ -38,6 +40,24 @@ static void *name##_dupctx(void *ctx) \
     return ret; \
 }
 
+# define OSSL_FUNC_DIGEST_GET_PARAM(name, blksize, dgstsize, flags)     \
+static OSSL_OP_digest_get_params_fn name##_get_params;                  \
+static int name##_get_params(OSSL_PARAM params[])                       \
+{                                                                       \
+    OSSL_PARAM *p = NULL;                                               \
+                                                                        \
+    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_BLOCK_SIZE);        \
+    if (p != NULL && !OSSL_PARAM_set_int(p, (blksize)))                 \
+        return 0;                                                       \
+    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_SIZE);              \
+    if (p != NULL && !OSSL_PARAM_set_int(p, (dgstsize)))                \
+        return 0;                                                       \
+    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_FLAGS);             \
+    if (p != NULL && !OSSL_PARAM_set_ulong(p, (flags)))                 \
+        return 0;                                                       \
+    return 1;                                                           \
+}
+
 # define OSSL_FUNC_DIGEST_SET_FINAL(name, dgstsize, fin) \
 static OSSL_OP_digest_final_fn name##_wrapfinal; \
 static int name##_wrapfinal(void *ctx, unsigned char *out, size_t *outl, 
size_t outsz) \
@@ -49,17 +69,7 @@ static int name##_wrapfinal(void *ctx, unsigned char *out, 
size_t *outl, size_t
     return 0; \
 }
 
-# define OSSL_FUNC_DIGEST_COMMON(name, blksize, dgstsize, init, upd) \
-static OSSL_OP_digest_block_size_fn name##_block_size; \
-static OSSL_OP_digest_size_fn name##_size; \
-static size_t name##_block_size(void) \
-{ \
-    return blksize; \
-} \
-static size_t name##_size(void) \
-{ \
-    return dgstsize; \
-} \
+# define OSSL_FUNC_DIGEST_COMMON(name, init, upd) \
 const OSSL_DISPATCH name##_functions[] = { \
     { OSSL_FUNC_DIGEST_NEWCTX, (void (*)(void))name##_newctx }, \
     { OSSL_FUNC_DIGEST_INIT, (void (*)(void))init }, \
@@ -67,25 +77,32 @@ const OSSL_DISPATCH name##_functions[] = { \
     { OSSL_FUNC_DIGEST_FINAL, (void (*)(void))name##_wrapfinal }, \
     { OSSL_FUNC_DIGEST_FREECTX, (void (*)(void))name##_freectx }, \
     { OSSL_FUNC_DIGEST_DUPCTX, (void (*)(void))name##_dupctx }, \
-    { OSSL_FUNC_DIGEST_SIZE, (void (*)(void))name##_size }, \
-    { OSSL_FUNC_DIGEST_BLOCK_SIZE, (void (*)(void))name##_block_size },
-
-# define OSSL_FUNC_DIGEST_CONSTRUCT_START(name, CTX, blksize, dgstsize, init, 
upd, fin) \
-OSSL_FUNC_DIGEST_ALLOC_METHODS(name, CTX) \
-OSSL_FUNC_DIGEST_SET_FINAL(name, dgstsize, fin) \
-OSSL_FUNC_DIGEST_COMMON(name, blksize, dgstsize, init, upd)
+    { OSSL_FUNC_DIGEST_GET_PARAMS, (void (*)(void))name##_get_params },
 
 # define OSSL_FUNC_DIGEST_CONSTRUCT_END \
     { 0, NULL } \
 };
 
-# define OSSL_FUNC_DIGEST_CONSTRUCT(name, CTX, blksize, dgstsize, init, upd, 
fin) \
-OSSL_FUNC_DIGEST_CONSTRUCT_START(name, CTX, blksize, dgstsize, init, upd, fin) 
\
+# define OSSL_FUNC_DIGEST_CONSTRUCT_START(name, CTX,                    \
+                                          blksize, dgstsize, flags,     \
+                                          init, upd, fin)               \
+OSSL_FUNC_DIGEST_ALLOC_METHODS(name, CTX)                               \
+OSSL_FUNC_DIGEST_SET_FINAL(name, dgstsize, fin)                         \
+OSSL_FUNC_DIGEST_GET_PARAM(name, blksize, dgstsize, flags)              \
+OSSL_FUNC_DIGEST_COMMON(name, init, upd)
+
+# define OSSL_FUNC_DIGEST_CONSTRUCT(name, CTX, blksize, dgstsize, flags, \
+                                    init, upd, fin)                     \
+OSSL_FUNC_DIGEST_CONSTRUCT_START(name, CTX, blksize, dgstsize, flags,   \
+                                 init, upd, fin)                        \
 OSSL_FUNC_DIGEST_CONSTRUCT_END
 
-# define OSSL_FUNC_DIGEST_CONSTRUCT_PARAMS(name, CTX, blksize, dgstsize, init, 
upd, fin, setparams) \
-OSSL_FUNC_DIGEST_CONSTRUCT_START(name, CTX, blksize, dgstsize, init, upd, fin) 
\
-    { OSSL_FUNC_DIGEST_SET_PARAMS, (void (*)(void))setparams }, \
+# define OSSL_FUNC_DIGEST_CONSTRUCT_PARAMS(name, CTX,                   \
+                                           blksize, dgstsize, flags,    \
+                                           init, upd, fin, setparams)   \
+OSSL_FUNC_DIGEST_CONSTRUCT_START(name, CTX, blksize, dgstsize, flags,   \
+                                 init, upd, fin)                        \
+    { OSSL_FUNC_DIGEST_CTX_SET_PARAMS, (void (*)(void))setparams },     \
 OSSL_FUNC_DIGEST_CONSTRUCT_END
 
 # ifdef __cplusplus
diff --git a/providers/default/digests/blake2_prov.c 
b/providers/default/digests/blake2_prov.c
index 18a8d60b0c..87c090c092 100644
--- a/providers/default/digests/blake2_prov.c
+++ b/providers/default/digests/blake2_prov.c
@@ -32,9 +32,9 @@ int blake2b512_init(void *ctx)
 }
 
 OSSL_FUNC_DIGEST_CONSTRUCT(blake2s256, BLAKE2S_CTX,
-                           BLAKE2S_BLOCKBYTES, BLAKE2S_DIGEST_LENGTH,
+                           BLAKE2S_BLOCKBYTES, BLAKE2S_DIGEST_LENGTH, 0,
                            blake2s256_init, blake2s_update, blake2s_final)
 
 OSSL_FUNC_DIGEST_CONSTRUCT(blake2b512, BLAKE2B_CTX,
-                           BLAKE2B_BLOCKBYTES, BLAKE2B_DIGEST_LENGTH,
+                           BLAKE2B_BLOCKBYTES, BLAKE2B_DIGEST_LENGTH, 0,
                            blake2b512_init, blake2b_update, blake2b_final)
diff --git a/providers/default/digests/md5_prov.c 
b/providers/default/digests/md5_prov.c
index 81636f670c..39b8d88613 100644
--- a/providers/default/digests/md5_prov.c
+++ b/providers/default/digests/md5_prov.c
@@ -13,5 +13,5 @@
 #include "internal/provider_algs.h"
 
 OSSL_FUNC_DIGEST_CONSTRUCT(md5, MD5_CTX,
-                           MD5_CBLOCK, MD5_DIGEST_LENGTH,
+                           MD5_CBLOCK, MD5_DIGEST_LENGTH, 0,
                            MD5_Init, MD5_Update, MD5_Final)
diff --git a/providers/default/digests/md5_sha1_prov.c 
b/providers/default/digests/md5_sha1_prov.c
index 490134e7eb..2ed36d03b3 100644
--- a/providers/default/digests/md5_sha1_prov.c
+++ b/providers/default/digests/md5_sha1_prov.c
@@ -17,7 +17,7 @@
 #include "internal/md5_sha1.h"
 #include "internal/provider_algs.h"
 
-static OSSL_OP_digest_set_params_fn md5_sha1_set_params;
+static OSSL_OP_digest_ctx_set_params_fn md5_sha1_set_params;
 
 /* Special set_params method for SSL3 */
 static int md5_sha1_set_params(void *vctx, const OSSL_PARAM params[])
@@ -35,6 +35,6 @@ static int md5_sha1_set_params(void *vctx, const OSSL_PARAM 
params[])
 }
 
 OSSL_FUNC_DIGEST_CONSTRUCT_PARAMS(md5_sha1, MD5_SHA1_CTX,
-                                  MD5_SHA1_CBLOCK, MD5_SHA1_DIGEST_LENGTH,
+                                  MD5_SHA1_CBLOCK, MD5_SHA1_DIGEST_LENGTH, 0,
                                   md5_sha1_init, md5_sha1_update, 
md5_sha1_final,
                                   md5_sha1_set_params)
diff --git a/providers/default/digests/null_prov.c 
b/providers/default/digests/null_prov.c
index d7644f4cbf..893737b5ae 100644
--- a/providers/default/digests/null_prov.c
+++ b/providers/default/digests/null_prov.c
@@ -8,6 +8,8 @@
  */
 
 #include <openssl/core_numbers.h>
+#include <openssl/core_names.h>
+#include <openssl/params.h>
 #include <openssl/whrlpool.h>
 #include "internal/provider_algs.h"
 
@@ -19,18 +21,7 @@ static OSSL_OP_digest_final_fn nullmd_final;
 static OSSL_OP_digest_newctx_fn nullmd_newctx;
 static OSSL_OP_digest_freectx_fn nullmd_freectx;
 static OSSL_OP_digest_dupctx_fn nullmd_dupctx;
-static OSSL_OP_digest_size_fn nullmd_size;
-static OSSL_OP_digest_block_size_fn nullmd_block_size;
-
-static size_t nullmd_block_size(void)
-{
-    return 0;
-}
-
-static size_t nullmd_size(void)
-{
-    return 0;
-}
+static OSSL_OP_digest_get_params_fn nullmd_get_params;
 
 static int nullmd_init(void *vctx)
 {
@@ -62,6 +53,22 @@ static void *nullmd_dupctx(void *ctx)
     return &nullmd_dummy;
 }
 
+static int nullmd_get_params(OSSL_PARAM params[])
+{
+    OSSL_PARAM *p = NULL;
+
+    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_BLOCK_SIZE);
+    if (p != NULL && !OSSL_PARAM_set_int(p, 0))
+        return 0;
+    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_SIZE);
+    if (p != NULL && !OSSL_PARAM_set_int(p, 0))
+        return 0;
+    p = OSSL_PARAM_locate(params, OSSL_DIGEST_PARAM_FLAGS);
+    if (p != NULL && !OSSL_PARAM_set_ulong(p, 0))
+        return 0;
+    return 1;
+}
+
 const OSSL_DISPATCH nullmd_functions[] = {
     { OSSL_FUNC_DIGEST_NEWCTX, (void (*)(void))nullmd_newctx },
     { OSSL_FUNC_DIGEST_INIT, (void (*)(void))nullmd_init },
@@ -69,7 +76,6 @@ const OSSL_DISPATCH nullmd_functions[] = {
     { OSSL_FUNC_DIGEST_FINAL, (void (*)(void))nullmd_final },
     { OSSL_FUNC_DIGEST_FREECTX, (void (*)(void))nullmd_freectx },
     { OSSL_FUNC_DIGEST_DUPCTX, (void (*)(void))nullmd_dupctx },
-    { OSSL_FUNC_DIGEST_SIZE, (void (*)(void))nullmd_size },
-    { OSSL_FUNC_DIGEST_BLOCK_SIZE, (void (*)(void))nullmd_block_size },
+    { OSSL_FUNC_DIGEST_GET_PARAMS, (void (*)(void))nullmd_get_params },
     { 0, NULL }
 };
diff --git a/providers/default/digests/sm3_prov.c 
b/providers/default/digests/sm3_prov.c
index bd039a8863..60789a469e 100644
--- a/providers/default/digests/sm3_prov.c
+++ b/providers/default/digests/sm3_prov.c
@@ -13,5 +13,5 @@
 #include "internal/provider_algs.h"
 
 OSSL_FUNC_DIGEST_CONSTRUCT(sm3, SM3_CTX,
-                           SM3_CBLOCK, SM3_DIGEST_LENGTH,
+                           SM3_CBLOCK, SM3_DIGEST_LENGTH, 0,
                            sm3_init, sm3_update, sm3_final)
diff --git a/providers/legacy/digests/md2_prov.c 
b/providers/legacy/digests/md2_prov.c
index edd4b78bbd..833aab7685 100644
--- a/providers/legacy/digests/md2_prov.c
+++ b/providers/legacy/digests/md2_prov.c
@@ -14,5 +14,5 @@
 #include "internal/provider_algs.h"
 
 OSSL_FUNC_DIGEST_CONSTRUCT(md2, MD2_CTX,
-                           MD2_BLOCK, MD2_DIGEST_LENGTH,
+                           MD2_BLOCK, MD2_DIGEST_LENGTH, 0,
                            MD2_Init, MD2_Update, MD2_Final)
diff --git a/providers/legacy/digests/md4_prov.c 
b/providers/legacy/digests/md4_prov.c
index 86937f7b43..9d336f9919 100644
--- a/providers/legacy/digests/md4_prov.c
+++ b/providers/legacy/digests/md4_prov.c
@@ -14,5 +14,5 @@
 #include "internal/provider_algs.h"
 
 OSSL_FUNC_DIGEST_CONSTRUCT(md4, MD4_CTX,
-                           MD4_CBLOCK, MD4_DIGEST_LENGTH,
+                           MD4_CBLOCK, MD4_DIGEST_LENGTH, 0,
                            MD4_Init, MD4_Update, MD4_Final)
diff --git a/providers/legacy/digests/mdc2_prov.c 
b/providers/legacy/digests/mdc2_prov.c
index 31e95cb391..f77e3992b0 100644
--- a/providers/legacy/digests/mdc2_prov.c
+++ b/providers/legacy/digests/mdc2_prov.c
@@ -15,7 +15,7 @@
 #include "internal/core_mkdigest.h"
 #include "internal/provider_algs.h"
 
-static OSSL_OP_digest_set_params_fn mdc2_set_params;
+static OSSL_OP_digest_ctx_set_params_fn mdc2_set_params;
 
 static int mdc2_set_params(void *vctx, const OSSL_PARAM params[])
 {
@@ -32,6 +32,6 @@ static int mdc2_set_params(void *vctx, const OSSL_PARAM 
params[])
 }
 
 OSSL_FUNC_DIGEST_CONSTRUCT_PARAMS(mdc2, MDC2_CTX,
-                                  MDC2_BLOCK, MDC2_DIGEST_LENGTH,
+                                  MDC2_BLOCK, MDC2_DIGEST_LENGTH, 0,
                                   MDC2_Init, MDC2_Update, MDC2_Final,
                                   mdc2_set_params)
diff --git a/providers/legacy/digests/ripemd_prov.c 
b/providers/legacy/digests/ripemd_prov.c
index 124351257b..2b192bf917 100644
--- a/providers/legacy/digests/ripemd_prov.c
+++ b/providers/legacy/digests/ripemd_prov.c
@@ -14,5 +14,5 @@
 #include "internal/provider_algs.h"
 
 OSSL_FUNC_DIGEST_CONSTRUCT(ripemd160, RIPEMD160_CTX,
-                           RIPEMD160_CBLOCK, RIPEMD160_DIGEST_LENGTH,
+                           RIPEMD160_CBLOCK, RIPEMD160_DIGEST_LENGTH, 0,
                            RIPEMD160_Init, RIPEMD160_Update, RIPEMD160_Final)
diff --git a/providers/legacy/digests/wp_prov.c 
b/providers/legacy/digests/wp_prov.c
index ece67e0941..297d367667 100644
--- a/providers/legacy/digests/wp_prov.c
+++ b/providers/legacy/digests/wp_prov.c
@@ -14,5 +14,5 @@
 #include "internal/provider_algs.h"
 
 OSSL_FUNC_DIGEST_CONSTRUCT(wp, WHIRLPOOL_CTX,
-                           WHIRLPOOL_BBLOCK / 8, WHIRLPOOL_DIGEST_LENGTH,
+                           WHIRLPOOL_BBLOCK / 8, WHIRLPOOL_DIGEST_LENGTH, 0,
                            WHIRLPOOL_Init, WHIRLPOOL_Update, WHIRLPOOL_Final)

Reply via email to