00001
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef MBEDTLS_MD2_H
00030 #define MBEDTLS_MD2_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
00040 #define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED -0x002B
00042 #if !defined(MBEDTLS_MD2_ALT)
00043
00044
00045
00046 #ifdef __cplusplus
00047 extern "C" {
00048 #endif
00049
00058 typedef struct
00059 {
00060 unsigned char cksum[16];
00061 unsigned char state[48];
00062 unsigned char buffer[16];
00063 size_t left;
00064 }
00065 mbedtls_md2_context;
00066
00077 void mbedtls_md2_init( mbedtls_md2_context *ctx );
00078
00089 void mbedtls_md2_free( mbedtls_md2_context *ctx );
00090
00102 void mbedtls_md2_clone( mbedtls_md2_context *dst,
00103 const mbedtls_md2_context *src );
00104
00117 int mbedtls_md2_starts_ret( mbedtls_md2_context *ctx );
00118
00133 int mbedtls_md2_update_ret( mbedtls_md2_context *ctx,
00134 const unsigned char *input,
00135 size_t ilen );
00136
00150 int mbedtls_md2_finish_ret( mbedtls_md2_context *ctx,
00151 unsigned char output[16] );
00152
00165 int mbedtls_internal_md2_process( mbedtls_md2_context *ctx );
00166
00167 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00168 #if defined(MBEDTLS_DEPRECATED_WARNING)
00169 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00170 #else
00171 #define MBEDTLS_DEPRECATED
00172 #endif
00173
00185 MBEDTLS_DEPRECATED void mbedtls_md2_starts( mbedtls_md2_context *ctx );
00186
00201 MBEDTLS_DEPRECATED void mbedtls_md2_update( mbedtls_md2_context *ctx,
00202 const unsigned char *input,
00203 size_t ilen );
00204
00218 MBEDTLS_DEPRECATED void mbedtls_md2_finish( mbedtls_md2_context *ctx,
00219 unsigned char output[16] );
00220
00233 MBEDTLS_DEPRECATED void mbedtls_md2_process( mbedtls_md2_context *ctx );
00234
00235 #undef MBEDTLS_DEPRECATED
00236 #endif
00237
00238 #ifdef __cplusplus
00239 }
00240 #endif
00241
00242 #else
00243 #include "md2_alt.h"
00244 #endif
00245
00246 #ifdef __cplusplus
00247 extern "C" {
00248 #endif
00249
00262 int mbedtls_md2_ret( const unsigned char *input,
00263 size_t ilen,
00264 unsigned char output[16] );
00265
00266 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00267 #if defined(MBEDTLS_DEPRECATED_WARNING)
00268 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00269 #else
00270 #define MBEDTLS_DEPRECATED
00271 #endif
00272
00286 MBEDTLS_DEPRECATED void mbedtls_md2( const unsigned char *input,
00287 size_t ilen,
00288 unsigned char output[16] );
00289
00290 #undef MBEDTLS_DEPRECATED
00291 #endif
00292
00303 int mbedtls_md2_self_test( int verbose );
00304
00305 #ifdef __cplusplus
00306 }
00307 #endif
00308
00309 #endif