2 * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #include <openssl/crypto.h>
11 #include <openssl/params.h>
12 #include <openssl/mdc2.h>
13 #include <openssl/core_names.h>
15 #include "internal/core_mkdigest.h"
16 #include "internal/provider_algs.h"
18 static OSSL_OP_digest_set_params_fn mdc2_set_params;
20 static int mdc2_set_params(void *vctx, const OSSL_PARAM params[])
23 MDC2_CTX *ctx = (MDC2_CTX *)vctx;
25 if (ctx != NULL && params != NULL) {
26 p = OSSL_PARAM_locate_const(params, OSSL_DIGEST_PARAM_PAD_TYPE);
27 if (p != NULL && !OSSL_PARAM_get_int(p, &ctx->pad_type))
31 return 0; /* Null Parameter */
34 OSSL_FUNC_DIGEST_CONSTRUCT_PARAMS(mdc2, MDC2_CTX,
35 MDC2_BLOCK, MDC2_DIGEST_LENGTH,
36 MDC2_Init, MDC2_Update, MDC2_Final,