PolarSSL v1.3.8
md4.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_MD4_H
28 #define POLARSSL_MD4_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_MD4_FILE_IO_ERROR -0x0072
47 #if !defined(POLARSSL_MD4_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 md4_init( md4_context *ctx );
75 
81 void md4_free( md4_context *ctx );
82 
88 void md4_starts( md4_context *ctx );
89 
97 void md4_update( md4_context *ctx, const unsigned char *input, size_t ilen );
98 
105 void md4_finish( md4_context *ctx, unsigned char output[16] );
106 
107 #ifdef __cplusplus
108 }
109 #endif
110 
111 #else /* POLARSSL_MD4_ALT */
112 #include "md4_alt.h"
113 #endif /* POLARSSL_MD4_ALT */
114 
115 #ifdef __cplusplus
116 extern "C" {
117 #endif
118 
126 void md4( const unsigned char *input, size_t ilen, unsigned char output[16] );
127 
136 int md4_file( const char *path, unsigned char output[16] );
137 
145 void md4_hmac_starts( md4_context *ctx, const unsigned char *key,
146  size_t keylen );
147 
155 void md4_hmac_update( md4_context *ctx, const unsigned char *input,
156  size_t ilen );
157 
164 void md4_hmac_finish( md4_context *ctx, unsigned char output[16] );
165 
171 void md4_hmac_reset( md4_context *ctx );
172 
182 void md4_hmac( const unsigned char *key, size_t keylen,
183  const unsigned char *input, size_t ilen,
184  unsigned char output[16] );
185 
191 int md4_self_test( int verbose );
192 
193 /* Internal use */
194 void md4_process( md4_context *ctx, const unsigned char data[64] );
195 
196 #ifdef __cplusplus
197 }
198 #endif
199 
200 #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_init(md4_context *ctx)
Initialize MD4 context.
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:58
void md4_free(md4_context *ctx)
Clear MD4 context.
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.