- Main Page
- Data Structures
- Files

# sha4.h

Go to the documentation of this file.

    00001
    00023 #ifndef POLARSSL_SHA4_H
    00024 #define POLARSSL_SHA4_H
    00025
    00026 #if defined(_MSC_VER) || defined(__WATCOMC__)
    00027   #define UL64(x) x##ui64
    00028   #define int64 __int64
    00029 #else
    00030   #define UL64(x) x##ULL
    00031   #define int64 long long
    00032 #endif
    00033
    00037 typedef struct
    00038 {
    00039     unsigned int64 total[2];
    00040     unsigned int64 state[8];
    00041     unsigned char buffer[128];
    00043     unsigned char ipad[128];
    00044     unsigned char opad[128];
    00045     int is384;
    00046 }
    00047 sha4_context;
    00048
    00049 #ifdef __cplusplus
    00050 extern "C" {
    00051 #endif
    00052
    00059 void sha4_starts( sha4_context *ctx, int is384 );
    00060
    00068 void sha4_update( sha4_context *ctx, unsigned char *input, int ilen );
    00069
    00076 void sha4_finish( sha4_context *ctx, unsigned char output[64] );
    00077
    00086 void sha4( unsigned char *input, int ilen,
    00087            unsigned char output[64], int is384 );
    00088
    00099 int sha4_file( char *path, unsigned char output[64], int is384 );
    00100
    00109 void sha4_hmac_starts( sha4_context *ctx, unsigned char *key, int keylen,
    00110                        int is384 );
    00111
    00119 void sha4_hmac_update( sha4_context *ctx, unsigned char *input, int ilen );
    00120
    00127 void sha4_hmac_finish( sha4_context *ctx, unsigned char output[64] );
    00128
    00139 void sha4_hmac( unsigned char *key, int keylen,
    00140                 unsigned char *input, int ilen,
    00141                 unsigned char output[64], int is384 );
    00142
    00148 int sha4_self_test( int verbose );
    00149
    00150 #ifdef __cplusplus
    00151 }
    00152 #endif
    00153
    00154 #endif /* sha4.h */