- Main Page
- Data Structures
- Files

# sha2.h

Go to the documentation of this file.

    00001
    00023 #ifndef POLARSSL_SHA2_H
    00024 #define POLARSSL_SHA2_H
    00025
    00029 typedef struct
    00030 {
    00031     unsigned long total[2];
    00032     unsigned long state[8];
    00033     unsigned char buffer[64];
    00035     unsigned char ipad[64];
    00036     unsigned char opad[64];
    00037     int is224;
    00038 }
    00039 sha2_context;
    00040
    00041 #ifdef __cplusplus
    00042 extern "C" {
    00043 #endif
    00044
    00051 void sha2_starts( sha2_context *ctx, int is224 );
    00052
    00060 void sha2_update( sha2_context *ctx, unsigned char *input, int ilen );
    00061
    00068 void sha2_finish( sha2_context *ctx, unsigned char output[32] );
    00069
    00078 void sha2( unsigned char *input, int ilen,
    00079            unsigned char output[32], int is224 );
    00080
    00091 int sha2_file( char *path, unsigned char output[32], int is224 );
    00092
    00101 void sha2_hmac_starts( sha2_context *ctx, unsigned char *key, int keylen,
    00102                        int is224 );
    00103
    00111 void sha2_hmac_update( sha2_context *ctx, unsigned char *input, int ilen );
    00112
    00119 void sha2_hmac_finish( sha2_context *ctx, unsigned char output[32] );
    00120
    00131 void sha2_hmac( unsigned char *key, int keylen,
    00132                 unsigned char *input, int ilen,
    00133                 unsigned char output[32], int is224 );
    00134
    00140 int sha2_self_test( int verbose );
    00141
    00142 #ifdef __cplusplus
    00143 }
    00144 #endif
    00145
    00146 #endif /* sha2.h */