PolarSSL v1.3.8
ripemd160.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_RIPEMD160_H
28 #define POLARSSL_RIPEMD160_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>
40 typedef UINT32 uint32_t;
41 #else
42 #include <inttypes.h>
43 #endif
44 
45 #define POLARSSL_ERR_RIPEMD160_FILE_IO_ERROR -0x007E
47 #if !defined(POLARSSL_RIPEMD160_ALT)
48 // Regular implementation
49 //
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
58 typedef struct
59 {
60  uint32_t total[2];
61  uint32_t state[5];
62  unsigned char buffer[64];
64  unsigned char ipad[64];
65  unsigned char opad[64];
66 }
68 
75 
82 
89 
98  const unsigned char *input, size_t ilen );
99 
106 void ripemd160_finish( ripemd160_context *ctx, unsigned char output[20] );
107 
108 /* Internal use */
109 void ripemd160_process( ripemd160_context *ctx, const unsigned char data[64] );
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #else /* POLARSSL_RIPEMD160_ALT */
116 #include "ripemd160.h"
117 #endif /* POLARSSL_RIPEMD160_ALT */
118 
119 #ifdef __cplusplus
120 extern "C" {
121 #endif
122 
130 void ripemd160( const unsigned char *input, size_t ilen,
131  unsigned char output[20] );
132 
133 #if defined(POLARSSL_FS_IO)
134 
142 int ripemd160_file( const char *path, unsigned char output[20] );
143 #endif /* POLARSSL_FS_IO */
144 
153  const unsigned char *key, size_t keylen );
154 
163  const unsigned char *input, size_t ilen );
164 
171 void ripemd160_hmac_finish( ripemd160_context *ctx, unsigned char output[20] );
172 
179 
189 void ripemd160_hmac( const unsigned char *key, size_t keylen,
190  const unsigned char *input, size_t ilen,
191  unsigned char output[20] );
192 
198 int ripemd160_self_test( int verbose );
199 
200 #ifdef __cplusplus
201 }
202 #endif
203 
204 #endif /* ripemd160.h */