PolarSSL v1.3.2
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 #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
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 
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 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 /* Internal use */
174 void md4_process( md4_context *ctx, const unsigned char data[64] );
175 
176 #ifdef __cplusplus
177 }
178 #endif
179 
180 #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_process(md4_context *ctx, const unsigned char data[64])
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:54
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.