mymd5.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef _MD5_H_
  2. #define _MD5_H_
  3. /*
  4. ***********************************************************************
  5. ** md5.h -- header file for implementation of MD5 **
  6. ** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
  7. ** Created: 2/17/90 RLR **
  8. ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version **
  9. ** Revised (for MD5): RLR 4/27/91 **
  10. ***********************************************************************
  11. */
  12. /*
  13. ***********************************************************************
  14. ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **
  15. ** **
  16. ** License to copy and use this software is granted provided that **
  17. ** it is identified as the "RSA Data Security, Inc. MD5 Message- **
  18. ** Digest Algorithm" in all material mentioning or referencing this **
  19. ** software or this function. **
  20. ** **
  21. ** License is also granted to make and use derivative works **
  22. ** provided that such works are identified as "derived from the RSA **
  23. ** Data Security, Inc. MD5 Message-Digest Algorithm" in all **
  24. ** material mentioning or referencing the derived work. **
  25. ** **
  26. ** RSA Data Security, Inc. makes no representations concerning **
  27. ** either the merchantability of this software or the suitability **
  28. ** of this software for any particular purpose. It is provided "as **
  29. ** is" without express or implied warranty of any kind. **
  30. ** **
  31. ** These notices must be retained in any copies of any part of this **
  32. ** documentation and/or software. **
  33. ***********************************************************************
  34. */
  35. #define HAS_STDINT_H
  36. #ifdef HAS_STDINT_H
  37. #include <stdint.h>
  38. #elif defined(HAS_INTTYPES_H)
  39. #include <inttypes.h>
  40. #endif
  41. /* typedef a 32-bit type */
  42. typedef uint32_t UINT4;
  43. /* Data structure for MD5 (Message-Digest) computation */
  44. typedef struct
  45. {
  46. UINT4 i[2]; /* number of _bits_ handled mod 2^64 */
  47. UINT4 buf[4]; /* scratch buffer */
  48. unsigned char in[64]; /* input buffer */
  49. unsigned char digest[16]; /* actual digest after MD5Final call */
  50. } MD5_CTX;
  51. void MD5Init (MD5_CTX *mdContext);
  52. void MD5Update (MD5_CTX *, unsigned const char *, unsigned int);
  53. void MD5Final (MD5_CTX *);
  54. /*
  55. ***********************************************************************
  56. ** End of md5.h **
  57. ******************************** (cut) ********************************
  58. */
  59. #endif /* _MD5_H_ */