PolarSSL

polarssl/sha4.h

Go to the documentation of this file.
00001 
00025 #ifndef POLARSSL_SHA4_H
00026 #define POLARSSL_SHA4_H
00027 
00028 #if defined(_MSC_VER) || defined(__WATCOMC__)
00029   #define UL64(x) x##ui64
00030   #define int64 __int64
00031 #else
00032   #define UL64(x) x##ULL
00033   #define int64 long long
00034 #endif
00035 
00039 typedef struct
00040 {
00041     unsigned int64 total[2];    
00042     unsigned int64 state[8];    
00043     unsigned char buffer[128];  
00045     unsigned char ipad[128];    
00046     unsigned char opad[128];    
00047     int is384;                  
00048 }
00049 sha4_context;
00050 
00051 #ifdef __cplusplus
00052 extern "C" {
00053 #endif
00054 
00061 void sha4_starts( sha4_context *ctx, int is384 );
00062 
00070 void sha4_update( sha4_context *ctx, const unsigned char *input, int ilen );
00071 
00078 void sha4_finish( sha4_context *ctx, unsigned char output[64] );
00079 
00088 void sha4( const unsigned char *input, int ilen,
00089            unsigned char output[64], int is384 );
00090 
00101 int sha4_file( const char *path, unsigned char output[64], int is384 );
00102 
00111 void sha4_hmac_starts( sha4_context *ctx, const unsigned char *key, int keylen,
00112                        int is384 );
00113 
00121 void sha4_hmac_update( sha4_context *ctx, const unsigned char *input, int ilen );
00122 
00129 void sha4_hmac_finish( sha4_context *ctx, unsigned char output[64] );
00130 
00136 void sha4_hmac_reset( sha4_context *ctx );
00137 
00148 void sha4_hmac( const unsigned char *key, int keylen,
00149                 const unsigned char *input, int ilen,
00150                 unsigned char output[64], int is384 );
00151 
00157 int sha4_self_test( int verbose );
00158 
00159 #ifdef __cplusplus
00160 }
00161 #endif
00162 
00163 #endif /* sha4.h */
 All Classes Files Functions Variables Defines