]> git.cryptolib.org Git - avr-crypto-lib.git/blob - cast5.h
8f34cede2e9fbc15c050f7e2f13647ca1050157a
[avr-crypto-lib.git] / cast5.h
1 /* 
2  * File:        cast5.h
3  * Author:      Daniel Otte
4  * Date:        26.07.2006
5  * License: GPL
6  * Description: Implementation of the CAST5 (aka CAST-128) cipher algorithm as described in RFC 2144
7  * 
8  */
9 #ifndef CAST5_H_
10 #define CAST5_H_ 
11
12 #include <stdint.h> 
13
14 #ifndef BOOL
15 #define BOOL
16  #ifndef __BOOL
17  #define __BOOL
18   #ifndef __BOOL__
19   #define __BOOL__
20         typedef enum{false=0,true=1} bool;
21   #endif
22  #endif
23 #endif
24
25
26 typedef struct cast5_ctx_st{
27         uint32_t        mask[16];
28         uint8_t         rotl[8];        /* 4 bit from every rotation key is stored here */
29         uint8_t         roth[2];        /* 1 bit from every rotation key is stored here */
30         bool            shortkey;
31 } cast5_ctx_t;
32
33 void cast5_init(cast5_ctx_t* s, uint8_t* key, uint8_t keylength);
34 void cast5_enc(cast5_ctx_t *s, void* block);
35 void cast5_dec(cast5_ctx_t *s, void* block);
36
37
38
39 #endif
40