Mbed OS Reference
Loading...
Searching...
No Matches
md_internal.h
Go to the documentation of this file.
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
38extern "C" {
39#endif
40
41/**
42 * Message digest information.
43 * Allows message digest functions to be called in a generic way.
44 */
46{
47 /** Name of the message digest */
48 const char * name;
49
50 /** Digest identifier */
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)
61extern const mbedtls_md_info_t mbedtls_md2_info;
62#endif
63#if defined(MBEDTLS_MD4_C)
64extern const mbedtls_md_info_t mbedtls_md4_info;
65#endif
66#if defined(MBEDTLS_MD5_C)
67extern const mbedtls_md_info_t mbedtls_md5_info;
68#endif
69#if defined(MBEDTLS_RIPEMD160_C)
70extern const mbedtls_md_info_t mbedtls_ripemd160_info;
71#endif
72#if defined(MBEDTLS_SHA1_C)
73extern const mbedtls_md_info_t mbedtls_sha1_info;
74#endif
75#if defined(MBEDTLS_SHA256_C)
76extern const mbedtls_md_info_t mbedtls_sha224_info;
77extern const mbedtls_md_info_t mbedtls_sha256_info;
78#endif
79#if defined(MBEDTLS_SHA512_C)
80#if !defined(MBEDTLS_SHA512_NO_SHA384)
81extern const mbedtls_md_info_t mbedtls_sha384_info;
82#endif
83extern const mbedtls_md_info_t mbedtls_sha512_info;
84#endif
85
86#ifdef __cplusplus
87}
88#endif
89
90#endif /* MBEDTLS_MD_WRAP_H */
Configuration options (set of defines)
mbedtls_md_type_t
Supported message digests.
Definition: md.h:64
This file contains the generic message-digest wrapper.
Message digest information.
Definition: md_internal.h:46
unsigned char block_size
Block length of the digest function in bytes.
Definition: md_internal.h:57
mbedtls_md_type_t type
Digest identifier.
Definition: md_internal.h:51
const char * name
Name of the message digest.
Definition: md_internal.h:48
unsigned char size
Output length of the digest function in bytes.
Definition: md_internal.h:54