php_hash_haval.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2018 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Author: Sara Golemon <pollita@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef PHP_HASH_HAVAL_H
  19. #define PHP_HASH_HAVAL_H
  20. #include "ext/standard/basic_functions.h"
  21. /* HAVAL context. */
  22. typedef struct {
  23. uint32_t state[8];
  24. uint32_t count[2];
  25. unsigned char buffer[128];
  26. char passes;
  27. short output;
  28. void (*Transform)(uint32_t state[8], const unsigned char block[128]);
  29. } PHP_HAVAL_CTX;
  30. #define PHP_HASH_HAVAL_INIT_DECL(p,b) PHP_HASH_API void PHP_##p##HAVAL##b##Init(PHP_HAVAL_CTX *); \
  31. PHP_HASH_API void PHP_HAVAL##b##Final(unsigned char*, PHP_HAVAL_CTX *);
  32. PHP_HASH_API void PHP_HAVALUpdate(PHP_HAVAL_CTX *, const unsigned char *, unsigned int);
  33. PHP_HASH_HAVAL_INIT_DECL(3,128)
  34. PHP_HASH_HAVAL_INIT_DECL(3,160)
  35. PHP_HASH_HAVAL_INIT_DECL(3,192)
  36. PHP_HASH_HAVAL_INIT_DECL(3,224)
  37. PHP_HASH_HAVAL_INIT_DECL(3,256)
  38. PHP_HASH_HAVAL_INIT_DECL(4,128)
  39. PHP_HASH_HAVAL_INIT_DECL(4,160)
  40. PHP_HASH_HAVAL_INIT_DECL(4,192)
  41. PHP_HASH_HAVAL_INIT_DECL(4,224)
  42. PHP_HASH_HAVAL_INIT_DECL(4,256)
  43. PHP_HASH_HAVAL_INIT_DECL(5,128)
  44. PHP_HASH_HAVAL_INIT_DECL(5,160)
  45. PHP_HASH_HAVAL_INIT_DECL(5,192)
  46. PHP_HASH_HAVAL_INIT_DECL(5,224)
  47. PHP_HASH_HAVAL_INIT_DECL(5,256)
  48. #endif