PolarSSL v1.1.4
|
00001 00027 #ifndef POLARSSL_MD2_H 00028 #define POLARSSL_MD2_H 00029 00030 #include <string.h> 00031 00032 #define POLARSSL_ERR_MD2_FILE_IO_ERROR -0x0070 00037 typedef struct 00038 { 00039 unsigned char cksum[16]; 00040 unsigned char state[48]; 00041 unsigned char buffer[16]; 00043 unsigned char ipad[16]; 00044 unsigned char opad[16]; 00045 size_t left; 00046 } 00047 md2_context; 00048 00049 #ifdef __cplusplus 00050 extern "C" { 00051 #endif 00052 00058 void md2_starts( md2_context *ctx ); 00059 00067 void md2_update( md2_context *ctx, const unsigned char *input, size_t ilen ); 00068 00075 void md2_finish( md2_context *ctx, unsigned char output[16] ); 00076 00084 void md2( const unsigned char *input, size_t ilen, unsigned char output[16] ); 00085 00094 int md2_file( const char *path, unsigned char output[16] ); 00095 00103 void md2_hmac_starts( md2_context *ctx, const unsigned char *key, size_t keylen ); 00104 00112 void md2_hmac_update( md2_context *ctx, const unsigned char *input, size_t ilen ); 00113 00120 void md2_hmac_finish( md2_context *ctx, unsigned char output[16] ); 00121 00127 void md2_hmac_reset( md2_context *ctx ); 00128 00138 void md2_hmac( const unsigned char *key, size_t keylen, 00139 const unsigned char *input, size_t ilen, 00140 unsigned char output[16] ); 00141 00147 int md2_self_test( int verbose ); 00148 00149 #ifdef __cplusplus 00150 } 00151 #endif 00152 00153 #endif /* md2.h */