]> git.cryptolib.org Git - avr-crypto-lib.git/blob - skein/skein.h
fixing E-Mail-Address & Copyright
[avr-crypto-lib.git] / skein / skein.h
1 /* skein.h */
2 /*
3     This file is part of the AVR-Crypto-Lib.
4     Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
5
6     This program is free software: you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation, either version 3 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19 /*
20  * \file    skein.c
21  * \author  Daniel Otte
22  * \email   bg@nerilex.org
23  * \date    2009-03-12
24  * \license GPLv3 or later
25  * 
26  */
27
28 #ifndef SKEIN_H_
29 #define SKEIN_H_
30
31 #include <stdint.h>
32 #include "ubi.h"
33
34 #define SKEIN256_BLOCKSIZE    UBI256_BLOCKSIZE
35 #define SKEIN256_BLOCKSIZE_B  UBI256_BLOCKSIZE_B
36
37 #define SKEIN512_BLOCKSIZE    UBI512_BLOCKSIZE
38 #define SKEIN512_BLOCKSIZE_B  UBI512_BLOCKSIZE_B
39
40 #define SKEIN1024_BLOCKSIZE   UBI1024_BLOCKSIZE
41 #define SKEIN1024_BLOCKSIZE_B UBI1024_BLOCKSIZE_B
42
43 typedef struct{
44          uint16_t outsize_b;
45          ubi256_ctx_t ubictx;
46 }skein256_ctx_t;
47
48 void skein256_init(skein256_ctx_t *ctx, uint16_t outsize_b);
49 void skein256_nextBlock(skein256_ctx_t *ctx, const void *block);
50 void skein256_lastBlock(skein256_ctx_t *ctx, const void *block, uint16_t length_b);
51 void skein256_ctx2hash(void *dest, skein256_ctx_t *ctx);
52 void skein256(void *dest, uint16_t outlength_b, const void *msg, uint32_t length_b);
53
54 typedef struct{
55          uint16_t outsize_b;
56          ubi512_ctx_t ubictx;
57 }skein512_ctx_t;
58
59 void skein512_init(skein512_ctx_t *ctx, uint16_t outsize_b);
60 void skein512_nextBlock(skein512_ctx_t *ctx, const void *block);
61 void skein512_lastBlock(skein512_ctx_t *ctx, const void *block, uint16_t length_b);
62 void skein512_ctx2hash(void *dest, skein512_ctx_t *ctx);
63 void skein512(void *dest, uint16_t outlength_b, const void *msg, uint32_t length_b);
64
65 typedef struct{
66          uint16_t outsize_b;
67          ubi1024_ctx_t ubictx;
68 }skein1024_ctx_t;
69
70 void skein1024_init(skein1024_ctx_t *ctx, uint16_t outsize_b);
71 void skein1024_nextBlock(skein1024_ctx_t *ctx, const void *block);
72 void skein1024_lastBlock(skein1024_ctx_t *ctx, const void *block, uint16_t length_b);
73 void skein1024_ctx2hash(void *dest, skein1024_ctx_t *ctx);
74 void skein1024(void *dest, uint16_t outlength_b, const void *msg, uint32_t length_b);
75
76 #endif /* SKEIN_H_ */