00001
00004 #ifndef XYSSL_MD2_H
00005 #define XYSSL_MD2_H
00006
00010 typedef struct
00011 {
00012 unsigned char cksum[16];
00013 unsigned char state[48];
00014 unsigned char buffer[16];
00016 unsigned char ipad[64];
00017 unsigned char opad[64];
00018 int left;
00019 }
00020 md2_context;
00021
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025
00031 void md2_starts( md2_context *ctx );
00032
00040 void md2_update( md2_context *ctx, unsigned char *input, int ilen );
00041
00048 void md2_finish( md2_context *ctx, unsigned char output[16] );
00049
00057 void md2( unsigned char *input, int ilen, unsigned char output[16] );
00058
00068 int md2_file( char *path, unsigned char output[16] );
00069
00077 void md2_hmac_starts( md2_context *ctx, unsigned char *key, int keylen );
00078
00086 void md2_hmac_update( md2_context *ctx, unsigned char *input, int ilen );
00087
00094 void md2_hmac_finish( md2_context *ctx, unsigned char output[16] );
00095
00105 void md2_hmac( unsigned char *key, int keylen,
00106 unsigned char *input, int ilen,
00107 unsigned char output[16] );
00108
00114 int md2_self_test( int verbose );
00115
00116 #ifdef __cplusplus
00117 }
00118 #endif
00119
00120 #endif