Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 1 | /** |
Manuel Pégourié-Gonnard | 50518f4 | 2015-05-26 11:04:15 +0200 | [diff] [blame] | 2 | * \file md_internal.h |
Paul Bakker | 9af723c | 2014-05-01 13:03:14 +0200 | [diff] [blame] | 3 | * |
Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 4 | * \brief Message digest wrappers. |
| 5 | * |
Manuel Pégourié-Gonnard | ca878db | 2015-03-24 12:13:30 +0100 | [diff] [blame] | 6 | * \warning This in an internal header. Do not include directly. |
| 7 | * |
Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 8 | * \author Adriaan de Jong <dejong@fox-it.com> |
Darryl Green | a40a101 | 2018-01-05 15:33:17 +0000 | [diff] [blame] | 9 | */ |
| 10 | /* |
Manuel Pégourié-Gonnard | ca878db | 2015-03-24 12:13:30 +0100 | [diff] [blame] | 11 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved |
Manuel Pégourié-Gonnard | 37ff140 | 2015-09-04 14:21:07 +0200 | [diff] [blame] | 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. |
Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 25 | * |
Manuel Pégourié-Gonnard | fe44643 | 2015-03-06 13:17:10 +0000 | [diff] [blame] | 26 | * This file is part of mbed TLS (https://tls.mbed.org) |
Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 27 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 28 | #ifndef MBEDTLS_MD_WRAP_H |
| 29 | #define MBEDTLS_MD_WRAP_H |
Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 30 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 31 | #if !defined(MBEDTLS_CONFIG_FILE) |
Jaeden Amero | c49fbbf | 2019-07-04 20:01:14 +0100 | [diff] [blame] | 32 | #include "mbedtls/config.h" |
Manuel Pégourié-Gonnard | cef4ad2 | 2014-04-29 12:39:06 +0200 | [diff] [blame] | 33 | #else |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 34 | #include MBEDTLS_CONFIG_FILE |
Manuel Pégourié-Gonnard | cef4ad2 | 2014-04-29 12:39:06 +0200 | [diff] [blame] | 35 | #endif |
Manuel Pégourié-Gonnard | 6c5abfa | 2015-02-13 14:12:07 +0000 | [diff] [blame] | 36 | |
Jaeden Amero | c49fbbf | 2019-07-04 20:01:14 +0100 | [diff] [blame] | 37 | #include "mbedtls/md.h" |
Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 38 | |
Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 39 | #ifdef __cplusplus |
| 40 | extern "C" { |
| 41 | #endif |
| 42 | |
Manuel Pégourié-Gonnard | ca878db | 2015-03-24 12:13:30 +0100 | [diff] [blame] | 43 | /** |
| 44 | * Message digest information. |
| 45 | * Allows message digest functions to be called in a generic way. |
| 46 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 47 | struct mbedtls_md_info_t |
Manuel Pégourié-Gonnard | f5fc649 | 2015-04-02 14:43:57 +0100 | [diff] [blame] | 48 | { |
Manuel Pégourié-Gonnard | ca878db | 2015-03-24 12:13:30 +0100 | [diff] [blame] | 49 | /** Name of the message digest */ |
| 50 | const char * name; |
| 51 | |
Gilles Peskine | 2838b7b | 2019-07-19 16:03:39 +0200 | [diff] [blame] | 52 | /** Digest identifier */ |
| 53 | mbedtls_md_type_t type; |
| 54 | |
Manuel Pégourié-Gonnard | b8186a5 | 2015-06-18 14:58:58 +0200 | [diff] [blame] | 55 | /** Output length of the digest function in bytes */ |
Gilles Peskine | 2838b7b | 2019-07-19 16:03:39 +0200 | [diff] [blame] | 56 | unsigned char size; |
Manuel Pégourié-Gonnard | ca878db | 2015-03-24 12:13:30 +0100 | [diff] [blame] | 57 | |
Manuel Pégourié-Gonnard | b8186a5 | 2015-06-18 14:58:58 +0200 | [diff] [blame] | 58 | /** Block length of the digest function in bytes */ |
Gilles Peskine | 2838b7b | 2019-07-19 16:03:39 +0200 | [diff] [blame] | 59 | unsigned char block_size; |
Manuel Pégourié-Gonnard | ca878db | 2015-03-24 12:13:30 +0100 | [diff] [blame] | 60 | }; |
| 61 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 62 | #if defined(MBEDTLS_MD2_C) |
| 63 | extern const mbedtls_md_info_t mbedtls_md2_info; |
Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 64 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 65 | #if defined(MBEDTLS_MD4_C) |
| 66 | extern const mbedtls_md_info_t mbedtls_md4_info; |
Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 67 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 68 | #if defined(MBEDTLS_MD5_C) |
| 69 | extern const mbedtls_md_info_t mbedtls_md5_info; |
Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 70 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 71 | #if defined(MBEDTLS_RIPEMD160_C) |
| 72 | extern const mbedtls_md_info_t mbedtls_ripemd160_info; |
Manuel Pégourié-Gonnard | e4d47a6 | 2014-01-17 20:41:32 +0100 | [diff] [blame] | 73 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 74 | #if defined(MBEDTLS_SHA1_C) |
| 75 | extern const mbedtls_md_info_t mbedtls_sha1_info; |
Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 76 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 77 | #if defined(MBEDTLS_SHA256_C) |
| 78 | extern const mbedtls_md_info_t mbedtls_sha224_info; |
| 79 | extern const mbedtls_md_info_t mbedtls_sha256_info; |
Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 80 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 81 | #if defined(MBEDTLS_SHA512_C) |
Manuel Pégourié-Gonnard | d602084 | 2019-07-17 16:28:21 +0200 | [diff] [blame] | 82 | #if !defined(MBEDTLS_SHA512_NO_SHA384) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 83 | extern const mbedtls_md_info_t mbedtls_sha384_info; |
Manuel Pégourié-Gonnard | d602084 | 2019-07-17 16:28:21 +0200 | [diff] [blame] | 84 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 85 | extern const mbedtls_md_info_t mbedtls_sha512_info; |
Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 86 | #endif |
| 87 | |
| 88 | #ifdef __cplusplus |
| 89 | } |
| 90 | #endif |
| 91 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 92 | #endif /* MBEDTLS_MD_WRAP_H */ |