3 * @file keccak_internal.h
5 * Copyright (c) 2016 Cryptography Research, Inc. \n
6 * Released under the MIT License. See LICENSE.txt for license information.
8 * @brief Keccak internal interfaces. Will be used by STROBE once reintegrated.
10 #ifndef __DECAF_KECCAK_INTERNAL_H__
11 #define __DECAF_KECCAK_INTERNAL_H__ 1
15 /* The internal, non-opaque definition of the decaf_sponge struct. */
17 uint64_t w[25]; uint8_t b[25*8];
20 typedef struct decaf_kparams_s {
21 uint8_t position, flags, rate, start_round, pad, rate_pad, max_out, remaining;
22 } decaf_kparams_s, decaf_kparams_t[1];
24 typedef struct decaf_keccak_sponge_s {
26 decaf_kparams_t params;
27 } decaf_keccak_sponge_s, decaf_keccak_sponge_t[1];
29 #define INTERNAL_SPONGE_STRUCT 1
31 void __attribute__((noinline)) keccakf(kdomain_t state, uint8_t start_round);
33 static inline void dokeccak (decaf_keccak_sponge_t decaf_sponge) {
34 keccakf(decaf_sponge->state, decaf_sponge->params->start_round);
35 decaf_sponge->params->position = 0;
38 #endif /* __DECAF_KECCAK_INTERNAL_H__ */