]> git.cryptolib.org Git - avr-crypto-lib.git/blob - rc6/rc6.h
fixing E-Mail-Address & Copyright
[avr-crypto-lib.git] / rc6 / rc6.h
1 /* rc6.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:        rc6.h
21  * Author:      Daniel Otte
22  * Date:        06.08.2006
23  * License: GPL
24  * Description: Implementation of the RC6 cipher algorithm.
25  *      This implementation is restricted to 32-bit words, but free in the choice of number of rounds (0 to 255).
26  *      so it is RC6-32/r/b
27  */
28
29 #ifndef RC6_H_
30 #define RC6_H_
31
32  
33 #include <stdint.h>
34  
35 typedef struct rc6_ctx_st{
36         uint8_t         rounds;         /* specifys the number of rounds; default: 20 */
37         uint32_t*       S;                      /* the round-keys */
38 } rc6_ctx_t;
39  
40  
41 uint8_t rc6_init(void *key, uint16_t keylength_b, rc6_ctx_t *s);
42  
43 uint8_t rc6_initl(void *key, uint16_t keylength_b, uint8_t rounds, rc6_ctx_t *s);
44  
45 void rc6_enc(void *block, rc6_ctx_t *s);
46
47 void rc6_dec(void *block, rc6_ctx_t *s);
48  
49 void rc6_free(rc6_ctx_t *s); 
50
51 #endif /* RC6_H_ */
52