#ifndef __SHA1_H__ #define __SHA1_H__ #ifndef LITTLE_ENDIAN #define LITTLE_ENDIAN #endif #ifdef __cplusplus extern "C" { #endif #define SHA1_LEN 20 typedef struct sha1_ctx { unsigned long state[5]; unsigned long count[2]; unsigned char buffer[64]; } sha1_ctx_t; void sha1_init(sha1_ctx_t* context); void sha1_update(sha1_ctx_t* context, const void* data, unsigned int len); void sha1_final(unsigned char digest[SHA1_LEN], sha1_ctx_t* context); #ifdef __cplusplus } #endif #endif // __SHA1_H__