mbed TLS v2.16.1
md2.h
Go to the documentation of this file.
1 
10 /*
11  * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
12  * SPDX-License-Identifier: GPL-2.0
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, write to the Free Software Foundation, Inc.,
26  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27  *
28  * This file is part of mbed TLS (https://tls.mbed.org)
29  *
30  */
31 #ifndef MBEDTLS_MD2_H
32 #define MBEDTLS_MD2_H
33 
34 #if !defined(MBEDTLS_CONFIG_FILE)
35 #include "config.h"
36 #else
37 #include MBEDTLS_CONFIG_FILE
38 #endif
39 
40 #include <stddef.h>
41 
42 /* MBEDTLS_ERR_MD2_HW_ACCEL_FAILED is deprecated and should not be used. */
43 #define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED -0x002B
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 #if !defined(MBEDTLS_MD2_ALT)
50 // Regular implementation
51 //
52 
61 typedef struct mbedtls_md2_context
62 {
63  unsigned char cksum[16];
64  unsigned char state[48];
65  unsigned char buffer[16];
66  size_t left;
67 }
69 
70 #else /* MBEDTLS_MD2_ALT */
71 #include "md2_alt.h"
72 #endif /* MBEDTLS_MD2_ALT */
73 
85 
97 
110  const mbedtls_md2_context *src );
111 
125 
141  const unsigned char *input,
142  size_t ilen );
143 
158  unsigned char output[16] );
159 
173 
174 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
175 #if defined(MBEDTLS_DEPRECATED_WARNING)
176 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
177 #else
178 #define MBEDTLS_DEPRECATED
179 #endif
180 
193 
209  const unsigned char *input,
210  size_t ilen );
211 
226  unsigned char output[16] );
227 
241 
242 #undef MBEDTLS_DEPRECATED
243 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
244 
257 int mbedtls_md2_ret( const unsigned char *input,
258  size_t ilen,
259  unsigned char output[16] );
260 
261 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
262 #if defined(MBEDTLS_DEPRECATED_WARNING)
263 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
264 #else
265 #define MBEDTLS_DEPRECATED
266 #endif
267 
281 MBEDTLS_DEPRECATED void mbedtls_md2( const unsigned char *input,
282  size_t ilen,
283  unsigned char output[16] );
284 
285 #undef MBEDTLS_DEPRECATED
286 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
287 
288 #if defined(MBEDTLS_SELF_TEST)
289 
300 int mbedtls_md2_self_test( int verbose );
301 
302 #endif /* MBEDTLS_SELF_TEST */
303 
304 #ifdef __cplusplus
305 }
306 #endif
307 
308 #endif /* mbedtls_md2.h */