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 #ifndef MBEDTLS_MD2_H
00055 #define MBEDTLS_MD2_H
00056
00057 #if !defined(MBEDTLS_CONFIG_FILE)
00058 #include "config.h"
00059 #else
00060 #include MBEDTLS_CONFIG_FILE
00061 #endif
00062
00063 #include <stddef.h>
00064
00065 #define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED -0x002B
00067 #if !defined(MBEDTLS_MD2_ALT)
00068
00069
00070
00071 #ifdef __cplusplus
00072 extern "C" {
00073 #endif
00074
00083 typedef struct
00084 {
00085 unsigned char cksum[16];
00086 unsigned char state[48];
00087 unsigned char buffer[16];
00088 size_t left;
00089 }
00090 mbedtls_md2_context;
00091
00102 void mbedtls_md2_init( mbedtls_md2_context *ctx );
00103
00114 void mbedtls_md2_free( mbedtls_md2_context *ctx );
00115
00127 void mbedtls_md2_clone( mbedtls_md2_context *dst,
00128 const mbedtls_md2_context *src );
00129
00142 int mbedtls_md2_starts_ret( mbedtls_md2_context *ctx );
00143
00158 int mbedtls_md2_update_ret( mbedtls_md2_context *ctx,
00159 const unsigned char *input,
00160 size_t ilen );
00161
00175 int mbedtls_md2_finish_ret( mbedtls_md2_context *ctx,
00176 unsigned char output[16] );
00177
00190 int mbedtls_internal_md2_process( mbedtls_md2_context *ctx );
00191
00192 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00193 #if defined(MBEDTLS_DEPRECATED_WARNING)
00194 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00195 #else
00196 #define MBEDTLS_DEPRECATED
00197 #endif
00198
00210 MBEDTLS_DEPRECATED void mbedtls_md2_starts( mbedtls_md2_context *ctx );
00211
00226 MBEDTLS_DEPRECATED void mbedtls_md2_update( mbedtls_md2_context *ctx,
00227 const unsigned char *input,
00228 size_t ilen );
00229
00243 MBEDTLS_DEPRECATED void mbedtls_md2_finish( mbedtls_md2_context *ctx,
00244 unsigned char output[16] );
00245
00258 MBEDTLS_DEPRECATED void mbedtls_md2_process( mbedtls_md2_context *ctx );
00259
00260 #undef MBEDTLS_DEPRECATED
00261 #endif
00262
00263 #ifdef __cplusplus
00264 }
00265 #endif
00266
00267 #else
00268 #include "md2_alt.h"
00269 #endif
00270
00271 #ifdef __cplusplus
00272 extern "C" {
00273 #endif
00274
00287 int mbedtls_md2_ret( const unsigned char *input,
00288 size_t ilen,
00289 unsigned char output[16] );
00290
00291 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
00292 #if defined(MBEDTLS_DEPRECATED_WARNING)
00293 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
00294 #else
00295 #define MBEDTLS_DEPRECATED
00296 #endif
00297
00311 MBEDTLS_DEPRECATED void mbedtls_md2( const unsigned char *input,
00312 size_t ilen,
00313 unsigned char output[16] );
00314
00315 #undef MBEDTLS_DEPRECATED
00316 #endif
00317
00328 int mbedtls_md2_self_test( int verbose );
00329
00330 #ifdef __cplusplus
00331 }
00332 #endif
00333
00334 #endif