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
00056 #ifndef MBEDTLS_MD2_H
00057 #define MBEDTLS_MD2_H
00058
00059 #if !defined(MBEDTLS_CONFIG_FILE)
00060 #include "config.h"
00061 #else
00062 #include MBEDTLS_CONFIG_FILE
00063 #endif
00064
00065 #include <stddef.h>
00066
00067 #define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED -0x002B
00069 #if !defined(MBEDTLS_MD2_ALT)
00070
00071
00072
00073 #ifdef __cplusplus
00074 extern "C" {
00075 #endif
00076
00085 typedef struct
00086 {
00087 unsigned char cksum[16];
00088 unsigned char state[48];
00089 unsigned char buffer[16];
00090 size_t left;
00091 }
00092 mbedtls_md2_context;
00093
00104 void mbedtls_md2_init( mbedtls_md2_context *ctx );
00105
00116 void mbedtls_md2_free( mbedtls_md2_context *ctx );
00117
00129 void mbedtls_md2_clone( mbedtls_md2_context *dst,
00130 const mbedtls_md2_context *src );
00131
00144 int mbedtls_md2_starts_ret( mbedtls_md2_context *ctx );
00145
00160 int mbedtls_md2_update_ret( mbedtls_md2_context *ctx,
00161 const unsigned char *input,
00162 size_t ilen );
00163
00177 int mbedtls_md2_finish_ret( mbedtls_md2_context *ctx,
00178 unsigned char output[16] );
00179
00192 int mbedtls_internal_md2_process( mbedtls_md2_context *ctx );
00193
00194 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00195 #if defined(MBEDTLS_DEPRECATED_WARNING)
00196 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00197 #else
00198 #define MBEDTLS_DEPRECATED
00199 #endif
00200
00212 MBEDTLS_DEPRECATED void mbedtls_md2_starts( mbedtls_md2_context *ctx );
00213
00228 MBEDTLS_DEPRECATED void mbedtls_md2_update( mbedtls_md2_context *ctx,
00229 const unsigned char *input,
00230 size_t ilen );
00231
00245 MBEDTLS_DEPRECATED void mbedtls_md2_finish( mbedtls_md2_context *ctx,
00246 unsigned char output[16] );
00247
00260 MBEDTLS_DEPRECATED void mbedtls_md2_process( mbedtls_md2_context *ctx );
00261
00262 #undef MBEDTLS_DEPRECATED
00263 #endif
00264
00265 #ifdef __cplusplus
00266 }
00267 #endif
00268
00269 #else
00270 #include "md2_alt.h"
00271 #endif
00272
00273 #ifdef __cplusplus
00274 extern "C" {
00275 #endif
00276
00289 int mbedtls_md2_ret( const unsigned char *input,
00290 size_t ilen,
00291 unsigned char output[16] );
00292
00293 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00294 #if defined(MBEDTLS_DEPRECATED_WARNING)
00295 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00296 #else
00297 #define MBEDTLS_DEPRECATED
00298 #endif
00299
00313 MBEDTLS_DEPRECATED void mbedtls_md2( const unsigned char *input,
00314 size_t ilen,
00315 unsigned char output[16] );
00316
00317 #undef MBEDTLS_DEPRECATED
00318 #endif
00319
00330 int mbedtls_md2_self_test( int verbose );
00331
00332 #ifdef __cplusplus
00333 }
00334 #endif
00335
00336 #endif