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 #ifndef MBEDTLS_MD5_H
00054 #define MBEDTLS_MD5_H
00055
00056 #if !defined(MBEDTLS_CONFIG_FILE)
00057 #include "config.h"
00058 #else
00059 #include MBEDTLS_CONFIG_FILE
00060 #endif
00061
00062 #include <stddef.h>
00063 #include <stdint.h>
00064
00065 #define MBEDTLS_ERR_MD5_HW_ACCEL_FAILED -0x002F
00067 #if !defined(MBEDTLS_MD5_ALT)
00068
00069
00070
00071 #ifdef __cplusplus
00072 extern "C" {
00073 #endif
00074
00083 typedef struct
00084 {
00085 uint32_t total[2];
00086 uint32_t state[4];
00087 unsigned char buffer[64];
00088 }
00089 mbedtls_md5_context;
00090
00101 void mbedtls_md5_init( mbedtls_md5_context *ctx );
00102
00113 void mbedtls_md5_free( mbedtls_md5_context *ctx );
00114
00126 void mbedtls_md5_clone( mbedtls_md5_context *dst,
00127 const mbedtls_md5_context *src );
00128
00141 int mbedtls_md5_starts_ret( mbedtls_md5_context *ctx );
00142
00157 int mbedtls_md5_update_ret( mbedtls_md5_context *ctx,
00158 const unsigned char *input,
00159 size_t ilen );
00160
00174 int mbedtls_md5_finish_ret( mbedtls_md5_context *ctx,
00175 unsigned char output[16] );
00176
00190 int mbedtls_internal_md5_process( mbedtls_md5_context *ctx,
00191 const unsigned char data[64] );
00192
00193 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00194 #if defined(MBEDTLS_DEPRECATED_WARNING)
00195 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00196 #else
00197 #define MBEDTLS_DEPRECATED
00198 #endif
00199
00211 MBEDTLS_DEPRECATED void mbedtls_md5_starts( mbedtls_md5_context *ctx );
00212
00227 MBEDTLS_DEPRECATED void mbedtls_md5_update( mbedtls_md5_context *ctx,
00228 const unsigned char *input,
00229 size_t ilen );
00230
00244 MBEDTLS_DEPRECATED void mbedtls_md5_finish( mbedtls_md5_context *ctx,
00245 unsigned char output[16] );
00246
00260 MBEDTLS_DEPRECATED void mbedtls_md5_process( mbedtls_md5_context *ctx,
00261 const unsigned char data[64] );
00262
00263 #undef MBEDTLS_DEPRECATED
00264 #endif
00265
00266 #ifdef __cplusplus
00267 }
00268 #endif
00269
00270 #else
00271 #include "md5_alt.h"
00272 #endif
00273
00274 #ifdef __cplusplus
00275 extern "C" {
00276 #endif
00277
00292 int mbedtls_md5_ret( const unsigned char *input,
00293 size_t ilen,
00294 unsigned char output[16] );
00295
00296 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00297 #if defined(MBEDTLS_DEPRECATED_WARNING)
00298 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00299 #else
00300 #define MBEDTLS_DEPRECATED
00301 #endif
00302
00316 MBEDTLS_DEPRECATED void mbedtls_md5( const unsigned char *input,
00317 size_t ilen,
00318 unsigned char output[16] );
00319
00320 #undef MBEDTLS_DEPRECATED
00321 #endif
00322
00333 int mbedtls_md5_self_test( int verbose );
00334
00335 #ifdef __cplusplus
00336 }
00337 #endif
00338
00339 #endif