1 /*
2 Copyright (c) 2010-2015 Werner Dittmann
3
4 Permission is hereby granted, free of charge, to any person
5 obtaining a copy of this software and associated documentation
6 files (the "Software"), to deal in the Software without
7 restriction, including without limitation the rights to use,
8 copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the
10 Software is furnished to do so, subject to the following
11 conditions:
12
13 The above copyright notice and this permission notice shall be
14 included in all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 OTHER DEALINGS IN THE SOFTWARE.
24
25 */
26
27 #ifndef SKEINAPI_H
28 #define SKEINAPI_H
29
82
83 #ifdef _MSC_VER
84 typedef signed __int8 int8_t;
85 typedef unsigned __int8 uint8_t;
86 typedef signed __int16 int16_t;
87 typedef unsigned __int16 uint16_t;
88 typedef signed __int32 int32_t;
89 typedef unsigned __int32 uint32_t;
90 typedef signed __int64 int64_t;
91 typedef unsigned __int64 uint64_t;
92 #else
93 #include <stdint.h>
94 #endif
95
96 #ifdef __cplusplus
97 extern "C"
98 {
99 #endif
100
109
121 union {
128
144
160
172
194 size_t hashBitLen);
195
209 size_t msgByteCnt);
210
225 size_t msgBitCnt);
226
245
246 #ifdef __cplusplus
247 }
248 #endif
249
253 #endif
void skeinReset(SkeinCtx_t *ctx)
Resets a Skein context for furter use.
int skeinUpdate(SkeinCtx_t *ctx, const uint8_t *msg, size_t msgByteCnt)
Update Skein with the next part of the message.
int skeinUpdateBits(SkeinCtx_t *ctx, const uint8_t *msg, size_t msgBitCnt)
Update the hash with a message bit string.
int skeinFinal(SkeinCtx_t *ctx, uint8_t *hash)
Finalize Skein and return the hash.
int skeinMacInit(SkeinCtx_t *ctx, const uint8_t *key, size_t keyLen, size_t hashBitLen)
Initializes or reuses a Skein context for MAC usage.
SkeinSize
Which Skein size to use.
#define SKEIN_MAX_STATE_WORDS
int skeinCtxPrepare(SkeinCtx_t *ctx, SkeinSize_t size)
Prepare a Skein context.
u64b_t XSave[SKEIN_MAX_STATE_WORDS]
struct SkeinCtx SkeinCtx_t
Context for Skein.
enum SkeinSize SkeinSize_t
Which Skein size to use.
int skeinInit(SkeinCtx_t *ctx, size_t hashBitLen)
Initialize a Skein context.