md5.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #ifndef _LRAD_MD5_H
  2. #define _LRAD_MD5_H
  3. #ifndef _LRAD_PROTO_H
  4. #define _LRAD_PROTO_H
  5. /* GLOBAL.H - RSAREF types and constants
  6. */
  7. /* PROTOTYPES should be set to one if and only if the compiler supports
  8. function argument prototyping.
  9. The following makes PROTOTYPES default to 0 if it has not already
  10. been defined with C compiler flags.
  11. */
  12. #ifndef PROTOTYPES
  13. # if __STDC__
  14. # define PROTOTYPES 1
  15. # else
  16. # define PROTOTYPES 0
  17. # endif
  18. #endif
  19. /* POINTER defines a generic pointer type */
  20. #ifndef _POINTER_T
  21. typedef unsigned char *POINTER;
  22. #endif
  23. typedef const unsigned char *CONSTPOINTER;
  24. /* UINT2 defines a two byte word */
  25. #ifndef _UINT2_T
  26. typedef unsigned short int UINT2;
  27. #endif
  28. /* UINT4 defines a four byte word */
  29. #ifndef _UINT4_T
  30. typedef unsigned int UINT4;
  31. #endif
  32. /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
  33. If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
  34. returns an empty list.
  35. */
  36. #if PROTOTYPES
  37. #define PROTO_LIST(list) list
  38. #else
  39. #define PROTO_LIST(list) ()
  40. #endif
  41. #endif /* _LRAD_PROTO_H */
  42. /*
  43. * FreeRADIUS defines to ensure globally unique MD5 function names,
  44. * so that we don't pick up vendor-specific broken MD5 libraries.
  45. */
  46. #define MD5_CTX librad_MD5_CTX
  47. #define MD5Init librad_MD5Init
  48. #define MD5Update librad_MD5Update
  49. #define MD5Final librad_MD5Final
  50. /* MD5.H - header file for MD5C.C
  51. */
  52. /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
  53. rights reserved.
  54. License to copy and use this software is granted provided that it
  55. is identified as the "RSA Data Security, Inc. MD5 Message-Digest
  56. Algorithm" in all material mentioning or referencing this software
  57. or this function.
  58. License is also granted to make and use derivative works provided
  59. that such works are identified as "derived from the RSA Data
  60. Security, Inc. MD5 Message-Digest Algorithm" in all material
  61. mentioning or referencing the derived work.
  62. RSA Data Security, Inc. makes no representations concerning either
  63. the merchantability of this software or the suitability of this
  64. software for any particular purpose. It is provided "as is"
  65. without express or implied warranty of any kind.
  66. These notices must be retained in any copies of any part of this
  67. documentation and/or software.
  68. */
  69. /* MD5 context. */
  70. typedef struct {
  71. UINT4 state[4]; /* state (ABCD) */
  72. UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
  73. unsigned char buffer[64]; /* input buffer */
  74. } MD5_CTX;
  75. void MD5Init PROTO_LIST ((MD5_CTX *));
  76. void MD5Update PROTO_LIST
  77. ((MD5_CTX *, const unsigned char *, unsigned int));
  78. void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *));
  79. #endif /* _LRAD_MD5_H */