sha3.h 665 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Common values for SHA-3 algorithms
  3. */
  4. #ifndef __CRYPTO_SHA3_H__
  5. #define __CRYPTO_SHA3_H__
  6. #define SHA3_224_DIGEST_SIZE (224 / 8)
  7. #define SHA3_224_BLOCK_SIZE (200 - 2 * SHA3_224_DIGEST_SIZE)
  8. #define SHA3_256_DIGEST_SIZE (256 / 8)
  9. #define SHA3_256_BLOCK_SIZE (200 - 2 * SHA3_256_DIGEST_SIZE)
  10. #define SHA3_384_DIGEST_SIZE (384 / 8)
  11. #define SHA3_384_BLOCK_SIZE (200 - 2 * SHA3_384_DIGEST_SIZE)
  12. #define SHA3_512_DIGEST_SIZE (512 / 8)
  13. #define SHA3_512_BLOCK_SIZE (200 - 2 * SHA3_512_DIGEST_SIZE)
  14. struct sha3_state {
  15. u64 st[25];
  16. unsigned int md_len;
  17. unsigned int rsiz;
  18. unsigned int rsizw;
  19. unsigned int partial;
  20. u8 buf[SHA3_224_BLOCK_SIZE];
  21. };
  22. #endif