mbed TLS v2.16.6
md5.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 #ifndef MBEDTLS_MD5_H
31 #define MBEDTLS_MD5_H
32 
33 #if !defined(MBEDTLS_CONFIG_FILE)
34 #include "config.h"
35 #else
36 #include MBEDTLS_CONFIG_FILE
37 #endif
38 
39 #include <stddef.h>
40 #include <stdint.h>
41 
42 /* MBEDTLS_ERR_MD5_HW_ACCEL_FAILED is deprecated and should not be used. */
43 #define MBEDTLS_ERR_MD5_HW_ACCEL_FAILED -0x002F
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 #if !defined(MBEDTLS_MD5_ALT)
50 // Regular implementation
51 //
52 
61 typedef struct mbedtls_md5_context
62 {
63  uint32_t total[2];
64  uint32_t state[4];
65  unsigned char buffer[64];
66 }
68 
69 #else /* MBEDTLS_MD5_ALT */
70 #include "md5_alt.h"
71 #endif /* MBEDTLS_MD5_ALT */
72 
84 
96 
109  const mbedtls_md5_context *src );
110 
124 
140  const unsigned char *input,
141  size_t ilen );
142 
157  unsigned char output[16] );
158 
173  const unsigned char data[64] );
174 
175 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
176 #if defined(MBEDTLS_DEPRECATED_WARNING)
177 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
178 #else
179 #define MBEDTLS_DEPRECATED
180 #endif
181 
194 
210  const unsigned char *input,
211  size_t ilen );
212 
227  unsigned char output[16] );
228 
243  const unsigned char data[64] );
244 
245 #undef MBEDTLS_DEPRECATED
246 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
247 
262 int mbedtls_md5_ret( const unsigned char *input,
263  size_t ilen,
264  unsigned char output[16] );
265 
266 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
267 #if defined(MBEDTLS_DEPRECATED_WARNING)
268 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
269 #else
270 #define MBEDTLS_DEPRECATED
271 #endif
272 
286 MBEDTLS_DEPRECATED void mbedtls_md5( const unsigned char *input,
287  size_t ilen,
288  unsigned char output[16] );
289 
290 #undef MBEDTLS_DEPRECATED
291 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
292 
293 #if defined(MBEDTLS_SELF_TEST)
294 
305 int mbedtls_md5_self_test( int verbose );
306 
307 #endif /* MBEDTLS_SELF_TEST */
308 
309 #ifdef __cplusplus
310 }
311 #endif
312 
313 #endif /* mbedtls_md5.h */
MBEDTLS_DEPRECATED void mbedtls_md5_finish(mbedtls_md5_context *ctx, unsigned char output[16])
MD5 final digest.
Configuration options (set of defines)
uint32_t state[4]
Definition: md5.h:64
void mbedtls_md5_init(mbedtls_md5_context *ctx)
Initialize MD5 context.
int mbedtls_internal_md5_process(mbedtls_md5_context *ctx, const unsigned char data[64])
MD5 process data block (internal use only)
#define MBEDTLS_DEPRECATED
Definition: md5.h:270
MBEDTLS_DEPRECATED void mbedtls_md5_update(mbedtls_md5_context *ctx, const unsigned char *input, size_t ilen)
MD5 process buffer.
void mbedtls_md5_clone(mbedtls_md5_context *dst, const mbedtls_md5_context *src)
Clone (the state of) an MD5 context.
int mbedtls_md5_update_ret(mbedtls_md5_context *ctx, const unsigned char *input, size_t ilen)
MD5 process buffer.
unsigned char buffer[64]
Definition: md5.h:65
void mbedtls_md5_free(mbedtls_md5_context *ctx)
Clear MD5 context.
int mbedtls_md5_starts_ret(mbedtls_md5_context *ctx)
MD5 context setup.
MD5 context structure.
Definition: md5.h:61
int mbedtls_md5_finish_ret(mbedtls_md5_context *ctx, unsigned char output[16])
MD5 final digest.
MBEDTLS_DEPRECATED void mbedtls_md5(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD5( input buffer )
int mbedtls_md5_self_test(int verbose)
Checkup routine.
int mbedtls_md5_ret(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD5( input buffer )
MBEDTLS_DEPRECATED void mbedtls_md5_starts(mbedtls_md5_context *ctx)
MD5 context setup.
MBEDTLS_DEPRECATED void mbedtls_md5_process(mbedtls_md5_context *ctx, const unsigned char data[64])
MD5 process data block (internal use only)
uint32_t total[2]
Definition: md5.h:63
struct mbedtls_md5_context mbedtls_md5_context
MD5 context structure.