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 OR GPL-2.0-or-later 13 */ 14 #ifndef MBEDTLS_MD_WRAP_H 15 #define MBEDTLS_MD_WRAP_H 16 17 #if !defined(MBEDTLS_CONFIG_FILE) 18 #include "mbedtls/config.h" 19 #else 20 #include MBEDTLS_CONFIG_FILE 21 #endif 22 23 #include "mbedtls/md.h" 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 /** 30 * Message digest information. 31 * Allows message digest functions to be called in a generic way. 32 */ 33 struct mbedtls_md_info_t { 34 /** Name of the message digest */ 35 const char *name; 36 37 /** Digest identifier */ 38 mbedtls_md_type_t type; 39 40 /** Output length of the digest function in bytes */ 41 unsigned char size; 42 43 /** Block length of the digest function in bytes */ 44 unsigned char block_size; 45 }; 46 47 #if defined(MBEDTLS_MD2_C) 48 extern const mbedtls_md_info_t mbedtls_md2_info; 49 #endif 50 #if defined(MBEDTLS_MD4_C) 51 extern const mbedtls_md_info_t mbedtls_md4_info; 52 #endif 53 #if defined(MBEDTLS_MD5_C) 54 extern const mbedtls_md_info_t mbedtls_md5_info; 55 #endif 56 #if defined(MBEDTLS_RIPEMD160_C) 57 extern const mbedtls_md_info_t mbedtls_ripemd160_info; 58 #endif 59 #if defined(MBEDTLS_SHA1_C) 60 extern const mbedtls_md_info_t mbedtls_sha1_info; 61 #endif 62 #if defined(MBEDTLS_SHA256_C) 63 extern const mbedtls_md_info_t mbedtls_sha224_info; 64 extern const mbedtls_md_info_t mbedtls_sha256_info; 65 #endif 66 #if defined(MBEDTLS_SHA512_C) 67 #if !defined(MBEDTLS_SHA512_NO_SHA384) 68 extern const mbedtls_md_info_t mbedtls_sha384_info; 69 #endif 70 extern const mbedtls_md_info_t mbedtls_sha512_info; 71 #endif 72 73 #ifdef __cplusplus 74 } 75 #endif 76 77 #endif /* MBEDTLS_MD_WRAP_H */ 78