暫無描述

123456789101112131415161718192021222324
  1. #ifndef SHA1_H
  2. #define SHA1_H
  3. /*
  4. SHA-1 in C
  5. By Steve Reid <steve@edmweb.com>
  6. 100% Public Domain
  7. */
  8. #include <stdint.h>
  9. typedef struct {
  10. uint32_t state[5];
  11. uint32_t count[2];
  12. unsigned char buffer[64];
  13. } SHA1_CTX;
  14. void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]);
  15. void SHA1Init(SHA1_CTX *context);
  16. void SHA1Update(SHA1_CTX *context, const unsigned char *data, uint32_t len);
  17. void SHA1Final(unsigned char digest[20], SHA1_CTX *context);
  18. void SHA1(char *hash_out, const char *str, uint32_t len);
  19. #endif /* SHA1_H */