1 /* blockcipher_descriptor.h */
3 This file is part of the AVR-Crypto-Lib.
4 Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de)
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.
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.
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/>.
20 * \file blockcipher_descriptor.h
24 * \license GPLv3 or later
28 #ifndef BLOCKCIPHER_DESCRIPTOR_H_
29 #define BLOCKCIPHER_DESCRIPTOR_H_
32 #include <avr\pgmspace.h>
39 typedef void(*void_fpt)(void);
42 typedef void(*bc_init1_fpt)(void*, void*);
43 typedef void(*bc_init2_fpt)(void*, uint16_t,void*);
44 typedef void(*bc_enc1_fpt)(void*, void*);
45 typedef void(*bc_enc2_fpt)(void*, void*, void*);
46 typedef void(*bc_dec1_fpt)(void*, void*);
47 typedef void(*bc_dec2_fpt)(void*, void*, void*);
48 typedef void(*bc_free_fpt)(void*);
68 #define BC_INIT_TYPE 0x01
69 #define BC_INIT_TYPE_1 0x00 /* for fix keylength */
70 #define BC_INIT_TYPE_2 0x01 /* keylength is passed as second parameter */
72 #define BC_ENC_TYPE 0x02
73 #define BC_ENC_TYPE_1 0x00
74 #define BC_ENC_TYPE_2 0x02
76 #define BC_DEC_TYPE 0x04
77 #define BC_DEC_TYPE_1 0x00
78 #define BC_DEC_TYPE_2 0x04
80 #define BCDESC_TYPE_BLOCKCIPHER 0x01
83 uint8_t type; /* 1==blockcipher */
92 PGM_VOID_P valid_keysize_desc;
93 } bcdesc_t; /* blockcipher descriptor type */
101 #endif /* BLOCKCIPHER_DESCRIPTOR_H_ */