md5.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. * END COPYRIGHT BLOCK **/
  6. /*
  7. * MD5 algorithm used by Netscape Mail Server
  8. */
  9. /* MD5 code taken from reference implementation published in RFC 1321 */
  10. #ifndef _RFC1321_MD5_H_
  11. #define _RFC1321_MD5_H_
  12. /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
  13. rights reserved.
  14. License to copy and use this software is granted provided that it
  15. is identified as the "RSA Data Security, Inc. MD5 Message-Digest
  16. Algorithm" in all material mentioning or referencing this software
  17. or this function.
  18. License is also granted to make and use derivative works provided
  19. that such works are identified as "derived from the RSA Data
  20. Security, Inc. MD5 Message-Digest Algorithm" in all material
  21. mentioning or referencing the derived work.
  22. RSA Data Security, Inc. makes no representations concerning either
  23. the merchantability of this software or the suitability of this
  24. software for any particular purpose. It is provided "as is"
  25. without express or implied warranty of any kind.
  26. These notices must be retained in any copies of any part of this
  27. documentation and/or software.
  28. */
  29. #include "nspr.h"
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif /* __cplusplus */
  33. typedef unsigned char * POINTER;
  34. typedef PRUint16 UINT2;
  35. typedef PRUint32 UINT4;
  36. /* MD5 context. */
  37. typedef struct {
  38. UINT4 state[4]; /* state (ABCD) */
  39. UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
  40. unsigned char buffer[64]; /* input buffer */
  41. } mta_MD5_CTX;
  42. void mta_MD5Init (mta_MD5_CTX *);
  43. void mta_MD5Update (mta_MD5_CTX *, const unsigned char *, unsigned int);
  44. void mta_MD5Final (unsigned char [16], mta_MD5_CTX *);
  45. #ifdef __cplusplus
  46. }
  47. #endif /* __cplusplus */
  48. #endif /* end of _RFC1321_MD5_H_ */