00001
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef MBEDTLS_MD5_H
00029 #define MBEDTLS_MD5_H
00030
00031 #if !defined(MBEDTLS_CONFIG_FILE)
00032 #include "config.h"
00033 #else
00034 #include MBEDTLS_CONFIG_FILE
00035 #endif
00036
00037 #include <stddef.h>
00038 #include <stdint.h>
00039
00040 #define MBEDTLS_ERR_MD5_HW_ACCEL_FAILED -0x002F
00042 #if !defined(MBEDTLS_MD5_ALT)
00043
00044
00045
00046 #ifdef __cplusplus
00047 extern "C" {
00048 #endif
00049
00058 typedef struct
00059 {
00060 uint32_t total[2];
00061 uint32_t state[4];
00062 unsigned char buffer[64];
00063 }
00064 mbedtls_md5_context;
00065
00076 void mbedtls_md5_init( mbedtls_md5_context *ctx );
00077
00088 void mbedtls_md5_free( mbedtls_md5_context *ctx );
00089
00101 void mbedtls_md5_clone( mbedtls_md5_context *dst,
00102 const mbedtls_md5_context *src );
00103
00116 int mbedtls_md5_starts_ret( mbedtls_md5_context *ctx );
00117
00132 int mbedtls_md5_update_ret( mbedtls_md5_context *ctx,
00133 const unsigned char *input,
00134 size_t ilen );
00135
00149 int mbedtls_md5_finish_ret( mbedtls_md5_context *ctx,
00150 unsigned char output[16] );
00151
00165 int mbedtls_internal_md5_process( mbedtls_md5_context *ctx,
00166 const unsigned char data[64] );
00167
00168 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00169 #if defined(MBEDTLS_DEPRECATED_WARNING)
00170 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00171 #else
00172 #define MBEDTLS_DEPRECATED
00173 #endif
00174
00186 MBEDTLS_DEPRECATED void mbedtls_md5_starts( mbedtls_md5_context *ctx );
00187
00202 MBEDTLS_DEPRECATED void mbedtls_md5_update( mbedtls_md5_context *ctx,
00203 const unsigned char *input,
00204 size_t ilen );
00205
00219 MBEDTLS_DEPRECATED void mbedtls_md5_finish( mbedtls_md5_context *ctx,
00220 unsigned char output[16] );
00221
00235 MBEDTLS_DEPRECATED void mbedtls_md5_process( mbedtls_md5_context *ctx,
00236 const unsigned char data[64] );
00237
00238 #undef MBEDTLS_DEPRECATED
00239 #endif
00240
00241 #ifdef __cplusplus
00242 }
00243 #endif
00244
00245 #else
00246 #include "md5_alt.h"
00247 #endif
00248
00249 #ifdef __cplusplus
00250 extern "C" {
00251 #endif
00252
00267 int mbedtls_md5_ret( const unsigned char *input,
00268 size_t ilen,
00269 unsigned char output[16] );
00270
00271 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00272 #if defined(MBEDTLS_DEPRECATED_WARNING)
00273 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00274 #else
00275 #define MBEDTLS_DEPRECATED
00276 #endif
00277
00291 MBEDTLS_DEPRECATED void mbedtls_md5( const unsigned char *input,
00292 size_t ilen,
00293 unsigned char output[16] );
00294
00295 #undef MBEDTLS_DEPRECATED
00296 #endif
00297
00308 int mbedtls_md5_self_test( int verbose );
00309
00310 #ifdef __cplusplus
00311 }
00312 #endif
00313
00314 #endif