sha1.h 572 B

12345678910111213141516171819202122232425262728
  1. /* public api for steve reid's public domain SHA-1 implementation */
  2. /* this file is in the public domain */
  3. #ifndef __SHA1_H
  4. #define __SHA1_H
  5. #ifdef __cplusplus
  6. extern "C"
  7. {
  8. #endif
  9. typedef struct {
  10. uint32_t state[5];
  11. uint32_t count[2];
  12. uint8_t buffer[64];
  13. } SHA1_CTX;
  14. #define SHA1_DIGEST_SIZE 20
  15. void SHA1_Init(SHA1_CTX *context);
  16. void SHA1_Update(SHA1_CTX *context, const uint8_t *data, const size_t len);
  17. void SHA1_Final(SHA1_CTX *context, uint8_t digest[SHA1_DIGEST_SIZE]);
  18. #ifdef __cplusplus
  19. }
  20. #endif
  21. #endif /* __SHA1_H */