mbed TLS v1.3.16
md4.h
Go to the documentation of this file.
1 
24 #ifndef POLARSSL_MD4_H
25 #define POLARSSL_MD4_H
26 
27 #if !defined(POLARSSL_CONFIG_FILE)
28 #include "config.h"
29 #else
30 #include POLARSSL_CONFIG_FILE
31 #endif
32 
33 #include <stddef.h>
34 
35 #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
36 #include <basetsd.h>
37 typedef UINT32 uint32_t;
38 #else
39 #include <inttypes.h>
40 #endif
41 
42 #define POLARSSL_ERR_MD4_FILE_IO_ERROR -0x0072
44 #if !defined(POLARSSL_MD4_ALT)
45 // Regular implementation
46 //
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
55 typedef struct
56 {
57  uint32_t total[2];
58  uint32_t state[4];
59  unsigned char buffer[64];
61  unsigned char ipad[64];
62  unsigned char opad[64];
63 }
65 
71 void md4_init( md4_context *ctx );
72 
78 void md4_free( md4_context *ctx );
79 
85 void md4_starts( md4_context *ctx );
86 
94 void md4_update( md4_context *ctx, const unsigned char *input, size_t ilen );
95 
102 void md4_finish( md4_context *ctx, unsigned char output[16] );
103 
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 #else /* POLARSSL_MD4_ALT */
109 #include "md4_alt.h"
110 #endif /* POLARSSL_MD4_ALT */
111 
112 #ifdef __cplusplus
113 extern "C" {
114 #endif
115 
123 void md4( const unsigned char *input, size_t ilen, unsigned char output[16] );
124 
133 int md4_file( const char *path, unsigned char output[16] );
134 
142 void md4_hmac_starts( md4_context *ctx, const unsigned char *key,
143  size_t keylen );
144 
152 void md4_hmac_update( md4_context *ctx, const unsigned char *input,
153  size_t ilen );
154 
161 void md4_hmac_finish( md4_context *ctx, unsigned char output[16] );
162 
168 void md4_hmac_reset( md4_context *ctx );
169 
179 void md4_hmac( const unsigned char *key, size_t keylen,
180  const unsigned char *input, size_t ilen,
181  unsigned char output[16] );
182 
188 int md4_self_test( int verbose );
189 
190 /* Internal use */
191 void md4_process( md4_context *ctx, const unsigned char data[64] );
192 
193 #ifdef __cplusplus
194 }
195 #endif
196 
197 #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:55
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.