Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
3.1 KiB

  1. /*
  2. ***********************************************************************
  3. ** md5.h -- Header file for implementation of MD5 **
  4. ** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
  5. ** Created: 2/17/90 RLR **
  6. ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version **
  7. ** Revised (for MD5): RLR 4/27/91 **
  8. ** -- G modified to have y&~z instead of y&z **
  9. ** -- FF, GG, HH modified to add in last register done **
  10. ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 **
  11. ** -- distinct additive constant for each step **
  12. ** -- round 4 added, working mod 7 **
  13. ***********************************************************************
  14. */
  15. /*
  16. ***********************************************************************
  17. ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **
  18. ** **
  19. ** License to copy and use this software is granted provided that **
  20. ** it is identified as the "RSA Data Security, Inc. MD5 Message- **
  21. ** Digest Algorithm" in all material mentioning or referencing this **
  22. ** software or this function. **
  23. ** **
  24. ** License is also granted to make and use derivative works **
  25. ** provided that such works are identified as "derived from the RSA **
  26. ** Data Security, Inc. MD5 Message-Digest Algorithm" in all **
  27. ** material mentioning or referencing the derived work. **
  28. ** **
  29. ** RSA Data Security, Inc. makes no representations concerning **
  30. ** either the merchantability of this software or the suitability **
  31. ** of this software for any particular purpose. It is provided "as **
  32. ** is" without express or implied warranty of any kind. **
  33. ** **
  34. ** These notices must be retained in any copies of any part of this **
  35. ** documentation and/or software. **
  36. ***********************************************************************
  37. */
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. /* Data structure for MD5 (Message-Digest) computation */
  42. typedef struct {
  43. ULONG i[2]; /* number of _bits_ handled mod 2^64 */
  44. ULONG buf[4]; /* scratch buffer */
  45. unsigned char in[64]; /* input buffer */
  46. unsigned char digest[16]; /* actual digest after MD5Final call */
  47. ULONG FinishFlag;
  48. } MD5_CTX;
  49. #define MD5DIGESTLEN 16
  50. #define PROTO_LIST(list) list
  51. /*
  52. * MTS: Each of these assumes MD5_CTX is locked against simultaneous use.
  53. */
  54. void MD5Init PROTO_LIST ((MD5_CTX *));
  55. void MD5Update PROTO_LIST ((MD5_CTX *, const unsigned char *, unsigned int));
  56. void MD5Final PROTO_LIST ((MD5_CTX *));
  57. #ifdef __cplusplus
  58. }
  59. #endif