4 /***********************************************************************
\r
6 ** Interface declarations of the AHS API using the Skein hash function.
\r
8 ** Source code author: Doug Whiting, 2008.
\r
10 ** This algorithm and source code is released to the public domain.
\r
12 ************************************************************************/
\r
18 SUCCESS = SKEIN_SUCCESS,
\r
20 BAD_HASHLEN = SKEIN_BAD_HASHLEN
\r
24 typedef size_t DataLength; /* bit count type */
\r
25 typedef u08b_t BitSequence; /* bit stream type */
\r
29 uint_t statebits; /* 256, 512, or 1024 */
\r
32 Skein_Ctxt_Hdr_t h; /* common header "overlay" */
\r
33 Skein_256_Ctxt_t ctx_256;
\r
34 Skein_512_Ctxt_t ctx_512;
\r
35 Skein1024_Ctxt_t ctx1024;
\r
40 /* "incremental" hashing API */
\r
41 HashReturn Init (hashState *state, int hashbitlen);
\r
42 HashReturn Update(hashState *state, const BitSequence *data, DataLength databitlen);
\r
43 HashReturn Final (hashState *state, BitSequence *hashval);
\r
45 /* "all-in-one" call */
\r
46 HashReturn Hash (int hashbitlen, const BitSequence *data,
\r
47 DataLength databitlen, BitSequence *hashval);
\r
51 ** Re-define the compile-time constants below to change the selection
\r
52 ** of the Skein state size in the Init() function in SHA3api_ref.c.
\r
54 ** That is, the NIST API does not allow for explicit selection of the
\r
55 ** Skein block size, so it must be done implicitly in the Init() function.
\r
56 ** The selection is controlled by these constants.
\r
58 #ifndef SKEIN_256_NIST_MAX_HASHBITS
\r
59 #define SKEIN_256_NIST_MAX_HASHBITS (0)
\r
62 #ifndef SKEIN_512_NIST_MAX_HASHBITS
\r
63 #define SKEIN_512_NIST_MAX_HASHBITS (512)
\r
66 #endif /* ifdef _AHS_API_H_ */
\r