PolarSSL v1.2.7
md5.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_MD5_H
28 #define POLARSSL_MD5_H
29 
30 #include <string.h>
31 
32 #ifdef _MSC_VER
33 #include <basetsd.h>
34 typedef UINT32 uint32_t;
35 #else
36 #include <inttypes.h>
37 #endif
38 
39 #define POLARSSL_ERR_MD5_FILE_IO_ERROR -0x0074
44 typedef struct
45 {
46  uint32_t total[2];
47  uint32_t state[4];
48  unsigned char buffer[64];
50  unsigned char ipad[64];
51  unsigned char opad[64];
52 }
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
64 void md5_starts( md5_context *ctx );
65 
73 void md5_update( md5_context *ctx, const unsigned char *input, size_t ilen );
74 
81 void md5_finish( md5_context *ctx, unsigned char output[16] );
82 
90 void md5( const unsigned char *input, size_t ilen, unsigned char output[16] );
91 
100 int md5_file( const char *path, unsigned char output[16] );
101 
109 void md5_hmac_starts( md5_context *ctx,
110  const unsigned char *key, size_t keylen );
111 
119 void md5_hmac_update( md5_context *ctx,
120  const unsigned char *input, size_t ilen );
121 
128 void md5_hmac_finish( md5_context *ctx, unsigned char output[16] );
129 
135 void md5_hmac_reset( md5_context *ctx );
136 
146 void md5_hmac( const unsigned char *key, size_t keylen,
147  const unsigned char *input, size_t ilen,
148  unsigned char output[16] );
149 
155 int md5_self_test( int verbose );
156 
157 /* Internal use */
158 void md5_process( md5_context *ctx, const unsigned char data[64] );
159 
160 #ifdef __cplusplus
161 }
162 #endif
163 
164 #endif /* md5.h */