00001
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef MBEDTLS_MD4_H
00030 #define MBEDTLS_MD4_H
00031
00032 #if !defined(MBEDTLS_CONFIG_FILE)
00033 #include "config.h"
00034 #else
00035 #include MBEDTLS_CONFIG_FILE
00036 #endif
00037
00038 #include <stddef.h>
00039 #include <stdint.h>
00040
00041 #define MBEDTLS_ERR_MD4_HW_ACCEL_FAILED -0x002D
00043 #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
00044 !defined(inline) && !defined(__cplusplus)
00045 #define inline __inline
00046 #endif
00047
00048 #if !defined(MBEDTLS_MD4_ALT)
00049
00050
00051
00052 #ifdef __cplusplus
00053 extern "C" {
00054 #endif
00055
00064 typedef struct
00065 {
00066 uint32_t total[2];
00067 uint32_t state[4];
00068 unsigned char buffer[64];
00069 }
00070 mbedtls_md4_context;
00071
00082 void mbedtls_md4_init( mbedtls_md4_context *ctx );
00083
00094 void mbedtls_md4_free( mbedtls_md4_context *ctx );
00095
00107 void mbedtls_md4_clone( mbedtls_md4_context *dst,
00108 const mbedtls_md4_context *src );
00109
00121 int mbedtls_md4_starts_ret( mbedtls_md4_context *ctx );
00122
00137 int mbedtls_md4_update_ret( mbedtls_md4_context *ctx,
00138 const unsigned char *input,
00139 size_t ilen );
00140
00154 int mbedtls_md4_finish_ret( mbedtls_md4_context *ctx,
00155 unsigned char output[16] );
00156
00170 int mbedtls_internal_md4_process( mbedtls_md4_context *ctx,
00171 const unsigned char data[64] );
00172
00173 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00174 #if defined(MBEDTLS_DEPRECATED_WARNING)
00175 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00176 #else
00177 #define MBEDTLS_DEPRECATED
00178 #endif
00179
00191 MBEDTLS_DEPRECATED static inline void mbedtls_md4_starts(
00192 mbedtls_md4_context *ctx )
00193 {
00194 mbedtls_md4_starts_ret( ctx );
00195 }
00196
00211 MBEDTLS_DEPRECATED static inline void mbedtls_md4_update(
00212 mbedtls_md4_context *ctx,
00213 const unsigned char *input,
00214 size_t ilen )
00215 {
00216 mbedtls_md4_update_ret( ctx, input, ilen );
00217 }
00218
00232 MBEDTLS_DEPRECATED static inline void mbedtls_md4_finish(
00233 mbedtls_md4_context *ctx,
00234 unsigned char output[16] )
00235 {
00236 mbedtls_md4_finish_ret( ctx, output );
00237 }
00238
00252 MBEDTLS_DEPRECATED static inline void mbedtls_md4_process(
00253 mbedtls_md4_context *ctx,
00254 const unsigned char data[64] )
00255 {
00256 mbedtls_internal_md4_process( ctx, data );
00257 }
00258
00259 #undef MBEDTLS_DEPRECATED
00260 #endif
00261
00262 #ifdef __cplusplus
00263 }
00264 #endif
00265
00266 #else
00267 #include "md4_alt.h"
00268 #endif
00269
00270 #ifdef __cplusplus
00271 extern "C" {
00272 #endif
00273
00288 int mbedtls_md4_ret( const unsigned char *input,
00289 size_t ilen,
00290 unsigned char output[16] );
00291
00292 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00293 #if defined(MBEDTLS_DEPRECATED_WARNING)
00294 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00295 #else
00296 #define MBEDTLS_DEPRECATED
00297 #endif
00298
00312 MBEDTLS_DEPRECATED static inline void mbedtls_md4( const unsigned char *input,
00313 size_t ilen,
00314 unsigned char output[16] )
00315 {
00316 mbedtls_md4_ret( input, ilen, output );
00317 }
00318
00319 #undef MBEDTLS_DEPRECATED
00320 #endif
00321
00332 int mbedtls_md4_self_test( int verbose );
00333
00334 #ifdef __cplusplus
00335 }
00336 #endif
00337
00338 #endif