| 1 | #ifndef _SKEIN_H_ |
| 2 | #define _SKEIN_H_ 1 |
| 3 | /************************************************************************** |
| 4 | ** |
| 5 | ** Interface declarations and internal definitions for Skein hashing. |
| 6 | ** |
| 7 | ** Source code author: Doug Whiting, 2008. |
| 8 | ** |
| 9 | ** This algorithm and source code is released to the public domain. |
| 10 | ** |
| 11 | *************************************************************************** |
| 12 | ** |
| 13 | ** The following compile-time switches may be defined to control some |
| 14 | ** tradeoffs between speed, code size, error checking, and security. |
| 15 | ** |
| 16 | ** The "default" note explains what happens when the switch is not defined. |
| 17 | ** |
| 18 | ** SKEIN_DEBUG -- make callouts from inside Skein code |
| 19 | ** to examine/display intermediate values. |
| 20 | ** [default: no callouts (no overhead)] |
| 21 | ** |
| 22 | ** SKEIN_ERR_CHECK -- how error checking is handled inside Skein |
| 23 | ** code. If not defined, most error checking |
| 24 | ** is disabled (for performance). Otherwise, |
| 25 | ** the switch value is interpreted as: |
| 26 | ** 0: use assert() to flag errors |
| 27 | ** 1: return SKEIN_FAIL to flag errors |
| 28 | ** |
| 29 | ***************************************************************************/ |
| 30 | #include "skein_port.h" /* get platform-specific definitions */ |
| 31 | |
| 32 | typedef enum |
| 33 | { |
| 34 | SKEIN_SUCCESS = 0, /* return codes from Skein calls */ |
| 35 | SKEIN_FAIL = 1, |
| 36 | SKEIN_BAD_HASHLEN = 2 |
| 37 | } |
| 38 | HashReturn; |
| 39 | |
| 40 | typedef size_t DataLength; /* bit count type */ |
| 41 | typedef u08b_t BitSequence; /* bit stream type */ |
| 42 | |
| 43 | /* "all-in-one" call */ |
| 44 | HashReturn skein_hash(int hashbitlen, const BitSequence *data, |
| 45 | DataLength databitlen, BitSequence *hashval); |
| 46 | |
| 47 | #endif /* ifndef _SKEIN_H_ */ |