123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- #ifndef POLARSSL_SHA1_H
- #define POLARSSL_SHA1_H
- #include <string.h>
- typedef struct
- {
- unsigned long total[2];
- unsigned long state[5];
- unsigned char buffer[64];
- unsigned char ipad[64];
- unsigned char opad[64];
- }
- sha1_context;
- #ifdef __cplusplus
- extern "C" {
- #endif
- void sha1_starts( sha1_context *ctx );
- void sha1_update( sha1_context *ctx, const unsigned char *input, size_t ilen );
- void sha1_finish( sha1_context *ctx, unsigned char output[20] );
- void sha1( const unsigned char *input, size_t ilen, unsigned char output[20] );
- int sha1_file( const char *path, unsigned char output[20] );
- void sha1_hmac_starts( sha1_context *ctx, const unsigned char *key, size_t keylen );
- void sha1_hmac_update( sha1_context *ctx, const unsigned char *input, size_t ilen );
- void sha1_hmac_finish( sha1_context *ctx, unsigned char output[20] );
- void sha1_hmac_reset( sha1_context *ctx );
- void sha1_hmac( const unsigned char *key, size_t keylen,
- const unsigned char *input, size_t ilen,
- unsigned char output[20] );
- int sha1_self_test( int verbose );
- #ifdef __cplusplus
- }
- #endif
- #endif
|