![NXP Semiconductors LPC43Sxx Скачать руководство пользователя страница 104](http://html1.mh-extra.com/html/nxp-semiconductors/lpc43sxx/lpc43sxx_user-manual_1721827104.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
104 of 1441
NXP Semiconductors
UM10503
Chapter 7: LPC43Sxx Boot ROM for secure parts
The authentication process works as follows:
1. Use the CMAC algorithm to generate the 128-bit tag. Truncate the tag to 64 MSB and
insert this truncated tag in the header.
2. At boot time the tag is recalculated. Authentication passes when the calculated tag is
equal to the received tag in the image header.
To generate an l-bit CMAC tag T of message M using a 128-bit block cipher AES and
secret key K, the CMAC tag generation process works as follows:
1. Generate sub key K
1
:
–
Calculate a temporary value K
0
= AES
K
(0).
–
If msb(K
0
) = 0 then K
1
= (K
0
<< 1) else K
1
= (K
0
<< 1)
0x87
2. Divide message into 128-bit blocks M = M
1
|| ... || M
n-1
|| M
n
*, where M
1
...M
n-1
are
complete blocks.
3. The last block, M
n
*, should be padded to be a complete block and then M
n
= K
1
M
n
*.
4. Let c
0
= 00...0.
5. For i = 1, ..., n, calculate c
i
= AES
K
(c
i-1
M
i
).
6. Output T = msb
l
(c
n
).
The first message block is the header. Since the CMAC tag is stored in the header field
HASH_VALUE, and this tag is not yet known until after CMAC calculation, a temporary
header with a dummy tag value of 0x3456789A is used during CMAC calculation. This
dummy value should be replaced by the calculated tag value in the final header field
HASH_VALUE.
For LPC43xx the chosen CMAC parameters are: encryption key K = User Key (AES key1,
same as used for decryption) and tag length l = 64. Data is processed in little endian
mode. This means that the first byte read from the image is integrated into the AES
codeword as least significant byte. The 16th byte read from the image is the most
significant byte of the first AES codeword.
CMAC is calculated over the header and encrypted image.
7.3.5 Boot process timing
The following parameters describe the timing of the boot process:
Fig 28. CMAC generation
M
1
AES
K
+
M
2
AES
K
+
M*
n
AES
K
K
1
MSB
64
Tag