PolarSSL v1.3.9
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>
40typedef 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
52extern "C" {
53#endif
54
58typedef 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
74void md4_init( md4_context *ctx );
75
81void md4_free( md4_context *ctx );
82
89
97void md4_update( md4_context *ctx, const unsigned char *input, size_t ilen );
98
105void 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
116extern "C" {
117#endif
118
126void md4( const unsigned char *input, size_t ilen, unsigned char output[16] );
127
136int md4_file( const char *path, unsigned char output[16] );
137
145void md4_hmac_starts( md4_context *ctx, const unsigned char *key,
146 size_t keylen );
147
155void md4_hmac_update( md4_context *ctx, const unsigned char *input,
156 size_t ilen );
157
164void md4_hmac_finish( md4_context *ctx, unsigned char output[16] );
165
172
182void md4_hmac( const unsigned char *key, size_t keylen,
183 const unsigned char *input, size_t ilen,
184 unsigned char output[16] );
185
191int md4_self_test( int verbose );
192
193/* Internal use */
194void md4_process( md4_context *ctx, const unsigned char data[64] );
195
196#ifdef __cplusplus
197}
198#endif
199
200#endif /* md4.h */
Configuration options (set of defines)
void md4_free(md4_context *ctx)
Clear MD4 context.
void md4_starts(md4_context *ctx)
MD4 context setup.
void md4_init(md4_context *ctx)
Initialize MD4 context.
void md4_process(md4_context *ctx, const unsigned char data[64])
void md4_hmac_reset(md4_context *ctx)
MD4 HMAC context reset.
void md4_update(md4_context *ctx, const unsigned char *input, size_t ilen)
MD4 process buffer.
int md4_file(const char *path, unsigned char output[16])
Output = MD4( file contents )
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 )
int md4_self_test(int verbose)
Checkup routine.
void md4_hmac_starts(md4_context *ctx, const unsigned char *key, size_t keylen)
MD4 HMAC context setup.
void md4_finish(md4_context *ctx, unsigned char output[16])
MD4 final digest.
void md4_hmac_update(md4_context *ctx, const unsigned char *input, size_t ilen)
MD4 HMAC process buffer.
void md4_hmac_finish(md4_context *ctx, unsigned char output[16])
MD4 HMAC final digest.
void md4(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD4( input buffer )
MD4 context structure.
Definition md4.h:59