sha1.h 653 B

123456789101112131415161718192021222324252627
  1. /* $OpenBSD: sha1.h,v 1.1 2012/10/09 12:36:50 jsing Exp $ */
  2. /*
  3. * SHA-1 in C
  4. * By Steve Reid <steve@edmweb.com>
  5. * 100% Public Domain
  6. */
  7. #ifndef _SHA1_H_
  8. #define _SHA1_H_
  9. #define SHA1_BLOCK_LENGTH 64
  10. #define SHA1_DIGEST_LENGTH 20
  11. typedef struct {
  12. u_int32_t state[5];
  13. u_int64_t count;
  14. unsigned char buffer[SHA1_BLOCK_LENGTH];
  15. } SHA1_CTX;
  16. void SHA1Init(SHA1_CTX * context);
  17. void SHA1Transform(u_int32_t state[5], const unsigned char buffer[SHA1_BLOCK_LENGTH]);
  18. void SHA1Update(SHA1_CTX *context, const unsigned char *data, unsigned int len);
  19. void SHA1Final(unsigned char digest[SHA1_DIGEST_LENGTH], SHA1_CTX *context);
  20. #endif /* _SHA1_H_ */