/*
* Interface declarations for Skein hashing.
* Source code author: Doug Whiting, 2008.
* This algorithm and source code is released to the public domain.
*
* The following compile-time switches may be defined to control some
* tradeoffs between speed, code size, error checking, and security.
*
* The "default" note explains what happens when the switch is not defined.
*
* SKEIN_DEBUG -- make callouts from inside Skein code
* [default: no callouts (no overhead)]
*
* SKEIN_ERR_CHECK -- how error checking is handled inside Skein
* code. If not defined, most error checking
* is disabled (for performance). Otherwise,
* the switch value is interpreted as:
* 0: use assert() to flag errors
* 1: return SKEIN_FAIL to flag errors
*/
/* Copyright 2013 Doug Whiting. This code is released to the public domain. */
#ifndef _SYS_SKEIN_H_
#define _SYS_SKEIN_H_
#ifdef __cplusplus
extern "C" {
#endif
enum {
};
typedef struct {
/* tweak words: T[0]=byte cnt, T[1]=flags */
typedef struct { /* 256-bit Skein hash context structure */
Skein_Ctxt_Hdr_t h; /* common header context variables */
/* partial block buffer (8-byte aligned) */
typedef struct { /* 512-bit Skein hash context structure */
Skein_Ctxt_Hdr_t h; /* common header context variables */
/* partial block buffer (8-byte aligned) */
typedef struct { /* 1024-bit Skein hash context structure */
Skein_Ctxt_Hdr_t h; /* common header context variables */
/* partial block buffer (8-byte aligned) */
/* Skein APIs for (incremental) "straight hashing" */
/*
* Skein APIs for "extended" initialization: MAC keys, tree hashing.
*
* When keyBytes == 0 and treeInfo == SKEIN_SEQUENTIAL,
* the results of InitExt() are identical to calling Init().
* The function Init() may be called once to "precompute" the IV for
* a given hashBitLen value, then by saving a copy of the context
* the IV computation may be avoided in later calls.
* Similarly, the function InitExt() may be called once per MAC key
* to precompute the MAC IV, then a copy of the context saved and
* reused for each new MAC computation.
*/
/*
* Skein APIs for MAC and tree hash:
* Final_Pad: pad, do final block, but no OUTPUT type
* Output: do just the output stage
*/
#ifndef SKEIN_TREE_HASH
#endif
#if SKEIN_TREE_HASH
#endif
/*
* When you initialize a Skein KCF hashing method you can pass this param
* structure in cm_param to fine-tune the algorithm's defaults.
*/
typedef struct skein_param {
/* Module definitions */
#ifdef SKEIN_MODULE_IMPL
typedef enum skein_mech_type {
((int)(__mech) >= SKEIN_256_MECH_INFO_TYPE && \
((int)(__mech) >= SKEIN_256_MAC_MECH_INFO_TYPE && \
#endif /* SKEIN_MODULE_IMPL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SKEIN_H_ */