whrlpool.h 946 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. int WHIRLPOOL_Init (WHIRLPOOL_CTX *c);
  23. int WHIRLPOOL_Update (WHIRLPOOL_CTX *c,const void *inp,size_t bytes);
  24. void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,const void *inp,size_t bits);
  25. int WHIRLPOOL_Final (unsigned char *md,WHIRLPOOL_CTX *c);
  26. unsigned char *WHIRLPOOL(const void *inp,size_t bytes,unsigned char *md);
  27. #endif
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. #endif