00001
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #ifndef MBEDTLS_MD5_H
00056 #define MBEDTLS_MD5_H
00057
00058 #if !defined(MBEDTLS_CONFIG_FILE)
00059 #include "config.h"
00060 #else
00061 #include MBEDTLS_CONFIG_FILE
00062 #endif
00063
00064 #include <stddef.h>
00065 #include <stdint.h>
00066
00067 #define MBEDTLS_ERR_MD5_HW_ACCEL_FAILED -0x002F
00069 #if !defined(MBEDTLS_MD5_ALT)
00070
00071
00072
00073 #ifdef __cplusplus
00074 extern "C" {
00075 #endif
00076
00085 typedef struct
00086 {
00087 uint32_t total[2];
00088 uint32_t state[4];
00089 unsigned char buffer[64];
00090 }
00091 mbedtls_md5_context;
00092
00103 void mbedtls_md5_init( mbedtls_md5_context *ctx );
00104
00115 void mbedtls_md5_free( mbedtls_md5_context *ctx );
00116
00128 void mbedtls_md5_clone( mbedtls_md5_context *dst,
00129 const mbedtls_md5_context *src );
00130
00143 int mbedtls_md5_starts_ret( mbedtls_md5_context *ctx );
00144
00159 int mbedtls_md5_update_ret( mbedtls_md5_context *ctx,
00160 const unsigned char *input,
00161 size_t ilen );
00162
00176 int mbedtls_md5_finish_ret( mbedtls_md5_context *ctx,
00177 unsigned char output[16] );
00178
00192 int mbedtls_internal_md5_process( mbedtls_md5_context *ctx,
00193 const unsigned char data[64] );
00194
00195 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00196 #if defined(MBEDTLS_DEPRECATED_WARNING)
00197 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00198 #else
00199 #define MBEDTLS_DEPRECATED
00200 #endif
00201
00213 MBEDTLS_DEPRECATED void mbedtls_md5_starts( mbedtls_md5_context *ctx );
00214
00229 MBEDTLS_DEPRECATED void mbedtls_md5_update( mbedtls_md5_context *ctx,
00230 const unsigned char *input,
00231 size_t ilen );
00232
00246 MBEDTLS_DEPRECATED void mbedtls_md5_finish( mbedtls_md5_context *ctx,
00247 unsigned char output[16] );
00248
00262 MBEDTLS_DEPRECATED void mbedtls_md5_process( mbedtls_md5_context *ctx,
00263 const unsigned char data[64] );
00264
00265 #undef MBEDTLS_DEPRECATED
00266 #endif
00267
00268 #ifdef __cplusplus
00269 }
00270 #endif
00271
00272 #else
00273 #include "md5_alt.h"
00274 #endif
00275
00276 #ifdef __cplusplus
00277 extern "C" {
00278 #endif
00279
00294 int mbedtls_md5_ret( const unsigned char *input,
00295 size_t ilen,
00296 unsigned char output[16] );
00297
00298 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00299 #if defined(MBEDTLS_DEPRECATED_WARNING)
00300 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00301 #else
00302 #define MBEDTLS_DEPRECATED
00303 #endif
00304
00318 MBEDTLS_DEPRECATED void mbedtls_md5( const unsigned char *input,
00319 size_t ilen,
00320 unsigned char output[16] );
00321
00322 #undef MBEDTLS_DEPRECATED
00323 #endif
00324
00335 int mbedtls_md5_self_test( int verbose );
00336
00337 #ifdef __cplusplus
00338 }
00339 #endif
00340
00341 #endif