whrlpool.h 1019 B

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