You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

39 lines
1.1 KiB

  1. /**
  2. * @cond internal
  3. * @file keccak_internal.h
  4. * @copyright
  5. * Copyright (c) 2016 Cryptography Research, Inc. \n
  6. * Released under the MIT License. See LICENSE.txt for license information.
  7. * @author Mike Hamburg
  8. * @brief Keccak internal interfaces. Will be used by STROBE once reintegrated.
  9. */
  10. #ifndef __DECAF_KECCAK_INTERNAL_H__
  11. #define __DECAF_KECCAK_INTERNAL_H__ 1
  12. #include <stdint.h>
  13. /* The internal, non-opaque definition of the decaf_sponge struct. */
  14. typedef union {
  15. uint64_t w[25]; uint8_t b[25*8];
  16. } kdomain_t[1];
  17. typedef struct decaf_kparams_s {
  18. uint8_t position, flags, rate, start_round, pad, rate_pad, max_out, remaining;
  19. } decaf_kparams_s, decaf_kparams_t[1];
  20. typedef struct decaf_keccak_sponge_s {
  21. kdomain_t state;
  22. decaf_kparams_t params;
  23. } decaf_keccak_sponge_s, decaf_keccak_sponge_t[1];
  24. #define INTERNAL_SPONGE_STRUCT 1
  25. void __attribute__((noinline)) keccakf(kdomain_t state, uint8_t start_round);
  26. static inline void dokeccak (decaf_keccak_sponge_t decaf_sponge) {
  27. keccakf(decaf_sponge->state, decaf_sponge->params->start_round);
  28. decaf_sponge->params->position = 0;
  29. }
  30. #endif /* __DECAF_KECCAK_INTERNAL_H__ */