PolarSSL v1.2.9
md4.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_MD4_H
28 #define POLARSSL_MD4_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_MD4_FILE_IO_ERROR -0x0072
43 #if !defined(POLARSSL_MD4_ALT)
44 // Regular implementation
45 //
46 
50 typedef struct
51 {
52  uint32_t total[2];
53  uint32_t state[4];
54  unsigned char buffer[64];
56  unsigned char ipad[64];
57  unsigned char opad[64];
58 }
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
70 void md4_starts( md4_context *ctx );
71 
79 void md4_update( md4_context *ctx, const unsigned char *input, size_t ilen );
80 
87 void md4_finish( md4_context *ctx, unsigned char output[16] );
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #else /* POLARSSL_MD4_ALT */
94 #include "md4_alt.h"
95 #endif /* POLARSSL_MD4_ALT */
96 
97 #ifdef __cplusplus
98 extern "C" {
99 #endif
100 
108 void md4( const unsigned char *input, size_t ilen, unsigned char output[16] );
109 
118 int md4_file( const char *path, unsigned char output[16] );
119 
127 void md4_hmac_starts( md4_context *ctx, const unsigned char *key, size_t keylen );
128 
136 void md4_hmac_update( md4_context *ctx, const unsigned char *input, size_t ilen );
137 
144 void md4_hmac_finish( md4_context *ctx, unsigned char output[16] );
145 
151 void md4_hmac_reset( md4_context *ctx );
152 
162 void md4_hmac( const unsigned char *key, size_t keylen,
163  const unsigned char *input, size_t ilen,
164  unsigned char output[16] );
165 
171 int md4_self_test( int verbose );
172 
173 #ifdef __cplusplus
174 }
175 #endif
176 
177 #endif /* md4.h */
void md4_finish(md4_context *ctx, unsigned char output[16])
MD4 final digest.
int md4_self_test(int verbose)
Checkup routine.
void md4_hmac(const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char output[16])
Output = HMAC-MD4( hmac key, input buffer )
void md4_starts(md4_context *ctx)
MD4 context setup.
Configuration options (set of defines)
void md4(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD4( input buffer )
void md4_update(md4_context *ctx, const unsigned char *input, size_t ilen)
MD4 process buffer.
void md4_hmac_starts(md4_context *ctx, const unsigned char *key, size_t keylen)
MD4 HMAC context setup.
void md4_hmac_finish(md4_context *ctx, unsigned char output[16])
MD4 HMAC final digest.
MD4 context structure.
Definition: md4.h:50
int md4_file(const char *path, unsigned char output[16])
Output = MD4( file contents )
void md4_hmac_reset(md4_context *ctx)
MD4 HMAC context reset.
void md4_hmac_update(md4_context *ctx, const unsigned char *input, size_t ilen)
MD4 HMAC process buffer.