php_hash_ripemd.h 3.0 KB

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