本例程参考TI cc2538_foundation_firmware_1_0_1_0\driverlib\cc2538\examples\ccm例程修改而来;
创建c文件,和第五部做法一样,TinyOS直接使用C文件;
cc2538_ccm.h文件:
#ifndef CC2538AES_CCM_H
#define CC2538AES_CCM_H
#ifdef CC2538_HW_SECURITY
#define AUTHENTICATION_LENTH 0X4
typedef struct
{
uint8_t ui8CCMKey[16]; // Key
uint8_t ui8CCMMval; // length of authentication
uint8_t ui8CCMN[13]; // Nonce
uint8_t* ui8CCMA; // Additional data
uint8_t* ui8CCMInPut; // input message
uint16_t ui16CCMInPutLen; // length of message
uint16_t ui16CCMLenA; // length of additional data
uint8_t ui8CCMKeyLocation;