osip_md5.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* MD5.H - header file for MD5C.C
  2. */
  3. /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
  4. rights reserved.
  5. License to copy and use this software is granted provided that it
  6. is identified as the "RSA Data Security, Inc. MD5 Message-Digest
  7. Algorithm" in all material mentioning or referencing this software
  8. or this function.
  9. License is also granted to make and use derivative works provided
  10. that such works are identified as "derived from the RSA Data
  11. Security, Inc. MD5 Message-Digest Algorithm" in all material
  12. mentioning or referencing the derived work.
  13. RSA Data Security, Inc. makes no representations concerning either
  14. the merchantability of this software or the suitability of this
  15. software for any particular purpose. It is provided "as is"
  16. without express or implied warranty of any kind.
  17. These notices must be retained in any copies of any part of this
  18. documentation and/or software.
  19. */
  20. #ifndef _MD5_H_
  21. #define _MD5_H_
  22. #ifndef DOXYGEN
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* modified for oSIP: GCC supports this feature */
  27. #define PROTOTYPES 1
  28. #ifndef PROTOTYPES
  29. #define PROTOTYPES 0
  30. #endif
  31. /* POINTER defines a generic pointer type */
  32. typedef unsigned char *POINTER;
  33. /* UINT2 defines a two byte word */
  34. typedef unsigned short int UINT2;
  35. /* UINT4 defines a four byte word */
  36. typedef unsigned int UINT4;
  37. /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
  38. If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
  39. returns an empty list.
  40. */
  41. #if PROTOTYPES
  42. #define PROTO_LIST(list) list
  43. #else
  44. #define PROTO_LIST(list) ()
  45. #endif
  46. /**
  47. * Structure for holding MD5 context.
  48. * @var MD5_CTX
  49. */
  50. typedef struct {
  51. UINT4 state[4]; /* state (ABCD) */
  52. UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
  53. unsigned char buffer[64]; /* input buffer */
  54. } osip_MD5_CTX;
  55. void osip_MD5Init PROTO_LIST((osip_MD5_CTX *) );
  56. void osip_MD5Update PROTO_LIST((osip_MD5_CTX *, unsigned char *, unsigned int) );
  57. void osip_MD5Final PROTO_LIST((unsigned char[16], osip_MD5_CTX *) );
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61. #endif
  62. #endif