UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2012. All rights reserved.
User manual
Rev. 1.3 — 6 July 2012
49 of 1269
NXP Semiconductors
UM10503
Chapter 6: LPC43xx Security API
6.5 Functional description
6.5.1 AES Decryption
The data is decrypted using the following steps (see
1. Decrypt the Header using AES with the user key (AES user key1 stored in OTP (see
)) as AES key and iv=0. The Header provides the HASH_VALUE and the
HASH_SIZE over which the CMAC is calculated.
2. In the Header, replace HASH_VALUE by the constant 0x3456789A.
3. Encrypt the Header using AES with the user Key as AES key and iv=0.
4. Calculate the CMAC tag as defined in
and confirm that the 64 MSB are
equal to HASH_VALUE, if not then reset the device.
5. Decrypt the Cipher Text frames using CBC AES with the user Key as AES key and the
iv as defined in
. The number of frames to decrypt is given by the value
HASH_SIZE. If more frames need to be decrypted then this needs to be done by the
application.
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.
aes_Operate
0x1C
Performs the AES decryption after the AES mode has
been set using aes_Set_Mode and the appropriate keys
and init vectors have been loaded.
Parameter1 - unsigned char *data_out
Parameter2 - unsigned char *data_in
Parameter3 - unsigned size (128-bit word - 16 byte)
Return - unsigned: see general error codes.
aes_ProgramKey1
0x20
Programs 128-bit AES key in OTP.
Parameter: unsigned char *key (16 byte)
Return - unsigned: see general error codes.
Remark:
When calling the aes_ProgramKey1 function,
ensure that VPP = 2.7 V to 3.6 V.
aes_ProgramKey2
0x24
Programs 128-bit AES key in OTP.
Parameter: unsigned char *key (16 byte)
Return - unsigned: see general error codes.
Remark:
When calling the aes_ProgramKey2 function,
ensure that VPP = 2.7 V to 3.6 V.
Table 23.
Security API calls
Function
Offset relative to
the API entry
point
Description