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.

78 lines
3.4 KiB

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