| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Enumerations | Functions
CHIP: LPC18xx/43xx AES Engine driver
LPC18xx/43xx chip specific drivers

## Detailed Description

## Enumerations
enum | CHIP_AES_OP_MODE_T { CHIP_AES_API_CMD_ENCODE_ECB, CHIP_AES_API_CMD_DECODE_ECB, CHIP_AES_API_CMD_ENCODE_CBC, CHIP_AES_API_CMD_DECODE_CBC }
| AES Engine operation mode. More...

## Functions
void | Chip_AES_Init (void)
| Initialize the AES Engine function.
uint32_t | Chip_AES_SetMode (CHIP_AES_OP_MODE_T AesMode)
| Set operation mode in AES Engine.
void | Chip_AES_LoadKey (uint32_t keyNum)
| Load 128-bit AES user key in AES Engine.
void | Chip_AES_LoadKeyRNG (void)
| Load randomly generated key in AES engine.
void | Chip_AES_LoadKeySW (uint8_t *pKey)
| Load 128-bit AES software defined user key in AES Engine.
void | Chip_AES_LoadIV_SW (uint8_t *pVector)
| Load 128-bit AES initialization vector in AES Engine.
void | Chip_AES_LoadIV_IC (void)
| Load IC specific 128-bit AES initialization vector in AES Engine.
uint32_t | Chip_AES_Operate (uint8_t *pDatOut, uint8_t *pDatIn, uint32_t Size)
| Operate AES Engine.
uint32_t | Chip_AES_ProgramKey (uint32_t KeyNum, uint8_t *pKey)
| Program 128-bit AES Key in OTP.

## Enumeration Type Documentation

enum CHIP_AES_OP_MODE_T

AES Engine operation mode.

Enumerator:

  CHIP_AES_API_CMD_ENCODE_ECB | ECB Encode mode
  CHIP_AES_API_CMD_DECODE_ECB | ECB Decode mode
  CHIP_AES_API_CMD_ENCODE_CBC | CBC Encode mode
  CHIP_AES_API_CMD_DECODE_CBC | CBC Decode mode

Definition at line 47 of file aes_18xx_43xx.h.

## Function Documentation

void Chip_AES_Init | ( | void |  | ) |

Initialize the AES Engine function.

Returns
  None This function will initialise all the AES Engine driver function pointers and call the AES Engine Initialisation function.

Definition at line 67 of file aes_18xx_43xx.c.

void Chip_AES_LoadIV_IC | ( | void |  | ) |

Load IC specific 128-bit AES initialization vector in AES Engine.

Returns
  None This loads 128-bit AES IC specific initialization vector, which is used to decrypt a boot image

Definition at line 124 of file aes_18xx_43xx.c.

void Chip_AES_LoadIV_SW | ( | uint8_t * | pVector | ) |

Load 128-bit AES initialization vector in AES Engine.

Parameters

  pVector | : Pointer to 16 byte Initialisation vector

Returns
  None

Definition at line 118 of file aes_18xx_43xx.c.

void Chip_AES_LoadKey | ( | uint32_t | keyNum | ) |

Load 128-bit AES user key in AES Engine.

Parameters

  keyNum,: | 0 - Load AES 128-bit user key 1, else load user key2

Returns
  None

Definition at line 95 of file aes_18xx_43xx.c.

void Chip_AES_LoadKeyRNG | ( | void |  | ) |

Load randomly generated key in AES engine.

Returns
  None To update the RNG and load a new random number, the API call Chip_OTP_GenRand should be used

Definition at line 106 of file aes_18xx_43xx.c.

void Chip_AES_LoadKeySW | ( | uint8_t * | pKey | ) |

Load 128-bit AES software defined user key in AES Engine.

Parameters

  pKey | : Pointer to 16 byte user key

Returns
  None

Definition at line 112 of file aes_18xx_43xx.c.

uint32_t Chip_AES_Operate | ( | uint8_t * | pDatOut,
|  | uint8_t * | pDatIn,
|  | uint32_t | Size
| ) |  |

Operate AES Engine.

Parameters

  pDatOut | : Pointer to output data stream
  pDatIn | : Pointer to input data stream
  Size | : Size of the data stream (128-bit)

Returns
  Status This function performs the AES operation after the AES mode has been set using Chip_AES_SetMode and the appropriate keys and init vectors have been loaded

Definition at line 130 of file aes_18xx_43xx.c.

uint32_t Chip_AES_ProgramKey | ( | uint32_t | KeyNum,
|  | uint8_t * | pKey
| ) |  |

Program 128-bit AES Key in OTP.

Parameters

  KeyNum | : Key Number (Select 0 or 1)
  pKey | : Pointer to AES Key (16 bytes required)

Returns
  Status When calling the aes_ProgramKey2 function, ensure that VPP = 2.7 V to 3.6 V.

Definition at line 136 of file aes_18xx_43xx.c.

uint32_t Chip_AES_SetMode | ( | CHIP_AES_OP_MODE_T | AesMode | ) |

Set operation mode in AES Engine.

Parameters

  AesMode | : AES Operation Mode

Returns
  Status

Definition at line 89 of file aes_18xx_43xx.c.