src/core/ngx_md5.h - nginx-1.7.10

Data types defined

Macros defined

Source code


  1. /*
  2. * Copyright (C) Igor Sysoev
  3. * Copyright (C) Nginx, Inc.
  4. */


  5. #ifndef _NGX_MD5_H_INCLUDED_
  6. #define _NGX_MD5_H_INCLUDED_


  7. #include <ngx_config.h>
  8. #include <ngx_core.h>


  9. #if (NGX_HAVE_MD5)

  10. #if (NGX_HAVE_OPENSSL_MD5_H)
  11. #include <openssl/md5.h>
  12. #else
  13. #include <md5.h>
  14. #endif


  15. typedef MD5_CTX  ngx_md5_t;


  16. #if (NGX_OPENSSL_MD5)

  17. #define ngx_md5_init    MD5_Init
  18. #define ngx_md5_update  MD5_Update
  19. #define ngx_md5_final   MD5_Final

  20. #else

  21. #define ngx_md5_init    MD5Init
  22. #define ngx_md5_update  MD5Update
  23. #define ngx_md5_final   MD5Final

  24. #endif


  25. #else /* !NGX_HAVE_MD5 */


  26. typedef struct {
  27.     uint64_t  bytes;
  28.     uint32_t  a, b, c, d;
  29.     u_char    buffer[64];
  30. } ngx_md5_t;


  31. void ngx_md5_init(ngx_md5_t *ctx);
  32. void ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size);
  33. void ngx_md5_final(u_char result[16], ngx_md5_t *ctx);


  34. #endif

  35. #endif /* _NGX_MD5_H_INCLUDED_ */