1 /** @file rijndael.h 2 * 3 * @brief This file contains the function optimised ANSI C code for the Rijndael cipher (now AES) 4 * 5 * Copyright (C) 2014-2017, Marvell International Ltd. 6 * 7 * This software file (the "File") is distributed by Marvell International 8 * Ltd. under the terms of the GNU General Public License Version 2, June 1991 9 * (the "License"). You may use, redistribute and/or modify this File in 10 * accordance with the terms and conditions of the License, a copy of which 11 * is available by writing to the Free Software Foundation, Inc., 12 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the 13 * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 14 * 15 * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE 16 * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE 17 * ARE EXPRESSLY DISCLAIMED. The License provides additional details about 18 * this warranty disclaimer. 19 */ 20 21 /****************************************************** 22 Change log: 23 03/07/2014: Initial version 24 ******************************************************/ 25 26 #ifndef __RIJNDAEL_H 27 #define __RIJNDAEL_H 28 #include "wltypes.h" 29 30 #define MAXKC (256/32) 31 #define MAXKB (256/8) 32 #define MAXNR 14 33 /* 34 typedef unsigned char u8; 35 typedef unsigned short u16; 36 typedef unsigned int u32; 37 */ 38 /* The structure for key information */ 39 typedef struct { 40 int decrypt; 41 int Nr; /* key-length-dependent number of rounds */ 42 UINT key[4 * (MAXNR + 1)]; /* encrypt or decrypt key schedule */ 43 } rijndael_ctx; 44 45 void rijndael_set_key(rijndael_ctx *, UINT8 *, int, int); 46 void rijndael_decrypt(rijndael_ctx *, UINT8 *, UINT8 *); 47 void rijndael_encrypt(rijndael_ctx *, UINT8 *, UINT8 *); 48 49 #endif /* __RIJNDAEL_H */ 50