PolarSSL v1.1.4
|
00001 00027 #ifndef POLARSSL_MD5_H 00028 #define POLARSSL_MD5_H 00029 00030 #include <string.h> 00031 00032 #define POLARSSL_ERR_MD5_FILE_IO_ERROR -0x0074 00037 typedef struct 00038 { 00039 unsigned long total[2]; 00040 unsigned long state[4]; 00041 unsigned char buffer[64]; 00043 unsigned char ipad[64]; 00044 unsigned char opad[64]; 00045 } 00046 md5_context; 00047 00048 #ifdef __cplusplus 00049 extern "C" { 00050 #endif 00051 00057 void md5_starts( md5_context *ctx ); 00058 00066 void md5_update( md5_context *ctx, const unsigned char *input, size_t ilen ); 00067 00074 void md5_finish( md5_context *ctx, unsigned char output[16] ); 00075 00083 void md5( const unsigned char *input, size_t ilen, unsigned char output[16] ); 00084 00093 int md5_file( const char *path, unsigned char output[16] ); 00094 00102 void md5_hmac_starts( md5_context *ctx, 00103 const unsigned char *key, size_t keylen ); 00104 00112 void md5_hmac_update( md5_context *ctx, 00113 const unsigned char *input, size_t ilen ); 00114 00121 void md5_hmac_finish( md5_context *ctx, unsigned char output[16] ); 00122 00128 void md5_hmac_reset( md5_context *ctx ); 00129 00139 void md5_hmac( const unsigned char *key, size_t keylen, 00140 const unsigned char *input, size_t ilen, 00141 unsigned char output[16] ); 00142 00148 int md5_self_test( int verbose ); 00149 00150 #ifdef __cplusplus 00151 } 00152 #endif 00153 00154 #endif /* md5.h */