md5.h 2.1 KB

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