![NXP Semiconductors LPC43Sxx Скачать руководство пользователя страница 113](http://html1.mh-extra.com/html/nxp-semiconductors/lpc43sxx/lpc43sxx_user-manual_1721827113.webp)
UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2015. All rights reserved.
User manual
Rev. 2.1 — 10 December 2015
113 of 1441
NXP Semiconductors
UM10503
Chapter 8: LPC43Sxx Security API
3. If using CBC encode or decode, load an initialization vector:
–
aes_LoadIV_SW
loads a vector generated by the user code.
–
aes_LoadIV_IC
loads a vector generated from the unique part id.
4. Define the AES mode by calling aes_SetMode.
Select encryption or decryption and the encoding algorithm (ECB or CBC).
5. Set up the channel_id parameter with the DMA channel, the peripheral source and
destination numbers, and the DMA input mux settings.
6. Configure the GPDMA by calling
aes_Config_DMA
.
7. Run the AES engine by calling
aes_Operate_DMA
.
The AES engine reads the data from a specified memory location and copies the
encrypted or decrypted data to another memory location in 128-bit blocks.
8. Check whether the AES is done by calling
aes_Get_Status_DMA
.
8.5.3 AES Decryption
Secure boot authenticates and decrypts the boot image. See
AES decryption can also be used on non-image data. It is possible to decrypt a frame of
Cipher Text independent of other Cipher Text frames. This is useful when a random frame
needs to be accessed.
8.5.4 Use of AES keys
The two hardware keys stored in OTP cannot be accessed by software and offer a high
security level. Key1 is stored encrypted in the OTP and offers the highest security level.
The software key is a software defined AES key. Since this key is visible to software, it is
less secure than the hardware defined keys in OTP. However, the OTP can only store two
keys whereas multiple keys can be stored in software.
The 128-bit AES initialization vector iv is used to randomize the encryption when the same
data is encrypted multiple times. The init vector does not have to be secret and is also
used to decrypt the data. For the CMAC calculation, an AES initialization vector of iv = 0 is
used.
For the LPC43Sxx image, a user specific iv is used:
iv = AES
-1
(User Key, 1)
8.5.5 Endianness
The AES engine is capable of processing 128-bit (16-byte) blocks per operation. To
load/store an AES block, the 32-bit infrastructure is fully used. For convenience, the API
interface uses byte order rather than word order. The API passes/obtains a pointer to an
array of bytes, and the AES low-level driver type-casts the pointer to an unsigned 32-bit
array.
shows 16-byte data AES encryption with a 16-byte key. For simplicity,
data and key bytes are chosen in incrementing order starting from 00.