sha1.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * sha1.h
  3. *
  4. * Copyright (C) 1998, 2009
  5. * Paul E. Jones <paulej@packetizer.com>
  6. * All Rights Reserved
  7. *
  8. *****************************************************************************
  9. * $Id: sha1.h 12 2009-06-22 19:34:25Z paulej $
  10. *****************************************************************************
  11. *
  12. * Description:
  13. * This class implements the Secure Hashing Standard as defined
  14. * in FIPS PUB 180-1 published April 17, 1995.
  15. *
  16. * Many of the variable names in the SHA1Context, especially the
  17. * single character names, were used because those were the names
  18. * used in the publication.
  19. *
  20. * Please read the file sha1.c for more information.
  21. *
  22. */
  23. #ifndef _SHA1_H_
  24. #define _SHA1_H_
  25. /*
  26. * This structure will hold context information for the hashing
  27. * operation
  28. */
  29. typedef struct SHA1Context
  30. {
  31. unsigned Message_Digest[5]; /* Message Digest (output) */
  32. unsigned Length_Low; /* Message length in bits */
  33. unsigned Length_High; /* Message length in bits */
  34. unsigned char Message_Block[64]; /* 512-bit message blocks */
  35. int Message_Block_Index; /* Index into message block array */
  36. int Computed; /* Is the digest computed? */
  37. int Corrupted; /* Is the message digest corruped? */
  38. } SHA1Context;
  39. /*
  40. * Function Prototypes
  41. */
  42. void SHA1Reset(SHA1Context *);
  43. int SHA1Result(SHA1Context *);
  44. void SHA1Input( SHA1Context *,
  45. const unsigned char *,
  46. unsigned);
  47. #endif