php_hash_ripemd.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_RIPEMD_H
  19. #define PHP_HASH_RIPEMD_H
  20. #include "ext/standard/basic_functions.h"
  21. /* RIPEMD context. */
  22. typedef struct {
  23. uint32_t state[4]; /* state (ABCD) */
  24. uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
  25. unsigned char buffer[64]; /* input buffer */
  26. } PHP_RIPEMD128_CTX;
  27. typedef struct {
  28. uint32_t state[5]; /* state (ABCD) */
  29. uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
  30. unsigned char buffer[64]; /* input buffer */
  31. } PHP_RIPEMD160_CTX;
  32. typedef struct {
  33. uint32_t state[8]; /* state (ABCD) */
  34. uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
  35. unsigned char buffer[64]; /* input buffer */
  36. } PHP_RIPEMD256_CTX;
  37. typedef struct {
  38. uint32_t state[10]; /* state (ABCD) */
  39. uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
  40. unsigned char buffer[64]; /* input buffer */
  41. } PHP_RIPEMD320_CTX;
  42. PHP_HASH_API void PHP_RIPEMD128Init(PHP_RIPEMD128_CTX *);
  43. PHP_HASH_API void PHP_RIPEMD128Update(PHP_RIPEMD128_CTX *, const unsigned char *, unsigned int);
  44. PHP_HASH_API void PHP_RIPEMD128Final(unsigned char[16], PHP_RIPEMD128_CTX *);
  45. PHP_HASH_API void PHP_RIPEMD160Init(PHP_RIPEMD160_CTX *);
  46. PHP_HASH_API void PHP_RIPEMD160Update(PHP_RIPEMD160_CTX *, const unsigned char *, unsigned int);
  47. PHP_HASH_API void PHP_RIPEMD160Final(unsigned char[20], PHP_RIPEMD160_CTX *);
  48. PHP_HASH_API void PHP_RIPEMD256Init(PHP_RIPEMD256_CTX *);
  49. PHP_HASH_API void PHP_RIPEMD256Update(PHP_RIPEMD256_CTX *, const unsigned char *, unsigned int);
  50. PHP_HASH_API void PHP_RIPEMD256Final(unsigned char[32], PHP_RIPEMD256_CTX *);
  51. PHP_HASH_API void PHP_RIPEMD320Init(PHP_RIPEMD320_CTX *);
  52. PHP_HASH_API void PHP_RIPEMD320Update(PHP_RIPEMD320_CTX *, const unsigned char *, unsigned int);
  53. PHP_HASH_API void PHP_RIPEMD320Final(unsigned char[40], PHP_RIPEMD320_CTX *);
  54. #endif /* PHP_HASH_RIPEMD_H */