md5.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the OpenSSL license (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #ifndef HEADER_MD5_H
  10. # define HEADER_MD5_H
  11. # include <openssl/opensslconf.h>
  12. # ifndef OPENSSL_NO_MD5
  13. # include <openssl/e_os2.h>
  14. # include <stddef.h>
  15. # ifdef __cplusplus
  16. extern "C" {
  17. # endif
  18. /*
  19. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  20. * ! MD5_LONG has to be at least 32 bits wide. !
  21. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  22. */
  23. # define MD5_LONG unsigned int
  24. # define MD5_CBLOCK 64
  25. # define MD5_LBLOCK (MD5_CBLOCK/4)
  26. # define MD5_DIGEST_LENGTH 16
  27. typedef struct MD5state_st {
  28. MD5_LONG A, B, C, D;
  29. MD5_LONG Nl, Nh;
  30. MD5_LONG data[MD5_LBLOCK];
  31. unsigned int num;
  32. } MD5_CTX;
  33. int MD5_Init(MD5_CTX *c);
  34. int MD5_Update(MD5_CTX *c, const void *data, size_t len);
  35. int MD5_Final(unsigned char *md, MD5_CTX *c);
  36. unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);
  37. void MD5_Transform(MD5_CTX *c, const unsigned char *b);
  38. # ifdef __cplusplus
  39. }
  40. # endif
  41. # endif
  42. #endif