mbed TLS v2.16.1
md4.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_MD4_H
32 #define MBEDTLS_MD4_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 #include <stdint.h>
42 
43 /* MBEDTLS_ERR_MD4_HW_ACCEL_FAILED is deprecated and should not be used. */
44 #define MBEDTLS_ERR_MD4_HW_ACCEL_FAILED -0x002D
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 #if !defined(MBEDTLS_MD4_ALT)
51 // Regular implementation
52 //
53 
62 typedef struct mbedtls_md4_context
63 {
64  uint32_t total[2];
65  uint32_t state[4];
66  unsigned char buffer[64];
67 }
69 
70 #else /* MBEDTLS_MD4_ALT */
71 #include "md4_alt.h"
72 #endif /* MBEDTLS_MD4_ALT */
73 
85 
97 
110  const mbedtls_md4_context *src );
111 
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_md4_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_md4( 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_md4_self_test( int verbose );
306 
307 #endif /* MBEDTLS_SELF_TEST */
308 
309 #ifdef __cplusplus
310 }
311 #endif
312 
313 #endif /* mbedtls_md4.h */
int mbedtls_md4_ret(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD4( input buffer )
int mbedtls_md4_self_test(int verbose)
Checkup routine.
int mbedtls_internal_md4_process(mbedtls_md4_context *ctx, const unsigned char data[64])
MD4 process data block (internal use only)
Configuration options (set of defines)
uint32_t state[4]
Definition: md4.h:65
MBEDTLS_DEPRECATED void mbedtls_md4_update(mbedtls_md4_context *ctx, const unsigned char *input, size_t ilen)
MD4 process buffer.
struct mbedtls_md4_context mbedtls_md4_context
MD4 context structure.
void mbedtls_md4_clone(mbedtls_md4_context *dst, const mbedtls_md4_context *src)
Clone (the state of) an MD4 context.
void mbedtls_md4_free(mbedtls_md4_context *ctx)
Clear MD4 context.
MBEDTLS_DEPRECATED void mbedtls_md4_starts(mbedtls_md4_context *ctx)
MD4 context setup.
int mbedtls_md4_starts_ret(mbedtls_md4_context *ctx)
MD4 context setup.
int mbedtls_md4_finish_ret(mbedtls_md4_context *ctx, unsigned char output[16])
MD4 final digest.
MD4 context structure.
Definition: md4.h:62
MBEDTLS_DEPRECATED void mbedtls_md4_process(mbedtls_md4_context *ctx, const unsigned char data[64])
MD4 process data block (internal use only)
#define MBEDTLS_DEPRECATED
Definition: md4.h:270
uint32_t total[2]
Definition: md4.h:64
int mbedtls_md4_update_ret(mbedtls_md4_context *ctx, const unsigned char *input, size_t ilen)
MD4 process buffer.
unsigned char buffer[64]
Definition: md4.h:66
MBEDTLS_DEPRECATED void mbedtls_md4_finish(mbedtls_md4_context *ctx, unsigned char output[16])
MD4 final digest.
void mbedtls_md4_init(mbedtls_md4_context *ctx)
Initialize MD4 context.
MBEDTLS_DEPRECATED void mbedtls_md4(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD4( input buffer )