1 /**
2  * \file md_wrap.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 #include "mbedtls/build_info.h"
30 
31 #include "mbedtls/md.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /**
38  * Message digest information.
39  * Allows message digest functions to be called in a generic way.
40  */
41 struct mbedtls_md_info_t
42 {
43     /** Name of the message digest */
44     const char * name;
45 
46     /** Digest identifier */
47     mbedtls_md_type_t type;
48 
49     /** Output length of the digest function in bytes */
50     unsigned char size;
51 
52     /** Block length of the digest function in bytes */
53     unsigned char block_size;
54 };
55 
56 #if defined(MBEDTLS_MD5_C)
57 extern const mbedtls_md_info_t mbedtls_md5_info;
58 #endif
59 #if defined(MBEDTLS_RIPEMD160_C)
60 extern const mbedtls_md_info_t mbedtls_ripemd160_info;
61 #endif
62 #if defined(MBEDTLS_SHA1_C)
63 extern const mbedtls_md_info_t mbedtls_sha1_info;
64 #endif
65 #if defined(MBEDTLS_SHA224_C)
66 extern const mbedtls_md_info_t mbedtls_sha224_info;
67 #endif
68 #if defined(MBEDTLS_SHA256_C)
69 extern const mbedtls_md_info_t mbedtls_sha256_info;
70 #endif
71 #if defined(MBEDTLS_SHA384_C)
72 extern const mbedtls_md_info_t mbedtls_sha384_info;
73 #endif
74 #if defined(MBEDTLS_SHA512_C)
75 extern const mbedtls_md_info_t mbedtls_sha512_info;
76 #endif
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif /* MBEDTLS_MD_WRAP_H */
83