mbed TLS v2.16.6
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 */
MBEDTLS_DEPRECATED void mbedtls_md2(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD2( input buffer )
size_t left
Definition: md2.h:66
MBEDTLS_DEPRECATED void mbedtls_md2_starts(mbedtls_md2_context *ctx)
MD2 context setup.
unsigned char cksum[16]
Definition: md2.h:63
int mbedtls_md2_update_ret(mbedtls_md2_context *ctx, const unsigned char *input, size_t ilen)
MD2 process buffer.
Configuration options (set of defines)
MBEDTLS_DEPRECATED void mbedtls_md2_update(mbedtls_md2_context *ctx, const unsigned char *input, size_t ilen)
MD2 process buffer.
int mbedtls_md2_self_test(int verbose)
Checkup routine.
void mbedtls_md2_init(mbedtls_md2_context *ctx)
Initialize MD2 context.
MBEDTLS_DEPRECATED void mbedtls_md2_finish(mbedtls_md2_context *ctx, unsigned char output[16])
MD2 final digest.
int mbedtls_internal_md2_process(mbedtls_md2_context *ctx)
MD2 process data block (internal use only)
int mbedtls_md2_ret(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD2( input buffer )
unsigned char buffer[16]
Definition: md2.h:65
void mbedtls_md2_clone(mbedtls_md2_context *dst, const mbedtls_md2_context *src)
Clone (the state of) an MD2 context.
struct mbedtls_md2_context mbedtls_md2_context
MD2 context structure.
int mbedtls_md2_finish_ret(mbedtls_md2_context *ctx, unsigned char output[16])
MD2 final digest.
unsigned char state[48]
Definition: md2.h:64
int mbedtls_md2_starts_ret(mbedtls_md2_context *ctx)
MD2 context setup.
#define MBEDTLS_DEPRECATED
Definition: md2.h:265
MD2 context structure.
Definition: md2.h:61
MBEDTLS_DEPRECATED void mbedtls_md2_process(mbedtls_md2_context *ctx)
MD2 process data block (internal use only)
void mbedtls_md2_free(mbedtls_md2_context *ctx)
Clear MD2 context.