Jens Wiklander | 817466c | 2018-05-22 13:49:31 +0200 | [diff] [blame] | 1 | /** |
Jens Wiklander | 32b3180 | 2023-10-06 16:59:46 +0200 | [diff] [blame] | 2 | * \file md_wrap.h |
Jens Wiklander | 817466c | 2018-05-22 13:49:31 +0200 | [diff] [blame] | 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> |
Jens Wiklander | 3d3b059 | 2019-03-20 15:30:29 +0100 | [diff] [blame] | 9 | */ |
| 10 | /* |
Jerome Forissier | 7901324 | 2021-07-28 10:24:04 +0200 | [diff] [blame] | 11 | * Copyright The Mbed TLS Contributors |
Tom Van Eyck | c163317 | 2024-04-09 18:44:13 +0200 | [diff] [blame] | 12 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Jens Wiklander | 817466c | 2018-05-22 13:49:31 +0200 | [diff] [blame] | 13 | */ |
| 14 | #ifndef MBEDTLS_MD_WRAP_H |
| 15 | #define MBEDTLS_MD_WRAP_H |
| 16 | |
Jens Wiklander | 32b3180 | 2023-10-06 16:59:46 +0200 | [diff] [blame] | 17 | #include "mbedtls/build_info.h" |
Jens Wiklander | 817466c | 2018-05-22 13:49:31 +0200 | [diff] [blame] | 18 | |
Jerome Forissier | 11fa71b | 2020-04-20 17:17:56 +0200 | [diff] [blame] | 19 | #include "mbedtls/md.h" |
Jens Wiklander | 817466c | 2018-05-22 13:49:31 +0200 | [diff] [blame] | 20 | |
| 21 | #ifdef __cplusplus |
| 22 | extern "C" { |
| 23 | #endif |
| 24 | |
| 25 | /** |
| 26 | * Message digest information. |
| 27 | * Allows message digest functions to be called in a generic way. |
| 28 | */ |
Jens Wiklander | 32b3180 | 2023-10-06 16:59:46 +0200 | [diff] [blame] | 29 | struct mbedtls_md_info_t { |
Jerome Forissier | 11fa71b | 2020-04-20 17:17:56 +0200 | [diff] [blame] | 30 | /** Digest identifier */ |
| 31 | mbedtls_md_type_t type; |
| 32 | |
Jens Wiklander | 817466c | 2018-05-22 13:49:31 +0200 | [diff] [blame] | 33 | /** Output length of the digest function in bytes */ |
Jerome Forissier | 11fa71b | 2020-04-20 17:17:56 +0200 | [diff] [blame] | 34 | unsigned char size; |
Jens Wiklander | 817466c | 2018-05-22 13:49:31 +0200 | [diff] [blame] | 35 | |
Tom Van Eyck | c163317 | 2024-04-09 18:44:13 +0200 | [diff] [blame] | 36 | #if defined(MBEDTLS_MD_C) |
Jens Wiklander | 817466c | 2018-05-22 13:49:31 +0200 | [diff] [blame] | 37 | /** Block length of the digest function in bytes */ |
Jerome Forissier | 11fa71b | 2020-04-20 17:17:56 +0200 | [diff] [blame] | 38 | unsigned char block_size; |
Tom Van Eyck | c163317 | 2024-04-09 18:44:13 +0200 | [diff] [blame] | 39 | #endif |
Jens Wiklander | 817466c | 2018-05-22 13:49:31 +0200 | [diff] [blame] | 40 | }; |
| 41 | |
Jens Wiklander | 817466c | 2018-05-22 13:49:31 +0200 | [diff] [blame] | 42 | #ifdef __cplusplus |
| 43 | } |
| 44 | #endif |
| 45 | |
| 46 | #endif /* MBEDTLS_MD_WRAP_H */ |