/* sha1.h */1#ifndef SHA1_H2#define SHA1_H3#include "ustd.h"45#ifdef __cplusplus6extern "C" {7#endif89#define sha1_block_size 6410#define sha1_hash_size 201112/* algorithm context */13typedef struct sha1_ctx14{15unsigned char message[sha1_block_size]; /* 512-bit buffer for leftovers */16uint64_t length; /* number of processed bytes */17unsigned hash[5]; /* 160-bit algorithm internal hashing state */18} sha1_ctx;1920/* hash functions */2122void rhash_sha1_init(sha1_ctx* ctx);23void rhash_sha1_update(sha1_ctx* ctx, const unsigned char* msg, size_t size);24void rhash_sha1_final(sha1_ctx* ctx, unsigned char* result);2526#ifdef __cplusplus27} /* extern "C" */28#endif /* __cplusplus */2930#endif /* SHA1_H */313233