PolarSSL v1.3.7
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_starts( md4_context *ctx );
75 
83 void md4_update( md4_context *ctx, const unsigned char *input, size_t ilen );
84 
91 void md4_finish( md4_context *ctx, unsigned char output[16] );
92 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #else /* POLARSSL_MD4_ALT */
98 #include "md4_alt.h"
99 #endif /* POLARSSL_MD4_ALT */
100 
101 #ifdef __cplusplus
102 extern "C" {
103 #endif
104 
112 void md4( const unsigned char *input, size_t ilen, unsigned char output[16] );
113 
122 int md4_file( const char *path, unsigned char output[16] );
123 
131 void md4_hmac_starts( md4_context *ctx, const unsigned char *key,
132  size_t keylen );
133 
141 void md4_hmac_update( md4_context *ctx, const unsigned char *input,
142  size_t ilen );
143 
150 void md4_hmac_finish( md4_context *ctx, unsigned char output[16] );
151 
157 void md4_hmac_reset( md4_context *ctx );
158 
168 void md4_hmac( const unsigned char *key, size_t keylen,
169  const unsigned char *input, size_t ilen,
170  unsigned char output[16] );
171 
177 int md4_self_test( int verbose );
178 
179 /* Internal use */
180 void md4_process( md4_context *ctx, const unsigned char data[64] );
181 
182 #ifdef __cplusplus
183 }
184 #endif
185 
186 #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:58
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.