md5.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 1999 - 2005, Digium, Inc.
  5. *
  6. * Mark Spencer <markster@digium.com>
  7. *
  8. * See http://www.asterisk.org for more information about
  9. * the Asterisk project. Please do not directly contact
  10. * any of the maintainers of this project for assistance;
  11. * the project provides a web site, mailing lists and IRC
  12. * channels for your use.
  13. *
  14. * This program is free software, distributed under the terms of
  15. * the GNU General Public License Version 2. See the LICENSE file
  16. * at the top of the source tree.
  17. */
  18. /*!\file
  19. * \brief MD5 digest functions
  20. */
  21. #ifndef _ASTERISK_MD5_H
  22. #define _ASTERISK_MD5_H
  23. struct MD5Context {
  24. uint32_t buf[4];
  25. uint32_t bits[2];
  26. /*! Align because we cast this buffer to uint32s */
  27. unsigned char in[64] __attribute__((aligned(__alignof__(uint32_t))));
  28. };
  29. void MD5Init(struct MD5Context *context);
  30. void MD5Update(struct MD5Context *context, unsigned char const *buf,
  31. unsigned len);
  32. void MD5Final(unsigned char digest[16], struct MD5Context *context);
  33. void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
  34. #endif /* _ASTERISK_MD5_H */