PolarSSL v1.1.4
sha1.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_SHA1_H
28 #define POLARSSL_SHA1_H
29 
30 #include <string.h>
31 
32 #define POLARSSL_ERR_SHA1_FILE_IO_ERROR -0x0076
37 typedef struct
38 {
39  unsigned long total[2];
40  unsigned long state[5];
41  unsigned char buffer[64];
43  unsigned char ipad[64];
44  unsigned char opad[64];
45 }
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
57 void sha1_starts( sha1_context *ctx );
58 
66 void sha1_update( sha1_context *ctx, const unsigned char *input, size_t ilen );
67 
74 void sha1_finish( sha1_context *ctx, unsigned char output[20] );
75 
83 void sha1( const unsigned char *input, size_t ilen, unsigned char output[20] );
84 
93 int sha1_file( const char *path, unsigned char output[20] );
94 
102 void sha1_hmac_starts( sha1_context *ctx, const unsigned char *key, size_t keylen );
103 
111 void sha1_hmac_update( sha1_context *ctx, const unsigned char *input, size_t ilen );
112 
119 void sha1_hmac_finish( sha1_context *ctx, unsigned char output[20] );
120 
126 void sha1_hmac_reset( sha1_context *ctx );
127 
137 void sha1_hmac( const unsigned char *key, size_t keylen,
138  const unsigned char *input, size_t ilen,
139  unsigned char output[20] );
140 
146 int sha1_self_test( int verbose );
147 
148 #ifdef __cplusplus
149 }
150 #endif
151 
152 #endif /* sha1.h */