![NXP Semiconductors LCP43 Series User Manual Download Page 51](http://html1.mh-extra.com/html/nxp-semiconductors/lcp43-series/lcp43-series_user-manual_1721817051.webp)
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
51 of 1269
NXP Semiconductors
UM10503
Chapter 6: LPC43xx Security API
1. Divide message into b-bit blocks M = M
1
|| … || M
n-1
|| M
n
* where M
1
, …, M
n-1
are
complete blocks.
2. M
n
= K
1
M
n
*
3. Set c
0
= 00...0 (binary).
4. For i = 1,…, n, calculate c
i
= E
k
(c
i-1
M
i
).
5. Output T = MSB
l
(c
n
).
.
Verify the CMAC tag
An encrypted image is authenticated by the boot code.:
6.5.3 Use of AES keys
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 init 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, a user specific iv is used:
iv = AES
-1
(User Key, 1)
6.5.4 Endianess
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.
Fig 21. CMAC generation
M
1
AES
K
+
M
2
AES
K
+
M*
n
AES
K
K
1
MSB
64
Tag