PolarSSL v1.3.1
md2.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_MD2_H
28 #define POLARSSL_MD2_H
29 
30 #include "config.h"
31 
32 #include <string.h>
33 
34 #define POLARSSL_ERR_MD2_FILE_IO_ERROR -0x0070
36 #if !defined(POLARSSL_MD2_ALT)
37 // Regular implementation
38 //
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
47 typedef struct
48 {
49  unsigned char cksum[16];
50  unsigned char state[48];
51  unsigned char buffer[16];
53  unsigned char ipad[16];
54  unsigned char opad[16];
55  size_t left;
56 }
58 
64 void md2_starts( md2_context *ctx );
65 
73 void md2_update( md2_context *ctx, const unsigned char *input, size_t ilen );
74 
81 void md2_finish( md2_context *ctx, unsigned char output[16] );
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #else /* POLARSSL_MD2_ALT */
88 #include "md2_alt.h"
89 #endif /* POLARSSL_MD2_ALT */
90 
91 #ifdef __cplusplus
92 extern "C" {
93 #endif
94 
102 void md2( const unsigned char *input, size_t ilen, unsigned char output[16] );
103 
112 int md2_file( const char *path, unsigned char output[16] );
113 
121 void md2_hmac_starts( md2_context *ctx, const unsigned char *key, size_t keylen );
122 
130 void md2_hmac_update( md2_context *ctx, const unsigned char *input, size_t ilen );
131 
138 void md2_hmac_finish( md2_context *ctx, unsigned char output[16] );
139 
145 void md2_hmac_reset( md2_context *ctx );
146 
156 void md2_hmac( const unsigned char *key, size_t keylen,
157  const unsigned char *input, size_t ilen,
158  unsigned char output[16] );
159 
165 int md2_self_test( int verbose );
166 
167 /* Internal use */
168 void md2_process( md2_context *ctx );
169 
170 #ifdef __cplusplus
171 }
172 #endif
173 
174 #endif /* md2.h */