PolarSSL v1.3.7
md5.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_MD5_H
28 #define POLARSSL_MD5_H
29 
30 #if !defined(POLARSSL_CONFIG_FILE)
31 #include "config.h"
32 #else
33 #include POLARSSL_CONFIG_FILE
34 #endif
35 
36 #include <string.h>
37 
38 #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
39 #include <basetsd.h>
40 typedef UINT32 uint32_t;
41 #else
42 #include <inttypes.h>
43 #endif
44 
45 #define POLARSSL_ERR_MD5_FILE_IO_ERROR -0x0074
47 #if !defined(POLARSSL_MD5_ALT)
48 // Regular implementation
49 //
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
58 typedef struct
59 {
60  uint32_t total[2];
61  uint32_t state[4];
62  unsigned char buffer[64];
64  unsigned char ipad[64];
65  unsigned char opad[64];
66 }
68 
74 void md5_starts( md5_context *ctx );
75 
83 void md5_update( md5_context *ctx, const unsigned char *input, size_t ilen );
84 
91 void md5_finish( md5_context *ctx, unsigned char output[16] );
92 
93 /* Internal use */
94 void md5_process( md5_context *ctx, const unsigned char data[64] );
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #else /* POLARSSL_MD5_ALT */
101 #include "md5_alt.h"
102 #endif /* POLARSSL_MD5_ALT */
103 
104 #ifdef __cplusplus
105 extern "C" {
106 #endif
107 
115 void md5( const unsigned char *input, size_t ilen, unsigned char output[16] );
116 
125 int md5_file( const char *path, unsigned char output[16] );
126 
134 void md5_hmac_starts( md5_context *ctx,
135  const unsigned char *key, size_t keylen );
136 
144 void md5_hmac_update( md5_context *ctx,
145  const unsigned char *input, size_t ilen );
146 
153 void md5_hmac_finish( md5_context *ctx, unsigned char output[16] );
154 
160 void md5_hmac_reset( md5_context *ctx );
161 
171 void md5_hmac( const unsigned char *key, size_t keylen,
172  const unsigned char *input, size_t ilen,
173  unsigned char output[16] );
174 
180 int md5_self_test( int verbose );
181 
182 #ifdef __cplusplus
183 }
184 #endif
185 
186 #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:58
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 )