/************************************************************************************ * SecurityLib implements AES and CCM* functionality. The functions are avaliable to * all higher layers. The AES module is not reentrant. * * Author(s): JRJEN1, BPPED1 * * (c) Copyright 2005, Freescale, Inc. All rights reserved. * * Freescale Confidential Proprietary * Digianswer Confidential * * No part of this document must be reproduced in any form - including copied, * transcribed, printed or by any electronic means - without specific written * permission from Freescale. * * Last Inspected: * Last Tested: ************************************************************************************/ extern const unsigned char scr1; extern const unsigned char scr2; /************************************************************************************ ************************************************************************************* * Public prototypes ************************************************************************************* it will process the result in about 8000 cycles on the current platform. Please note that the function: 1) Always uses 128 bit (16 bytes) inputs/output. 2) Is not re-entrant (and is not re-entrant with execution of the CCMStar function either). 3) It is allowed to set the ReturnData pointer to the same memory as either Data or Key if wanted. ************************************************************************************/ /************************************************************************************ * Perform AES-128 cryptographic operation on a data set. Optimized for 8 bit * processors. The result will be processed in about 8000 cycles on the HCS08 platform * Please note that for HCS08 projects the architecture definitions must locate the * internal buffers (MY_ZEROPAGE) in lower memory space for correct linking. * * Interface assumptions: * All input/outputs are 16 bytes (128 bit). * Please note that the function is not re-entrant. Also, it is of course not re- * entrant with other functions calling this function (like SecLib_CcmStar). * It is allowed to point the ReturnData pointer to the same memory as either Data or * Key if wanted. * * Return value: * None * * Revision history: * date Author Comments * ------ ------ -------- * 011004 TOJ Created * 050405 JRJ/BPP Moved/Renamed/Commented * ************************************************************************************/ void SecLib_Aes(const unsigned char *pData, const unsigned char *pKey, unsigned char *pReturnData); unsigned char s_Box(unsigned char x); #define scramble1(x) (x^scr1) #define scramble2(x) (x^scr2)