whrlpool.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef HEADER_WHRLPOOL_H
  2. # define HEADER_WHRLPOOL_H
  3. # include <openssl/e_os2.h>
  4. # include <stddef.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. # define WHIRLPOOL_DIGEST_LENGTH (512/8)
  9. # define WHIRLPOOL_BBLOCK 512
  10. # define WHIRLPOOL_COUNTER (256/8)
  11. typedef struct {
  12. union {
  13. unsigned char c[WHIRLPOOL_DIGEST_LENGTH];
  14. /* double q is here to ensure 64-bit alignment */
  15. double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)];
  16. } H;
  17. unsigned char data[WHIRLPOOL_BBLOCK / 8];
  18. unsigned int bitoff;
  19. size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)];
  20. } WHIRLPOOL_CTX;
  21. # ifndef OPENSSL_NO_WHIRLPOOL
  22. # ifdef OPENSSL_FIPS
  23. int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
  24. # endif
  25. int WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
  26. int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes);
  27. void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits);
  28. int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c);
  29. unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md);
  30. # endif
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34. #endif