1/* 2 * aes.h 3 * AES encrypt/decrypt wrapper functions used around Rijndael reference 4 * implementation 5 * 6 * Copyright 2003, Broadcom Corporation 7 * All Rights Reserved. 8 * 9 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation; the 10 * contents of this file may not be disclosed to third parties, copied or 11 * duplicated in any form, in whole or in part, without the prior written 12 * permission of Broadcom Corporation. 13 * 14 * $Id: aes.h,v 1.1.1.1 2008/10/15 03:31:22 james26_jang Exp $ 15 */ 16 17#ifndef _AES_H_ 18#define _AES_H_ 19 20#include <typedefs.h> 21/* For size_t */ 22#include <stddef.h> 23 24#define AES_BLOCK_SZ 16 25#define AES_BLOCK_BITLEN (AES_BLOCK_SZ * 8) 26#define AES_KEY_BITLEN(kl) (kl * 8) 27#define AES_ROUNDS(kl) ((AES_KEY_BITLEN(kl) / 32) + 6) 28#define AES_MAXROUNDS 14 29 30void aes_encrypt(const size_t KL, const uint8 *K, const uint8 *ptxt, uint8 *ctxt); 31void aes_decrypt(const size_t KL, const uint8 *K, const uint8 *ctxt, uint8 *ptxt); 32 33#define aes_block_encrypt(nr, rk, ptxt, ctxt) rijndaelEncrypt(rk, nr, ptxt, ctxt) 34#define aes_block_decrypt(nr, rk, ctxt, ptxt) rijndaelDecrypt(rk, nr, ctxt, ptxt) 35 36#endif /* _AES_H_ */ 37 38