mbed TLS v2.16.7
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: Apache-2.0 OR GPL-2.0-or-later
13  *
14  * This file is provided under the Apache License 2.0, or the
15  * GNU General Public License v2.0 or later.
16  *
17  * **********
18  * Apache License 2.0:
19  *
20  * Licensed under the Apache License, Version 2.0 (the "License"); you may
21  * not use this file except in compliance with the License.
22  * You may obtain a copy of the License at
23  *
24  * http://www.apache.org/licenses/LICENSE-2.0
25  *
26  * Unless required by applicable law or agreed to in writing, software
27  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
28  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29  * See the License for the specific language governing permissions and
30  * limitations under the License.
31  *
32  * **********
33  *
34  * **********
35  * GNU General Public License v2.0 or later:
36  *
37  * This program is free software; you can redistribute it and/or modify
38  * it under the terms of the GNU General Public License as published by
39  * the Free Software Foundation; either version 2 of the License, or
40  * (at your option) any later version.
41  *
42  * This program is distributed in the hope that it will be useful,
43  * but WITHOUT ANY WARRANTY; without even the implied warranty of
44  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  * GNU General Public License for more details.
46  *
47  * You should have received a copy of the GNU General Public License along
48  * with this program; if not, write to the Free Software Foundation, Inc.,
49  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
50  *
51  * **********
52  *
53  * This file is part of mbed TLS (https://tls.mbed.org)
54  *
55  */
56 #ifndef MBEDTLS_MD4_H
57 #define MBEDTLS_MD4_H
58 
59 #if !defined(MBEDTLS_CONFIG_FILE)
60 #include "config.h"
61 #else
62 #include MBEDTLS_CONFIG_FILE
63 #endif
64 
65 #include <stddef.h>
66 #include <stdint.h>
67 
68 /* MBEDTLS_ERR_MD4_HW_ACCEL_FAILED is deprecated and should not be used. */
69 #define MBEDTLS_ERR_MD4_HW_ACCEL_FAILED -0x002D
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74 
75 #if !defined(MBEDTLS_MD4_ALT)
76 // Regular implementation
77 //
78 
87 typedef struct mbedtls_md4_context
88 {
89  uint32_t total[2];
90  uint32_t state[4];
91  unsigned char buffer[64];
92 }
94 
95 #else /* MBEDTLS_MD4_ALT */
96 #include "md4_alt.h"
97 #endif /* MBEDTLS_MD4_ALT */
98 
110 
122 
135  const mbedtls_md4_context *src );
136 
149 
165  const unsigned char *input,
166  size_t ilen );
167 
182  unsigned char output[16] );
183 
198  const unsigned char data[64] );
199 
200 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
201 #if defined(MBEDTLS_DEPRECATED_WARNING)
202 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
203 #else
204 #define MBEDTLS_DEPRECATED
205 #endif
206 
219 
235  const unsigned char *input,
236  size_t ilen );
237 
252  unsigned char output[16] );
253 
268  const unsigned char data[64] );
269 
270 #undef MBEDTLS_DEPRECATED
271 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
272 
287 int mbedtls_md4_ret( const unsigned char *input,
288  size_t ilen,
289  unsigned char output[16] );
290 
291 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
292 #if defined(MBEDTLS_DEPRECATED_WARNING)
293 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
294 #else
295 #define MBEDTLS_DEPRECATED
296 #endif
297 
311 MBEDTLS_DEPRECATED void mbedtls_md4( const unsigned char *input,
312  size_t ilen,
313  unsigned char output[16] );
314 
315 #undef MBEDTLS_DEPRECATED
316 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
317 
318 #if defined(MBEDTLS_SELF_TEST)
319 
330 int mbedtls_md4_self_test( int verbose );
331 
332 #endif /* MBEDTLS_SELF_TEST */
333 
334 #ifdef __cplusplus
335 }
336 #endif
337 
338 #endif /* mbedtls_md4.h */
mbedtls_md4_starts_ret
int mbedtls_md4_starts_ret(mbedtls_md4_context *ctx)
MD4 context setup.
mbedtls_md4_ret
int mbedtls_md4_ret(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD4( input buffer )
MBEDTLS_DEPRECATED
#define MBEDTLS_DEPRECATED
Definition: md4.h:295
mbedtls_md4_process
MBEDTLS_DEPRECATED void mbedtls_md4_process(mbedtls_md4_context *ctx, const unsigned char data[64])
MD4 process data block (internal use only)
mbedtls_md4_update
MBEDTLS_DEPRECATED void mbedtls_md4_update(mbedtls_md4_context *ctx, const unsigned char *input, size_t ilen)
MD4 process buffer.
mbedtls_md4_self_test
int mbedtls_md4_self_test(int verbose)
Checkup routine.
mbedtls_md4_free
void mbedtls_md4_free(mbedtls_md4_context *ctx)
Clear MD4 context.
mbedtls_md4_finish_ret
int mbedtls_md4_finish_ret(mbedtls_md4_context *ctx, unsigned char output[16])
MD4 final digest.
mbedtls_md4_update_ret
int mbedtls_md4_update_ret(mbedtls_md4_context *ctx, const unsigned char *input, size_t ilen)
MD4 process buffer.
mbedtls_md4_context::state
uint32_t state[4]
Definition: md4.h:90
mbedtls_md4_clone
void mbedtls_md4_clone(mbedtls_md4_context *dst, const mbedtls_md4_context *src)
Clone (the state of) an MD4 context.
mbedtls_md4_context::total
uint32_t total[2]
Definition: md4.h:89
mbedtls_internal_md4_process
int mbedtls_internal_md4_process(mbedtls_md4_context *ctx, const unsigned char data[64])
MD4 process data block (internal use only)
mbedtls_md4
MBEDTLS_DEPRECATED void mbedtls_md4(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD4( input buffer )
mbedtls_md4_finish
MBEDTLS_DEPRECATED void mbedtls_md4_finish(mbedtls_md4_context *ctx, unsigned char output[16])
MD4 final digest.
mbedtls_md4_context
struct mbedtls_md4_context mbedtls_md4_context
MD4 context structure.
mbedtls_md4_starts
MBEDTLS_DEPRECATED void mbedtls_md4_starts(mbedtls_md4_context *ctx)
MD4 context setup.
mbedtls_md4_context::buffer
unsigned char buffer[64]
Definition: md4.h:91
config.h
Configuration options (set of defines)
mbedtls_md4_init
void mbedtls_md4_init(mbedtls_md4_context *ctx)
Initialize MD4 context.
mbedtls_md4_context
MD4 context structure.
Definition: md4.h:88