Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
tpruvot
GitHub Repository: tpruvot/cpuminer-multi
Path: blob/linux/crypto/c_skein.h
1201 views
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
SkeinHashReturn;
39
40
typedef size_t SkeinDataLength; /* bit count type */
41
typedef u08b_t SkeinBitSequence; /* bit stream type */
42
43
/* "all-in-one" call */
44
SkeinHashReturn skein_hash(int hashbitlen, const SkeinBitSequence *data,
45
SkeinDataLength databitlen, SkeinBitSequence *hashval);
46
47
#endif /* ifndef _SKEIN_H_ */
48
49