1 /**
2  * \file md_internal.h
3  *
4  * \brief Message digest wrappers.
5  *
6  * \warning This in an internal header. Do not include directly.
7  *
8  * \author Adriaan de Jong <dejong@fox-it.com>
9  */
10 /*
11  *  Copyright The Mbed TLS Contributors
12  *  SPDX-License-Identifier: Apache-2.0
13  *
14  *  Licensed under the Apache License, Version 2.0 (the "License"); you may
15  *  not use this file except in compliance with the License.
16  *  You may obtain a copy of the License at
17  *
18  *  http://www.apache.org/licenses/LICENSE-2.0
19  *
20  *  Unless required by applicable law or agreed to in writing, software
21  *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
22  *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23  *  See the License for the specific language governing permissions and
24  *  limitations under the License.
25  */
26 #ifndef MBEDTLS_MD_WRAP_H
27 #define MBEDTLS_MD_WRAP_H
28 
29 #if !defined(MBEDTLS_CONFIG_FILE)
30 #include "mbedtls/config.h"
31 #else
32 #include MBEDTLS_CONFIG_FILE
33 #endif
34 
35 #include "mbedtls/md.h"
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 /**
42  * Message digest information.
43  * Allows message digest functions to be called in a generic way.
44  */
45 struct mbedtls_md_info_t
46 {
47     /** Name of the message digest */
48     const char * name;
49 
50     /** Digest identifier */
51     mbedtls_md_type_t type;
52 
53     /** Output length of the digest function in bytes */
54     unsigned char size;
55 
56     /** Block length of the digest function in bytes */
57     unsigned char block_size;
58 };
59 
60 #if defined(MBEDTLS_MD2_C)
61 extern const mbedtls_md_info_t mbedtls_md2_info;
62 #endif
63 #if defined(MBEDTLS_MD4_C)
64 extern const mbedtls_md_info_t mbedtls_md4_info;
65 #endif
66 #if defined(MBEDTLS_MD5_C)
67 extern const mbedtls_md_info_t mbedtls_md5_info;
68 #endif
69 #if defined(MBEDTLS_RIPEMD160_C)
70 extern const mbedtls_md_info_t mbedtls_ripemd160_info;
71 #endif
72 #if defined(MBEDTLS_SHA1_C)
73 extern const mbedtls_md_info_t mbedtls_sha1_info;
74 #endif
75 #if defined(MBEDTLS_SHA256_C)
76 extern const mbedtls_md_info_t mbedtls_sha224_info;
77 extern const mbedtls_md_info_t mbedtls_sha256_info;
78 #endif
79 #if defined(MBEDTLS_SHA512_C)
80 #if !defined(MBEDTLS_SHA512_NO_SHA384)
81 extern const mbedtls_md_info_t mbedtls_sha384_info;
82 #endif
83 extern const mbedtls_md_info_t mbedtls_sha512_info;
84 #endif
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
90 #endif /* MBEDTLS_MD_WRAP_H */
91