The EVP_MAC functions have been renamed for consistency. The EVP_MAC_CTX_*
[openssl.git] / include / openssl / mac.h
1 /*
2  * Copyright 2019=-2020 The OpenSSL Project Authors. All Rights Reserved.
3  *
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
8  */
9
10 /* MAC stuff */
11
12 #ifndef OPENSSL_EVP_MAC_H
13 # define OPENSSL_EVP_MAC_H
14 # pragma once
15
16 # include <openssl/opensslconf.h>
17 # include <openssl/types.h>
18 # include <openssl/core.h>
19
20 EVP_MAC *EVP_MAC_fetch(OPENSSL_CTX *libctx, const char *algorithm,
21                        const char *properties);
22 int EVP_MAC_up_ref(EVP_MAC *mac);
23 void EVP_MAC_free(EVP_MAC *mac);
24 int EVP_MAC_number(const EVP_MAC *mac);
25 int EVP_MAC_is_a(const EVP_MAC *mac, const char *name);
26 const OSSL_PROVIDER *EVP_MAC_provider(const EVP_MAC *mac);
27 int EVP_MAC_get_params(EVP_MAC *mac, OSSL_PARAM params[]);
28
29 EVP_MAC_CTX *EVP_MAC_new_ctx(EVP_MAC *mac);
30 void EVP_MAC_free_ctx(EVP_MAC_CTX *ctx);
31 EVP_MAC_CTX *EVP_MAC_dup_ctx(const EVP_MAC_CTX *src);
32 EVP_MAC *EVP_MAC_get_ctx_mac(EVP_MAC_CTX *ctx);
33 int EVP_MAC_get_ctx_params(EVP_MAC_CTX *ctx, OSSL_PARAM params[]);
34 int EVP_MAC_set_ctx_params(EVP_MAC_CTX *ctx, const OSSL_PARAM params[]);
35
36 size_t EVP_MAC_size(EVP_MAC_CTX *ctx);
37 int EVP_MAC_init(EVP_MAC_CTX *ctx);
38 int EVP_MAC_update(EVP_MAC_CTX *ctx, const unsigned char *data, size_t datalen);
39 int EVP_MAC_final(EVP_MAC_CTX *ctx,
40                   unsigned char *out, size_t *outl, size_t outsize);
41 const OSSL_PARAM *EVP_MAC_gettable_params(const EVP_MAC *mac);
42 const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac);
43 const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac);
44
45 void EVP_MAC_do_all_provided(OPENSSL_CTX *libctx,
46                              void (*fn)(EVP_MAC *mac, void *arg),
47                              void *arg);
48 void EVP_MAC_names_do_all(const EVP_MAC *mac,
49                           void (*fn)(const char *name, void *data),
50                           void *data);
51
52 #endif /* OPENSSL_EVP_MAC_H */