]> git.cryptolib.org Git - avr-crypto-lib.git/blob - hfal/hfal_shabal.c
adding hashing of final hex file to make-system
[avr-crypto-lib.git] / hfal / hfal_shabal.c
1 /* hfal_shabal.c */
2 /*
3     This file is part of the AVR-Crypto-Lib.
4     Copyright (C) 2008  Daniel Otte (daniel.otte@rub.de)
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     hfal_shabal.c
21  * \email    daniel.otte@rub.de
22  * \author   Daniel Otte 
23  * \date     2009-04-20
24  * \license  GPLv3 or later
25  * 
26  */
27
28 #include <avr/pgmspace.h>
29 #include <stdlib.h>
30 #include "hashfunction_descriptor.h"
31 #include "shabal.h"
32
33
34 static const char shabal192_str[]   PROGMEM = "Shabal-192";
35 static const char shabal224_str[]   PROGMEM = "Shabal-224";
36 static const char shabal256_str[]   PROGMEM = "Shabal-256";
37 static const char shabal384_str[]   PROGMEM = "Shabal-384";
38 static const char shabal512_str[]   PROGMEM = "Shabal-512";
39
40 const hfdesc_t shabal192_desc PROGMEM = {
41         HFDESC_TYPE_HASHFUNCTION,
42         0,
43         shabal192_str,
44         sizeof(shabal_ctx_t),
45         SHABAL_BLOCKSIZE,
46         192,
47         (hf_init_fpt)shabal192_init,
48         (hf_nextBlock_fpt)shabal_nextBlock,
49         (hf_lastBlock_fpt)shabal_lastBlock,
50         (hf_ctx2hash_fpt)shabal192_ctx2hash,
51         (hf_free_fpt)NULL,
52         (hf_mem_fpt)shabal192
53 };
54
55 const hfdesc_t shabal224_desc PROGMEM = {
56         HFDESC_TYPE_HASHFUNCTION,
57         0,
58         shabal224_str,
59         sizeof(shabal_ctx_t),
60         SHABAL_BLOCKSIZE,
61         224,
62         (hf_init_fpt)shabal224_init,
63         (hf_nextBlock_fpt)shabal_nextBlock,
64         (hf_lastBlock_fpt)shabal_lastBlock,
65         (hf_ctx2hash_fpt)shabal224_ctx2hash,
66         (hf_free_fpt)NULL,
67         (hf_mem_fpt)shabal224
68 };
69
70 const hfdesc_t shabal256_desc PROGMEM = {
71         HFDESC_TYPE_HASHFUNCTION,
72         0,
73         shabal256_str,
74         sizeof(shabal_ctx_t),
75         SHABAL_BLOCKSIZE,
76         256,
77         (hf_init_fpt)shabal256_init,
78         (hf_nextBlock_fpt)shabal_nextBlock,
79         (hf_lastBlock_fpt)shabal_lastBlock,
80         (hf_ctx2hash_fpt)shabal256_ctx2hash,
81         (hf_free_fpt)NULL,
82         (hf_mem_fpt)shabal256
83 };
84
85 const hfdesc_t shabal384_desc PROGMEM = {
86         HFDESC_TYPE_HASHFUNCTION,
87         0,
88         shabal384_str,
89         sizeof(shabal_ctx_t),
90         SHABAL_BLOCKSIZE,
91         384,
92         (hf_init_fpt)shabal384_init,
93         (hf_nextBlock_fpt)shabal_nextBlock,
94         (hf_lastBlock_fpt)shabal_lastBlock,
95         (hf_ctx2hash_fpt)shabal384_ctx2hash,
96         (hf_free_fpt)NULL,
97         (hf_mem_fpt)shabal384
98 };
99
100 const hfdesc_t shabal512_desc PROGMEM = {
101         HFDESC_TYPE_HASHFUNCTION,
102         0,
103         shabal512_str,
104         sizeof(shabal_ctx_t),
105         SHABAL_BLOCKSIZE,
106         512,
107         (hf_init_fpt)shabal512_init,
108         (hf_nextBlock_fpt)shabal_nextBlock,
109         (hf_lastBlock_fpt)shabal_lastBlock,
110         (hf_ctx2hash_fpt)shabal512_ctx2hash,
111         (hf_free_fpt)NULL,
112         (hf_mem_fpt)shabal512
113 };