]> git.sur5r.net Git - freertos/blob - FreeRTOS-Labs/Source/mbedtls/include/mbedtls/md_internal.h
Add the Labs projects provided in the V10.2.1_191129 zip file.
[freertos] / FreeRTOS-Labs / Source / mbedtls / include / mbedtls / md_internal.h
1 /**\r
2  * \file md_internal.h\r
3  *\r
4  * \brief Message digest wrappers.\r
5  *\r
6  * \warning This in an internal header. Do not include directly.\r
7  *\r
8  * \author Adriaan de Jong <dejong@fox-it.com>\r
9  */\r
10 /*\r
11  *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved\r
12  *  SPDX-License-Identifier: Apache-2.0\r
13  *\r
14  *  Licensed under the Apache License, Version 2.0 (the "License"); you may\r
15  *  not use this file except in compliance with the License.\r
16  *  You may obtain a copy of the License at\r
17  *\r
18  *  http://www.apache.org/licenses/LICENSE-2.0\r
19  *\r
20  *  Unless required by applicable law or agreed to in writing, software\r
21  *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
22  *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
23  *  See the License for the specific language governing permissions and\r
24  *  limitations under the License.\r
25  *\r
26  *  This file is part of mbed TLS (https://tls.mbed.org)\r
27  */\r
28 #ifndef MBEDTLS_MD_WRAP_H\r
29 #define MBEDTLS_MD_WRAP_H\r
30 \r
31 #if !defined(MBEDTLS_CONFIG_FILE)\r
32 #include "config.h"\r
33 #else\r
34 #include MBEDTLS_CONFIG_FILE\r
35 #endif\r
36 \r
37 #include "md.h"\r
38 \r
39 #ifdef __cplusplus\r
40 extern "C" {\r
41 #endif\r
42 \r
43 /**\r
44  * Message digest information.\r
45  * Allows message digest functions to be called in a generic way.\r
46  */\r
47 struct mbedtls_md_info_t\r
48 {\r
49     /** Digest identifier */\r
50     mbedtls_md_type_t type;\r
51 \r
52     /** Name of the message digest */\r
53     const char * name;\r
54 \r
55     /** Output length of the digest function in bytes */\r
56     int size;\r
57 \r
58     /** Block length of the digest function in bytes */\r
59     int block_size;\r
60 \r
61     /** Digest initialisation function */\r
62     int (*starts_func)( void *ctx );\r
63 \r
64     /** Digest update function */\r
65     int (*update_func)( void *ctx, const unsigned char *input, size_t ilen );\r
66 \r
67     /** Digest finalisation function */\r
68     int (*finish_func)( void *ctx, unsigned char *output );\r
69 \r
70     /** Generic digest function */\r
71     int (*digest_func)( const unsigned char *input, size_t ilen,\r
72                         unsigned char *output );\r
73 \r
74     /** Allocate a new context */\r
75     void * (*ctx_alloc_func)( void );\r
76 \r
77     /** Free the given context */\r
78     void (*ctx_free_func)( void *ctx );\r
79 \r
80     /** Clone state from a context */\r
81     void (*clone_func)( void *dst, const void *src );\r
82 \r
83     /** Internal use only */\r
84     int (*process_func)( void *ctx, const unsigned char *input );\r
85 };\r
86 \r
87 #if defined(MBEDTLS_MD2_C)\r
88 extern const mbedtls_md_info_t mbedtls_md2_info;\r
89 #endif\r
90 #if defined(MBEDTLS_MD4_C)\r
91 extern const mbedtls_md_info_t mbedtls_md4_info;\r
92 #endif\r
93 #if defined(MBEDTLS_MD5_C)\r
94 extern const mbedtls_md_info_t mbedtls_md5_info;\r
95 #endif\r
96 #if defined(MBEDTLS_RIPEMD160_C)\r
97 extern const mbedtls_md_info_t mbedtls_ripemd160_info;\r
98 #endif\r
99 #if defined(MBEDTLS_SHA1_C)\r
100 extern const mbedtls_md_info_t mbedtls_sha1_info;\r
101 #endif\r
102 #if defined(MBEDTLS_SHA256_C)\r
103 extern const mbedtls_md_info_t mbedtls_sha224_info;\r
104 extern const mbedtls_md_info_t mbedtls_sha256_info;\r
105 #endif\r
106 #if defined(MBEDTLS_SHA512_C)\r
107 extern const mbedtls_md_info_t mbedtls_sha384_info;\r
108 extern const mbedtls_md_info_t mbedtls_sha512_info;\r
109 #endif\r
110 \r
111 #ifdef __cplusplus\r
112 }\r
113 #endif\r
114 \r
115 #endif /* MBEDTLS_MD_WRAP_H */\r