md5.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifdef __cplusplus
  2. extern "C" {
  3. #endif
  4. /*
  5. * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.
  6. * MD5 Message-Digest Algorithm (RFC 1321).
  7. *
  8. * Homepage:
  9. * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
  10. *
  11. * Author:
  12. * Alexander Peslyak, better known as Solar Designer <solar at openwall.com>
  13. *
  14. * This software was written by Alexander Peslyak in 2001. No copyright is
  15. * claimed, and the software is hereby placed in the public domain.
  16. * In case this attempt to disclaim copyright and place the software in the
  17. * public domain is deemed null and void, then the software is
  18. * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the
  19. * general public under the following terms:
  20. *
  21. * Redistribution and use in source and binary forms, with or without
  22. * modification, are permitted.
  23. *
  24. * There's ABSOLUTELY NO WARRANTY, express or implied.
  25. *
  26. * See md5.c for more information.
  27. */
  28. #ifdef HAVE_OPENSSL
  29. #include <openssl/md5.h>
  30. #elif !defined(_MD5_H)
  31. #define _MD5_H
  32. /* Any 32-bit or wider unsigned integer data type will do */
  33. typedef unsigned int MD5_u32plus;
  34. typedef struct {
  35. MD5_u32plus lo, hi;
  36. MD5_u32plus a, b, c, d;
  37. unsigned char buffer[64];
  38. MD5_u32plus block[16];
  39. } MD5_CTX;
  40. extern void MD5_Init(MD5_CTX *ctx);
  41. extern void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size);
  42. extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
  43. #endif
  44. #ifdef __cplusplus
  45. }
  46. #endif