PolarSSL v1.2.5
md2.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_MD2_H
28 #define POLARSSL_MD2_H
29 
30 #include <string.h>
31 
32 #define POLARSSL_ERR_MD2_FILE_IO_ERROR -0x0070
37 typedef struct
38 {
39  unsigned char cksum[16];
40  unsigned char state[48];
41  unsigned char buffer[16];
43  unsigned char ipad[16];
44  unsigned char opad[16];
45  size_t left;
46 }
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
58 void md2_starts( md2_context *ctx );
59 
67 void md2_update( md2_context *ctx, const unsigned char *input, size_t ilen );
68 
75 void md2_finish( md2_context *ctx, unsigned char output[16] );
76 
84 void md2( const unsigned char *input, size_t ilen, unsigned char output[16] );
85 
94 int md2_file( const char *path, unsigned char output[16] );
95 
103 void md2_hmac_starts( md2_context *ctx, const unsigned char *key, size_t keylen );
104 
112 void md2_hmac_update( md2_context *ctx, const unsigned char *input, size_t ilen );
113 
120 void md2_hmac_finish( md2_context *ctx, unsigned char output[16] );
121 
127 void md2_hmac_reset( md2_context *ctx );
128 
138 void md2_hmac( const unsigned char *key, size_t keylen,
139  const unsigned char *input, size_t ilen,
140  unsigned char output[16] );
141 
147 int md2_self_test( int verbose );
148 
149 #ifdef __cplusplus
150 }
151 #endif
152 
153 #endif /* md2.h */