PolarSSL

polarssl/sha1.h

Go to the documentation of this file.
00001 
00025 #ifndef POLARSSL_SHA1_H
00026 #define POLARSSL_SHA1_H
00027 
00031 typedef struct
00032 {
00033     unsigned long total[2];     
00034     unsigned long state[5];     
00035     unsigned char buffer[64];   
00037     unsigned char ipad[64];     
00038     unsigned char opad[64];     
00039 }
00040 sha1_context;
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00051 void sha1_starts( sha1_context *ctx );
00052 
00060 void sha1_update( sha1_context *ctx, const unsigned char *input, int ilen );
00061 
00068 void sha1_finish( sha1_context *ctx, unsigned char output[20] );
00069 
00077 void sha1( const unsigned char *input, int ilen, unsigned char output[20] );
00078 
00088 int sha1_file( const char *path, unsigned char output[20] );
00089 
00097 void sha1_hmac_starts( sha1_context *ctx, const unsigned char *key, int keylen );
00098 
00106 void sha1_hmac_update( sha1_context *ctx, const unsigned char *input, int ilen );
00107 
00114 void sha1_hmac_finish( sha1_context *ctx, unsigned char output[20] );
00115 
00121 void sha1_hmac_reset( sha1_context *ctx );
00122 
00132 void sha1_hmac( const unsigned char *key, int keylen,
00133                 const unsigned char *input, int ilen,
00134                 unsigned char output[20] );
00135 
00141 int sha1_self_test( int verbose );
00142 
00143 #ifdef __cplusplus
00144 }
00145 #endif
00146 
00147 #endif /* sha1.h */
 All Classes Files Functions Variables Defines