]>
git.saurik.com Git - apple/security.git/blob - SecurityTests/cspxutils/utilLib/rijndael-alg-ref.h
1 /* rijndael-alg-ref.h v2.0 August '99
2 * Reference ANSI C code
3 * authors: Paulo Barreto
6 #ifndef __RIJNDAEL_ALG_H
7 #define __RIJNDAEL_ALG_H
10 #define MIN_AES_KEY_BITS 128
11 #define MID_AES_KEY_BITS 192
12 #define MAX_AES_KEY_BITS 256
13 #define MAX_AES_KEY_BYTES (MAX_AES_KEY_BITS / 8)
15 #define MIN_AES_BLOCK_BITS 128
16 #define MID_AES_BLOCK_BITS 192
17 #define MAX_AES_BLOCK_BITS 256
18 #define MIN_AES_BLOCK_BYTES (MIN_AES_BLOCK_BITS / 8)
21 #define MAXBC (MAX_AES_BLOCK_BITS/32)
22 #define MAXKC (MAX_AES_KEY_BITS/32)
29 typedef unsigned char word8
;
30 typedef unsigned short word16
;
31 typedef unsigned long word32
;
34 int _rijndaelKeySched (word8 k
[4][MAXKC
], int keyBits
, int blockBits
,
35 word8 rk
[MAXROUNDS
+1][4][MAXBC
]);
36 int _rijndaelEncrypt (word8 a
[4][MAXBC
], int keyBits
, int blockBits
,
37 word8 rk
[MAXROUNDS
+1][4][MAXBC
]);
39 int rijndaelEncryptRound (word8 a
[4][MAXBC
], int keyBits
, int blockBits
,
40 word8 rk
[MAXROUNDS
+1][4][MAXBC
], int rounds
);
42 int _rijndaelDecrypt (word8 a
[4][MAXBC
], int keyBits
, int blockBits
,
43 word8 rk
[MAXROUNDS
+1][4][MAXBC
]);
45 int rijndaelDecryptRound (word8 a
[4][MAXBC
], int keyBits
, int blockBits
,
46 word8 rk
[MAXROUNDS
+1][4][MAXBC
], int rounds
);
53 #endif /* __RIJNDAEL_ALG_H */