00001
00027 #ifndef POLARSSL_MD4_H
00028 #define POLARSSL_MD4_H
00029
00030 #include "config.h"
00031
00032 #include <string.h>
00033
00034 #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
00035 #include <basetsd.h>
00036 typedef UINT32 uint32_t;
00037 #else
00038 #include <inttypes.h>
00039 #endif
00040
00041 #define POLARSSL_ERR_MD4_FILE_IO_ERROR -0x0072
00043 #if !defined(POLARSSL_MD4_ALT)
00044
00045
00046
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif
00050
00054 typedef struct
00055 {
00056 uint32_t total[2];
00057 uint32_t state[4];
00058 unsigned char buffer[64];
00060 unsigned char ipad[64];
00061 unsigned char opad[64];
00062 }
00063 md4_context;
00064
00070 void md4_starts( md4_context *ctx );
00071
00079 void md4_update( md4_context *ctx, const unsigned char *input, size_t ilen );
00080
00087 void md4_finish( md4_context *ctx, unsigned char output[16] );
00088
00089 #ifdef __cplusplus
00090 }
00091 #endif
00092
00093 #else
00094 #include "md4_alt.h"
00095 #endif
00096
00097 #ifdef __cplusplus
00098 extern "C" {
00099 #endif
00100
00108 void md4( const unsigned char *input, size_t ilen, unsigned char output[16] );
00109
00118 int md4_file( const char *path, unsigned char output[16] );
00119
00127 void md4_hmac_starts( md4_context *ctx, const unsigned char *key, size_t keylen );
00128
00136 void md4_hmac_update( md4_context *ctx, const unsigned char *input, size_t ilen );
00137
00144 void md4_hmac_finish( md4_context *ctx, unsigned char output[16] );
00145
00151 void md4_hmac_reset( md4_context *ctx );
00152
00162 void md4_hmac( const unsigned char *key, size_t keylen,
00163 const unsigned char *input, size_t ilen,
00164 unsigned char output[16] );
00165
00171 int md4_self_test( int verbose );
00172
00173
00174 void md4_process( md4_context *ctx, const unsigned char data[64] );
00175
00176 #ifdef __cplusplus
00177 }
00178 #endif
00179
00180 #endif