sha1.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // ---------------------------------------------------------------------------
  2. // Copyright (c) 2002, Dr Brian Gladman <brg@gladman.me.uk>, Worcester, UK.
  3. // All rights reserved.
  4. // LICENSE TERMS
  5. // The free distribution and use of this software in both source and binary
  6. // form is allowed (with or without changes) provided that:
  7. // 1. distributions of this source code include the above copyright
  8. // notice, this list of conditions and the following disclaimer;
  9. // 2. distributions in binary form include the above copyright
  10. // notice, this list of conditions and the following disclaimer
  11. // in the documentation and/or other associated materials;
  12. // 3. the copyright holder's name is not used to endorse products
  13. // built using this software without specific written permission.
  14. // ALTERNATIVELY, provided that this notice is retained in full, this product
  15. // may be distributed under the terms of the GNU General Public License (GPL),
  16. // in which case the provisions of the GPL apply INSTEAD OF those given above.
  17. // DISCLAIMER
  18. // This software is provided 'as is' with no explicit or implied warranties
  19. // in respect of its properties, including, but not limited to, correctness
  20. // and/or fitness for purpose.
  21. // ---------------------------------------------------------------------------
  22. // Issue Date: 24/01/2003
  23. // This file contains the definitions needed for SHA1
  24. // #ifndef _SHA1_H
  25. // #define _SHA1_H
  26. // #include "Types.h"
  27. // #include "coreTypes.h"
  28. // #define SHA1_BLOCK_SIZE 64
  29. // #define SHA1_DIGEST_SIZE 20
  30. // /* type to hold the SHA256 context */
  31. // #ifdef __GNUC__
  32. // #define PACK __attribute__ ((packed))
  33. // #else
  34. // #define PACK
  35. // #pragma pack( 1 )
  36. // #endif
  37. // typedef struct
  38. // {
  39. // uint32 count [2];
  40. // uint32 hash [5];
  41. // uint32 wbuf [16];
  42. // } PACK Sha1_Ctx_T;
  43. // void sha1_compile ( Sha1_Ctx_T* pctx);
  44. // void sha1_begin ( Sha1_Ctx_T* pctx);
  45. // void sha1_hash ( INT8U* pdata, INT16U len, Sha1_Ctx_T* pctx);
  46. // void sha1_end ( INT8U* phval, Sha1_Ctx_T* pctx);
  47. // void sha1 ( INT8U* phval, INT8U* pdata, INT16U len);
  48. // #undef PACK
  49. // #ifndef __GNUC__
  50. // #pragma pack()
  51. // #endif
  52. // #endif