Try to debug unchanged /proc/softirqs checksum.
[skeinsum.git] / SHA3api_ref.h
1 #ifndef _AHS_API_H_\r
2 #define _AHS_API_H_\r
3 \r
4 /***********************************************************************\r
5 **\r
6 ** Interface declarations of the AHS API using the Skein hash function.\r
7 **\r
8 ** Source code author: Doug Whiting, 2008.\r
9 **\r
10 ** This algorithm and source code is released to the public domain.\r
11 ** \r
12 ************************************************************************/\r
13 \r
14 #include "skein.h"\r
15 \r
16 typedef enum\r
17     {\r
18     SUCCESS     = SKEIN_SUCCESS,\r
19     FAIL        = SKEIN_FAIL,\r
20     BAD_HASHLEN = SKEIN_BAD_HASHLEN\r
21     }\r
22     HashReturn;\r
23 \r
24 typedef size_t   DataLength;                /* bit count  type */\r
25 typedef u08b_t   BitSequence;               /* bit stream type */\r
26 \r
27 typedef struct\r
28     {\r
29     uint_t  statebits;                      /* 256, 512, or 1024 */\r
30     union\r
31         {\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
36         } u;\r
37     }\r
38     hashState;\r
39 \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
44 \r
45 /* "all-in-one" call */\r
46 HashReturn Hash  (int hashbitlen,   const BitSequence *data, \r
47                   DataLength databitlen,  BitSequence *hashval);\r
48 \r
49 \r
50 /*\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
53 **\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
57 */\r
58 #ifndef SKEIN_256_NIST_MAX_HASHBITS\r
59 #define SKEIN_256_NIST_MAX_HASHBITS (0)\r
60 #endif\r
61 \r
62 #ifndef SKEIN_512_NIST_MAX_HASHBITS\r
63 #define SKEIN_512_NIST_MAX_HASHBITS (512)\r
64 #endif\r
65 \r
66 #endif  /* ifdef _AHS_API_H_ */\r