PolarSSL v1.3.1
md5.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_MD5_H
28 #define POLARSSL_MD5_H
29 
30 #include "config.h"
31 
32 #include <string.h>
33 
34 #ifdef _MSC_VER
35 #include <basetsd.h>
36 typedef UINT32 uint32_t;
37 #else
38 #include <inttypes.h>
39 #endif
40 
41 #define POLARSSL_ERR_MD5_FILE_IO_ERROR -0x0074
43 #if !defined(POLARSSL_MD5_ALT)
44 // Regular implementation
45 //
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
54 typedef struct
55 {
56  uint32_t total[2];
57  uint32_t state[4];
58  unsigned char buffer[64];
60  unsigned char ipad[64];
61  unsigned char opad[64];
62 }
64 
70 void md5_starts( md5_context *ctx );
71 
79 void md5_update( md5_context *ctx, const unsigned char *input, size_t ilen );
80 
87 void md5_finish( md5_context *ctx, unsigned char output[16] );
88 
89 /* Internal use */
90 void md5_process( md5_context *ctx, const unsigned char data[64] );
91 
92 #ifdef __cplusplus
93 }
94 #endif
95 
96 #else /* POLARSSL_MD5_ALT */
97 #include "md5_alt.h"
98 #endif /* POLARSSL_MD5_ALT */
99 
100 #ifdef __cplusplus
101 extern "C" {
102 #endif
103 
111 void md5( const unsigned char *input, size_t ilen, unsigned char output[16] );
112 
121 int md5_file( const char *path, unsigned char output[16] );
122 
130 void md5_hmac_starts( md5_context *ctx,
131  const unsigned char *key, size_t keylen );
132 
140 void md5_hmac_update( md5_context *ctx,
141  const unsigned char *input, size_t ilen );
142 
149 void md5_hmac_finish( md5_context *ctx, unsigned char output[16] );
150 
156 void md5_hmac_reset( md5_context *ctx );
157 
167 void md5_hmac( const unsigned char *key, size_t keylen,
168  const unsigned char *input, size_t ilen,
169  unsigned char output[16] );
170 
176 int md5_self_test( int verbose );
177 
178 #ifdef __cplusplus
179 }
180 #endif
181 
182 #endif /* md5.h */
Configuration options (set of defines)
void md5_finish(md5_context *ctx, unsigned char output[16])
MD5 final digest.
void md5_hmac(const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char output[16])
Output = HMAC-MD5( hmac key, input buffer )
int md5_self_test(int verbose)
Checkup routine.
int md5_file(const char *path, unsigned char output[16])
Output = MD5( file contents )
void md5_hmac_starts(md5_context *ctx, const unsigned char *key, size_t keylen)
MD5 HMAC context setup.
void md5_process(md5_context *ctx, const unsigned char data[64])
void md5_hmac_reset(md5_context *ctx)
MD5 HMAC context reset.
void md5_starts(md5_context *ctx)
MD5 context setup.
void md5_hmac_finish(md5_context *ctx, unsigned char output[16])
MD5 HMAC final digest.
MD5 context structure.
Definition: md5.h:54
void md5_update(md5_context *ctx, const unsigned char *input, size_t ilen)
MD5 process buffer.
void md5_hmac_update(md5_context *ctx, const unsigned char *input, size_t ilen)
MD5 HMAC process buffer.
void md5(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD5( input buffer )