PolarSSL v1.3.9
md5.h
Go to the documentation of this file.
1
27#ifndef POLARSSL_MD5_H
28#define POLARSSL_MD5_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_MD5_FILE_IO_ERROR -0x0074
47#if !defined(POLARSSL_MD5_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 md5_init( md5_context *ctx );
75
81void md5_free( md5_context *ctx );
82
89
97void md5_update( md5_context *ctx, const unsigned char *input, size_t ilen );
98
105void md5_finish( md5_context *ctx, unsigned char output[16] );
106
107/* Internal use */
108void md5_process( md5_context *ctx, const unsigned char data[64] );
109
110#ifdef __cplusplus
111}
112#endif
113
114#else /* POLARSSL_MD5_ALT */
115#include "md5_alt.h"
116#endif /* POLARSSL_MD5_ALT */
117
118#ifdef __cplusplus
119extern "C" {
120#endif
121
129void md5( const unsigned char *input, size_t ilen, unsigned char output[16] );
130
139int md5_file( const char *path, unsigned char output[16] );
140
149 const unsigned char *key, size_t keylen );
150
159 const unsigned char *input, size_t ilen );
160
167void md5_hmac_finish( md5_context *ctx, unsigned char output[16] );
168
175
185void md5_hmac( const unsigned char *key, size_t keylen,
186 const unsigned char *input, size_t ilen,
187 unsigned char output[16] );
188
194int md5_self_test( int verbose );
195
196#ifdef __cplusplus
197}
198#endif
199
200#endif /* md5.h */
Configuration options (set of defines)
void md5_hmac_finish(md5_context *ctx, unsigned char output[16])
MD5 HMAC final digest.
void md5_hmac(const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char output[16])
Output = HMAC-MD5( hmac key, input buffer )
void md5_process(md5_context *ctx, const unsigned char data[64])
void md5_free(md5_context *ctx)
Clear MD5 context.
int md5_self_test(int verbose)
Checkup routine.
void md5_init(md5_context *ctx)
Initialize MD5 context.
void md5_update(md5_context *ctx, const unsigned char *input, size_t ilen)
MD5 process buffer.
void md5_finish(md5_context *ctx, unsigned char output[16])
MD5 final digest.
void md5(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD5( input buffer )
void md5_hmac_update(md5_context *ctx, const unsigned char *input, size_t ilen)
MD5 HMAC process buffer.
void md5_starts(md5_context *ctx)
MD5 context setup.
int md5_file(const char *path, unsigned char output[16])
Output = MD5( file contents )
void md5_hmac_starts(md5_context *ctx, const unsigned char *key, size_t keylen)
MD5 HMAC context setup.
void md5_hmac_reset(md5_context *ctx)
MD5 HMAC context reset.
MD5 context structure.
Definition md5.h:59