16 #ifndef _KeccakHashInterface_h_
17 #define _KeccakHashInterface_h_
19 #ifndef KeccakP1600_excluded
21 #include "KeccakSponge.h"
24 typedef unsigned char BitSequence;
25 typedef size_t DataLength;
26 typedef enum { SUCCESS = 0, FAIL = 1, BAD_HASHLEN = 2 } HashReturn;
30 KeccakWidth1600_SpongeInstance sponge;
31 unsigned int fixedOutputLength;
32 unsigned char delimitedSuffix;
33 } Keccak_HashInstance;
51 HashReturn Keccak_HashInitialize(Keccak_HashInstance* hashInstance,
unsigned int rate,
unsigned int capacity,
52 unsigned int hashbitlen,
unsigned char delimitedSuffix);
56 #define Keccak_HashInitialize_SHAKE128(hashInstance) Keccak_HashInitialize(hashInstance, 1344, 256, 0, 0x1F)
60 #define Keccak_HashInitialize_SHAKE256(hashInstance) Keccak_HashInitialize(hashInstance, 1088, 512, 0, 0x1F)
64 #define Keccak_HashInitialize_SHA3_224(hashInstance) Keccak_HashInitialize(hashInstance, 1152, 448, 224, 0x06)
68 #define Keccak_HashInitialize_SHA3_256(hashInstance) Keccak_HashInitialize(hashInstance, 1088, 512, 256, 0x06)
72 #define Keccak_HashInitialize_SHA3_384(hashInstance) Keccak_HashInitialize(hashInstance, 832, 768, 384, 0x06)
76 #define Keccak_HashInitialize_SHA3_512(hashInstance) Keccak_HashInitialize(hashInstance, 576, 1024, 512, 0x06)
88 HashReturn Keccak_HashUpdate(Keccak_HashInstance* hashInstance,
const BitSequence* data, DataLength databitlen);
101 HashReturn Keccak_HashFinal(Keccak_HashInstance* hashInstance, BitSequence* hashval);
112 HashReturn Keccak_HashSqueeze(Keccak_HashInstance* hashInstance, BitSequence* data, DataLength databitlen);