PolarSSL
polarssl/sha2.h
Go to the documentation of this file.
00001 
00025 #ifndef POLARSSL_SHA2_H
00026 #define POLARSSL_SHA2_H
00027 
00031 typedef struct
00032 {
00033     unsigned long total[2];     
00034     unsigned long state[8];     
00035     unsigned char buffer[64];   
00037     unsigned char ipad[64];     
00038     unsigned char opad[64];     
00039     int is224;                  
00040 }
00041 sha2_context;
00042 
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046 
00053 void sha2_starts( sha2_context *ctx, int is224 );
00054 
00062 void sha2_update( sha2_context *ctx, const unsigned char *input, int ilen );
00063 
00070 void sha2_finish( sha2_context *ctx, unsigned char output[32] );
00071 
00080 void sha2( const unsigned char *input, int ilen,
00081            unsigned char output[32], int is224 );
00082 
00093 int sha2_file( const char *path, unsigned char output[32], int is224 );
00094 
00103 void sha2_hmac_starts( sha2_context *ctx, const unsigned char *key, int keylen,
00104                        int is224 );
00105 
00113 void sha2_hmac_update( sha2_context *ctx, const unsigned char *input, int ilen );
00114 
00121 void sha2_hmac_finish( sha2_context *ctx, unsigned char output[32] );
00122 
00128 void sha2_hmac_reset( sha2_context *ctx );
00129 
00140 void sha2_hmac( const unsigned char *key, int keylen,
00141                 const unsigned char *input, int ilen,
00142                 unsigned char output[32], int is224 );
00143 
00149 int sha2_self_test( int verbose );
00150 
00151 #ifdef __cplusplus
00152 }
00153 #endif
00154 
00155 #endif /* sha2.h */
 All Classes Files Functions Variables Defines