<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Encrypted u-boot with SPL for iMX6UL in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Encrypted-u-boot-with-SPL-for-iMX6UL/m-p/805593#M124356</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some problems for encrypting u-boot with SPL, on iMX6UL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;SIGNING :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have signed u-boot with SPL for iMX6UL, and it works ("No HAB events found" message). I used those 4 files :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;// 1) SPL.log&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;Image Type:&amp;nbsp;&amp;nbsp; Freescale IMX Boot Image&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Image Ver:&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 (i.MX53/6/7 compatible)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Mode:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DCD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Data Size:&amp;nbsp;&amp;nbsp;&amp;nbsp; 53248 Bytes = 52.00 KiB = 0.05 MiB&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Load Address: 00908420&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Entry Point:&amp;nbsp; 00909000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;HAB Blocks:&amp;nbsp;&amp;nbsp; 00908400 00000000 0000ac00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;DCD Blocks:&amp;nbsp;&amp;nbsp; 00910000 0000002c 00000004&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;// 2) SPL.csf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Header]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Version = 4.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Hash Algorithm = sha256&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Engine = ANY&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Engine Configuration = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Certificate Format = X509&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Signature Format = CMS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install SRK]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/SRK_1_2_3_4_table.bin"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Source index = 0&amp;nbsp;&amp;nbsp; &amp;nbsp;# Index of the key location in the SRK table to be installed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install CSFK]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key used to authenticate the CSF data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/CSF1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Authenticate CSF]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install Key]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key slot index used to authenticate the key to be installed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Verification index = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Target key slot in HAB key store where key will be installed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Target index = 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key to install&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/IMG1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Authenticate Data]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key slot index used to authenticate the image data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Verification index = 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Offset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data File Path&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Blocks = 0x00908400&amp;nbsp;&amp;nbsp; 0x00000000&amp;nbsp;&amp;nbsp; 0x0000ac00&amp;nbsp;&amp;nbsp; "SPL"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Unlock]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Engine = CAAM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Features = RNG&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;// 3) u-boot-ivt.img.log&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;Image Name:&amp;nbsp;&amp;nbsp; U-Boot 2017.03-27251-g01c382a fo&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Created:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Fri Jul 27 16:12:28 2018&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Image Type:&amp;nbsp;&amp;nbsp; ARM U-Boot Firmware with HABv4 IVT (uncompressed)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Data Size:&amp;nbsp;&amp;nbsp;&amp;nbsp; 364480 Bytes = 355.94 KiB = 0.35 MiB&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Load Address: 86000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Entry Point:&amp;nbsp; 00000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;HAB Blocks:&amp;nbsp;&amp;nbsp; 0x85ffffc0&amp;nbsp;&amp;nbsp; 0x0000&amp;nbsp;&amp;nbsp; 0x00057020&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;// 4) u-boot-ivt.img.csf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Header]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Version = 4.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Hash Algorithm = sha256&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Engine = ANY&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Engine Configuration = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Certificate Format = X509&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Signature Format = CMS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install SRK]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/SRK_1_2_3_4_table.bin"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Source index = 0&amp;nbsp;&amp;nbsp; &amp;nbsp;# Index of the key location in the SRK table to be installed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install CSFK]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key used to authenticate the CSF data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/CSF1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Authenticate CSF]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install Key]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key slot index used to authenticate the key to be installed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Verification index = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Target key slot in HAB key store where key will be installed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Target index = 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key to install&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/IMG1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Authenticate Data]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key slot index used to authenticate the image data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Verification index = 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Offset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data File Path&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Blocks = 0x85ffffc0&amp;nbsp;&amp;nbsp; 0x0000&amp;nbsp;&amp;nbsp; 0x00057020&amp;nbsp;&amp;nbsp; "u-boot-ivt.img"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;ENCRYPTION :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, I tried to modify u-boot CSF file because I also want to encrypt u-boot. Based on the questions already asked on NXP forum and on others websites, I have tried many things for 2 days but it does NOT work. Here is what I did (in &lt;SPAN style="color: #993300;"&gt;&lt;STRONG&gt;bold&lt;/STRONG&gt;&lt;/SPAN&gt; : added/modified parts - in &lt;SPAN style="color: #ff0000;"&gt;red&lt;/SPAN&gt; : address/length that are probably wrong) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;// 4) u-boot-ivt.img.csf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Header]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Version = 4.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Hash Algorithm = sha256&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Engine = &lt;STRONG&gt;CAAM&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Engine Configuration = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Certificate Format = X509&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Signature Format = CMS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install SRK]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/SRK_1_2_3_4_table.bin"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Source index = 0&amp;nbsp;&amp;nbsp; &amp;nbsp;# Index of the key location in the SRK table to be installed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install CSFK]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key used to authenticate the CSF data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/CSF1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Authenticate CSF]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #800000;"&gt;[Unlock]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Engine = CAAM&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Features = RNG&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install Key]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key slot index used to authenticate the key to be installed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Verification index = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Target key slot in HAB key store where key will be installed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Target index = 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key to install&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/IMG1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #800000;"&gt;[Authenticate Data]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;# Key slot index used to authenticate the image data&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Verification index = 2&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Offset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data File Path&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Blocks = 0x85ffffc0&amp;nbsp;&amp;nbsp; 0x0000&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;0x00000030&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; "u-boot-ivt.img"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;Explanation : 0x30 = 0x2c + 0x4 (see "SPL.log" file)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #800000;"&gt;#Encrypt the boot image and create a DEK&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;[Install Secret Key]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Verification Index = 0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Target Index = 0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Key = "dek.bin"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Key Length = 128&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Blob Address = &lt;SPAN style="color: #ff0000;"&gt;0x86058f98&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;Explanation :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;0x86058f98 = 0x86000000 [load address] - 0x40 [header size] + 0x57020 [uboot size] + 0x2000 [csf size] - 0x48 [blob size]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #800000;"&gt;#Provide DEK blob location to decrypt&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;[Decrypt Data]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Verification Index = 0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Mac Bytes = 16&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Blocks = &lt;SPAN style="color: #ff0000;"&gt;0x86000000&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;0x00000040&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;0x00056fe0&lt;/SPAN&gt; "u-boot-ivt.img"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;Explanation :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;0x86000000 is load address (see "u-boot-ivt.img.log" file)...which is not the same as entry point address (problem ?)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;0x40 = 0x86000000 - 0x85ffffc0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;0x56fe0 = 0x57020 - 0x40&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was followed by the following u-boot commands...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;=&amp;gt; load mmc 0 0x80800000 dek.bin&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;=&amp;gt; dcache off&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;=&amp;gt; icache off&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;=&amp;gt; dek_blob 0x80800000 0x86058f98 128&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;=&amp;gt; fatwrite mmc 0 0x86058f98 dek_blob.bin 0x48&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...and by the following host commands :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;$ objcopy -I binary -O binary --pad-to=0x1fb8 --gap-fill=0x00 u-boot-ivt.img_csf.bin u-boot-ivt.img_csf.bin&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;$ cat u-boot-ivt.img u-boot-ivt.img_csf.bin dek_blob.bin &amp;gt; u-boot-ivt.img_signed_encrypted&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;Explanation : 0x1fb8 [padding] + 0x48 [blob size] = 0x2000 because DEK blob is supposed to be included in CSF region (which size is 0x2000)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;REFERENCES :&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://boundarydevices.com/high-assurance-boot-hab-dummies/" title="https://boundarydevices.com/high-assurance-boot-hab-dummies/"&gt;High Assurance Boot (HAB) for dummies - Boundary Devices&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://freescale.jiveon.com/docs/DOC-330622" title="https://freescale.jiveon.com/docs/DOC-330622"&gt;Encrypted boot loader on SabreSD i.MX6q board | NXP Community&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-332147"&gt;Encrypted U-boot Example&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-330622"&gt;Encrypted boot loader on SabreSD i.MX6q board&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/theopolis/u-boot/blob/master/doc/README.mxc_hab" title="https://github.com/theopolis/u-boot/blob/master/doc/README.mxc_hab"&gt;u-boot/README.mxc_hab at master · theopolis/u-boot · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="link-titled" href="https://community.nxp.com/message/845992?commentID=845992#comment-845992" title="https://community.nxp.com/message/845992?commentID=845992#comment-845992"&gt;https://community.nxp.com/message/845992?commentID=845992#comment-845992&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/395507"&gt;Signed and encrypted boot in i.MX6UL&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/438580"&gt;Multi-stage Secure Boot in iMX6 through SPL &amp;amp;amp; u-boot.img&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;QUESTIONS (to make u-boot encryption work) :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) What value should I use for :&lt;/P&gt;&lt;P&gt;- authenticated data length (instead of 0x30, if it is wrong) ?&lt;/P&gt;&lt;P&gt;- decrypted data start address (instead of 0x86000000, if it is wrong) ?&lt;/P&gt;&lt;P&gt;- offset for decryption (instead of 0x40, if it is wrong) ?&lt;/P&gt;&lt;P&gt;- decrypted data length (instead of 0x56fe0, if it is wrong) ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Is there anything else to modify in u-boot CSF file ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Is there anything to modify in SPL CSF file ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Is there anything else that I am missing ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be appreciated... :-)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Julien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Aug 2018 10:31:11 GMT</pubDate>
    <dc:creator>julienpanis</dc:creator>
    <dc:date>2018-08-01T10:31:11Z</dc:date>
    <item>
      <title>Encrypted u-boot with SPL for iMX6UL</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Encrypted-u-boot-with-SPL-for-iMX6UL/m-p/805593#M124356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some problems for encrypting u-boot with SPL, on iMX6UL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;SIGNING :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have signed u-boot with SPL for iMX6UL, and it works ("No HAB events found" message). I used those 4 files :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;// 1) SPL.log&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;Image Type:&amp;nbsp;&amp;nbsp; Freescale IMX Boot Image&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Image Ver:&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 (i.MX53/6/7 compatible)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Mode:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DCD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Data Size:&amp;nbsp;&amp;nbsp;&amp;nbsp; 53248 Bytes = 52.00 KiB = 0.05 MiB&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Load Address: 00908420&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Entry Point:&amp;nbsp; 00909000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;HAB Blocks:&amp;nbsp;&amp;nbsp; 00908400 00000000 0000ac00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;DCD Blocks:&amp;nbsp;&amp;nbsp; 00910000 0000002c 00000004&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;// 2) SPL.csf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Header]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Version = 4.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Hash Algorithm = sha256&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Engine = ANY&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Engine Configuration = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Certificate Format = X509&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Signature Format = CMS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install SRK]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/SRK_1_2_3_4_table.bin"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Source index = 0&amp;nbsp;&amp;nbsp; &amp;nbsp;# Index of the key location in the SRK table to be installed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install CSFK]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key used to authenticate the CSF data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/CSF1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Authenticate CSF]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install Key]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key slot index used to authenticate the key to be installed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Verification index = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Target key slot in HAB key store where key will be installed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Target index = 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key to install&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/IMG1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Authenticate Data]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key slot index used to authenticate the image data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Verification index = 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Offset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data File Path&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Blocks = 0x00908400&amp;nbsp;&amp;nbsp; 0x00000000&amp;nbsp;&amp;nbsp; 0x0000ac00&amp;nbsp;&amp;nbsp; "SPL"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Unlock]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Engine = CAAM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Features = RNG&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;// 3) u-boot-ivt.img.log&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;Image Name:&amp;nbsp;&amp;nbsp; U-Boot 2017.03-27251-g01c382a fo&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Created:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Fri Jul 27 16:12:28 2018&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Image Type:&amp;nbsp;&amp;nbsp; ARM U-Boot Firmware with HABv4 IVT (uncompressed)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Data Size:&amp;nbsp;&amp;nbsp;&amp;nbsp; 364480 Bytes = 355.94 KiB = 0.35 MiB&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Load Address: 86000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Entry Point:&amp;nbsp; 00000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;HAB Blocks:&amp;nbsp;&amp;nbsp; 0x85ffffc0&amp;nbsp;&amp;nbsp; 0x0000&amp;nbsp;&amp;nbsp; 0x00057020&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;// 4) u-boot-ivt.img.csf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Header]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Version = 4.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Hash Algorithm = sha256&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Engine = ANY&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Engine Configuration = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Certificate Format = X509&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Signature Format = CMS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install SRK]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/SRK_1_2_3_4_table.bin"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Source index = 0&amp;nbsp;&amp;nbsp; &amp;nbsp;# Index of the key location in the SRK table to be installed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install CSFK]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key used to authenticate the CSF data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/CSF1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Authenticate CSF]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install Key]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key slot index used to authenticate the key to be installed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Verification index = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Target key slot in HAB key store where key will be installed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Target index = 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key to install&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/IMG1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Authenticate Data]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key slot index used to authenticate the image data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Verification index = 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Offset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data File Path&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Blocks = 0x85ffffc0&amp;nbsp;&amp;nbsp; 0x0000&amp;nbsp;&amp;nbsp; 0x00057020&amp;nbsp;&amp;nbsp; "u-boot-ivt.img"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;ENCRYPTION :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, I tried to modify u-boot CSF file because I also want to encrypt u-boot. Based on the questions already asked on NXP forum and on others websites, I have tried many things for 2 days but it does NOT work. Here is what I did (in &lt;SPAN style="color: #993300;"&gt;&lt;STRONG&gt;bold&lt;/STRONG&gt;&lt;/SPAN&gt; : added/modified parts - in &lt;SPAN style="color: #ff0000;"&gt;red&lt;/SPAN&gt; : address/length that are probably wrong) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;// 4) u-boot-ivt.img.csf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;//============================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Header]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Version = 4.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Hash Algorithm = sha256&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Engine = &lt;STRONG&gt;CAAM&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Engine Configuration = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Certificate Format = X509&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Signature Format = CMS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install SRK]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/SRK_1_2_3_4_table.bin"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Source index = 0&amp;nbsp;&amp;nbsp; &amp;nbsp;# Index of the key location in the SRK table to be installed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install CSFK]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key used to authenticate the CSF data&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/CSF1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Authenticate CSF]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #800000;"&gt;[Unlock]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Engine = CAAM&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Features = RNG&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Install Key]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key slot index used to authenticate the key to be installed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Verification index = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Target key slot in HAB key store where key will be installed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;Target index = 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;# Key to install&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;File = "../../crts/IMG1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #800000;"&gt;[Authenticate Data]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;# Key slot index used to authenticate the image data&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Verification index = 2&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Offset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data File Path&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Blocks = 0x85ffffc0&amp;nbsp;&amp;nbsp; 0x0000&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;0x00000030&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; "u-boot-ivt.img"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;Explanation : 0x30 = 0x2c + 0x4 (see "SPL.log" file)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #800000;"&gt;#Encrypt the boot image and create a DEK&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;[Install Secret Key]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Verification Index = 0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Target Index = 0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Key = "dek.bin"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Key Length = 128&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Blob Address = &lt;SPAN style="color: #ff0000;"&gt;0x86058f98&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;Explanation :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;0x86058f98 = 0x86000000 [load address] - 0x40 [header size] + 0x57020 [uboot size] + 0x2000 [csf size] - 0x48 [blob size]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #800000;"&gt;#Provide DEK blob location to decrypt&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;[Decrypt Data]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Verification Index = 0&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Mac Bytes = 16&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="color: #800000;"&gt;Blocks = &lt;SPAN style="color: #ff0000;"&gt;0x86000000&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;0x00000040&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;0x00056fe0&lt;/SPAN&gt; "u-boot-ivt.img"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;Explanation :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;0x86000000 is load address (see "u-boot-ivt.img.log" file)...which is not the same as entry point address (problem ?)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;0x40 = 0x86000000 - 0x85ffffc0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;0x56fe0 = 0x57020 - 0x40&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was followed by the following u-boot commands...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;=&amp;gt; load mmc 0 0x80800000 dek.bin&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;=&amp;gt; dcache off&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;=&amp;gt; icache off&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;=&amp;gt; dek_blob 0x80800000 0x86058f98 128&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;=&amp;gt; fatwrite mmc 0 0x86058f98 dek_blob.bin 0x48&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...and by the following host commands :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;$ objcopy -I binary -O binary --pad-to=0x1fb8 --gap-fill=0x00 u-boot-ivt.img_csf.bin u-boot-ivt.img_csf.bin&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;$ cat u-boot-ivt.img u-boot-ivt.img_csf.bin dek_blob.bin &amp;gt; u-boot-ivt.img_signed_encrypted&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;Explanation : 0x1fb8 [padding] + 0x48 [blob size] = 0x2000 because DEK blob is supposed to be included in CSF region (which size is 0x2000)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;REFERENCES :&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://boundarydevices.com/high-assurance-boot-hab-dummies/" title="https://boundarydevices.com/high-assurance-boot-hab-dummies/"&gt;High Assurance Boot (HAB) for dummies - Boundary Devices&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://freescale.jiveon.com/docs/DOC-330622" title="https://freescale.jiveon.com/docs/DOC-330622"&gt;Encrypted boot loader on SabreSD i.MX6q board | NXP Community&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-332147"&gt;Encrypted U-boot Example&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-330622"&gt;Encrypted boot loader on SabreSD i.MX6q board&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/theopolis/u-boot/blob/master/doc/README.mxc_hab" title="https://github.com/theopolis/u-boot/blob/master/doc/README.mxc_hab"&gt;u-boot/README.mxc_hab at master · theopolis/u-boot · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="link-titled" href="https://community.nxp.com/message/845992?commentID=845992#comment-845992" title="https://community.nxp.com/message/845992?commentID=845992#comment-845992"&gt;https://community.nxp.com/message/845992?commentID=845992#comment-845992&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/395507"&gt;Signed and encrypted boot in i.MX6UL&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/438580"&gt;Multi-stage Secure Boot in iMX6 through SPL &amp;amp;amp; u-boot.img&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;QUESTIONS (to make u-boot encryption work) :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) What value should I use for :&lt;/P&gt;&lt;P&gt;- authenticated data length (instead of 0x30, if it is wrong) ?&lt;/P&gt;&lt;P&gt;- decrypted data start address (instead of 0x86000000, if it is wrong) ?&lt;/P&gt;&lt;P&gt;- offset for decryption (instead of 0x40, if it is wrong) ?&lt;/P&gt;&lt;P&gt;- decrypted data length (instead of 0x56fe0, if it is wrong) ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Is there anything else to modify in u-boot CSF file ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Is there anything to modify in SPL CSF file ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Is there anything else that I am missing ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be appreciated... :-)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Julien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2018 10:31:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Encrypted-u-boot-with-SPL-for-iMX6UL/m-p/805593#M124356</guid>
      <dc:creator>julienpanis</dc:creator>
      <dc:date>2018-08-01T10:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Encrypted u-boot with SPL for iMX6UL</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Encrypted-u-boot-with-SPL-for-iMX6UL/m-p/805594#M124357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the last version of what I did (which still does &lt;SPAN style="text-decoration: underline;"&gt;NOT&lt;/SPAN&gt; work)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the memory layout picture to make things clear...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If somebody has any idea to help me... :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;&lt;STRONG&gt;//============================&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;&lt;STRONG&gt;// 1) SPL.csf&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;&lt;STRONG&gt;//============================&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Header]&lt;BR /&gt;Version = 4.1&lt;BR /&gt;Hash Algorithm = sha256&lt;BR /&gt;Engine = CAAM&lt;BR /&gt;Engine Configuration = 0&lt;BR /&gt;Certificate Format = X509&lt;BR /&gt;Signature Format = CMS&lt;BR /&gt;&lt;BR /&gt;[Install SRK]&lt;BR /&gt;File = "../../crts/SRK_1_2_3_4_table.bin"&lt;BR /&gt;Source index = 0&amp;nbsp;&amp;nbsp; &amp;nbsp;# Index of the key location in the SRK table to be installed&lt;BR /&gt;&lt;BR /&gt;[Install CSFK]&lt;BR /&gt;# Key used to authenticate the CSF data&lt;BR /&gt;File = "../../crts/CSF1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;BR /&gt;&lt;BR /&gt;[Authenticate CSF]&lt;BR /&gt;&lt;BR /&gt;[Install Key]&lt;BR /&gt;# Key slot index used to authenticate the key to be installed&lt;BR /&gt;Verification index = 0&lt;BR /&gt;# Target key slot in HAB key store where key will be installed&lt;BR /&gt;Target index = 2&lt;BR /&gt;# Key to install&lt;BR /&gt;File = "../../crts/IMG1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;BR /&gt;&lt;BR /&gt;[Unlock]&lt;BR /&gt;Engine = CAAM&lt;BR /&gt;Features = RNG&lt;BR /&gt;&lt;BR /&gt;[Authenticate Data]&lt;BR /&gt;# Key slot index used to authenticate the header&lt;BR /&gt;Verification index = 2&lt;BR /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Offset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data File Path&lt;BR /&gt;&lt;STRONG&gt;Blocks = 0x00908400&amp;nbsp;&amp;nbsp; 0x00000000&amp;nbsp;&amp;nbsp; 0x00000c00&amp;nbsp;&amp;nbsp; "SPL"&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;#Encrypt the SPL image and create a DEK&lt;BR /&gt;[Install Secret Key]&lt;BR /&gt;Verification Index = 0&lt;BR /&gt;Target Index = 0&lt;BR /&gt;Key = "dek.bin"&lt;BR /&gt;Key Length = 128&lt;BR /&gt;&lt;STRONG&gt;Blob Address = 0x00914fb8&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;#Provide DEK blob location to decrypt&lt;BR /&gt;[Decrypt Data]&lt;BR /&gt;Verification Index = 0&lt;BR /&gt;Mac Bytes = 16&lt;BR /&gt;&lt;STRONG&gt;Blocks = 0x00909000 0x00000c00 0x0000a000 "SPL"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;&lt;STRONG&gt;//============================&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;&lt;STRONG&gt;// 2) u-boot-ivt.csf&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;&lt;STRONG&gt;//============================&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;[Header]&lt;BR /&gt;Version = 4.1&lt;BR /&gt;Hash Algorithm = sha256&lt;BR /&gt;Engine = CAAM&lt;BR /&gt;Engine Configuration = 0&lt;BR /&gt;Certificate Format = X509&lt;BR /&gt;Signature Format = CMS&lt;BR /&gt;&lt;BR /&gt;[Install SRK]&lt;BR /&gt;File = "../../crts/SRK_1_2_3_4_table.bin"&lt;BR /&gt;Source index = 0&amp;nbsp;&amp;nbsp; &amp;nbsp;# Index of the key location in the SRK table to be installed&lt;BR /&gt;&lt;BR /&gt;[Install CSFK]&lt;BR /&gt;# Key used to authenticate the CSF data&lt;BR /&gt;File = "../../crts/CSF1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;BR /&gt;&lt;BR /&gt;[Authenticate CSF]&lt;BR /&gt;&lt;BR /&gt;[Install Key]&lt;BR /&gt;# Key slot index used to authenticate the key to be installed&lt;BR /&gt;Verification index = 0&lt;BR /&gt;# Target key slot in HAB key store where key will be installed&lt;BR /&gt;Target index = 2&lt;BR /&gt;# Key to install&lt;BR /&gt;File = "../../crts/IMG1_1_sha256_4096_65537_v3_usr_crt.pem"&lt;BR /&gt;&lt;BR /&gt;[Unlock]&lt;BR /&gt;Engine = CAAM&lt;BR /&gt;Features = RNG&lt;BR /&gt;&lt;BR /&gt;[Authenticate Data]&lt;BR /&gt;# Key slot index used to authenticate the IVT&lt;BR /&gt;Verification index = 2&lt;BR /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Offset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data File Path&lt;BR /&gt;&lt;STRONG&gt;Blocks = 0x86056fc0&amp;nbsp;&amp;nbsp; 0x00057000&amp;nbsp;&amp;nbsp; 0x00000020&amp;nbsp;&amp;nbsp; "u-boot-ivt.img"&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;#Encrypt the boot image and create a DEK&lt;BR /&gt;[Install Secret Key]&lt;BR /&gt;Verification Index = 0&lt;BR /&gt;Target Index = 0&lt;BR /&gt;Key = "dek.bin"&lt;BR /&gt;Key Length = 128&lt;BR /&gt;&lt;STRONG&gt;Blob Address = 0x86058f98&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;#Provide DEK blob location to decrypt&lt;BR /&gt;[Decrypt Data]&lt;BR /&gt;Verification Index = 0&lt;BR /&gt;Mac Bytes = 16&lt;BR /&gt;&lt;STRONG&gt;Blocks = 0x86000000 0x00000040 0x00056fc0 "u-boot-ivt.img"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;&lt;SPAN style="color: #000000; text-decoration: underline;"&gt;STEPS :&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="font-size: 13px;"&gt;1-2) ... [cst tool used to generate files, included a signed zImage]&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="font-size: 13px;"&gt;3) Copy DEK onto SD card :&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;sudo cp dek_SPL.bin /media/julien/BOOT-VARSOM/dek_SPL.bin&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;sudo cp dek_u-boot-ivt.img.bin /media/julien/BOOT-VARSOM/dek_u-boot-ivt.img.bin&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="font-size: 13px;"&gt;4) Power on the board from eMMC, and press any key to enter into u-boot prompt :&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="font-size: 13px;"&gt;4.1) Load DEK binary from SD card&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;=&amp;gt; load mmc 0 0x909000 dek_SPL.bin&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;=&amp;gt; load mmc 0 0x86000000 dek_u-boot-ivt.img.bin&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="font-size: 13px;"&gt;4.2) Disable cache memory&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;=&amp;gt; icache off&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;=&amp;gt; dcache off&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="font-size: 13px;"&gt;4.3) Create DEK blob&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;=&amp;gt; dek_blob 0x909000 0x914fb8 128&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;=&amp;gt; dek_blob 0x86000000 0x86058f98 128&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="font-size: 13px;"&gt;4.4) Copy DEK blob binary onto SD card&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;=&amp;gt; fatwrite mmc 0 0x914fb8 dek_blob_SPL.bin 0x48&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;=&amp;gt; fatwrite mmc 0 0x86058f98 dek_blob_u-boot-ivt.img.bin 0x48&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="font-size: 13px;"&gt;5) Back on host, copy DEK blob from SD card :&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;sudo cp /media/julien/BOOT-VARSOM/dek_blob_SPL.bin ./dek_blob_SPL.bin&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;sudo cp /media/julien/BOOT-VARSOM/dek_blob_u-boot-ivt.img.bin ./dek_blob_u-boot-ivt.img.bin&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="font-size: 13px;"&gt;6) Pad CSF :&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;objcopy -I binary -O binary --pad-to=0x1fb8 --gap-fill=0x00 SPL_csf.bin SPL_csf.bin&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;objcopy -I binary -O binary --pad-to=0x1fb8 --gap-fill=0x00 u-boot-ivt.img_csf.bin u-boot-ivt.img_csf.bin&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="font-size: 13px;"&gt;7) Concatenate [Image + CSF + DEK blob] to generate [Image_signed_encrypted] :&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;cat SPL SPL_csf.bin dek_blob_SPL.bin &amp;gt; SPL_signed_encrypted&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;cat u-boot-ivt.img u-boot-ivt.img_csf.bin dek_blob_u-boot-ivt.img.bin &amp;gt; u-boot-ivt.img_signed_encrypted&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="font-size: 13px;"&gt;8) Copy images onto SD card :&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;sudo cp zImage-ivt_signed /media/julien/rootfs/opt/images/Debian/zImage&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;sudo cp SPL_signed_encrypted /media/julien/rootfs/opt/images/Debian/SPL.mmc&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="color: #330099; font-size: 13px; font-family: Liberation Mono, monospace;"&gt;&lt;SPAN&gt;sudo cp u-boot-ivt.img_signed_encrypted /media/julien/rootfs/opt/images/Debian/u-boot.img.mmc&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;/P&gt;&lt;P align="left" style="margin-bottom: 0in; font-weight: normal; line-height: 100%;"&gt;&lt;SPAN style="font-size: 13px;"&gt;9) Power on the board from SD card, and flash images onto eMMC&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Julien&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2018 14:49:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Encrypted-u-boot-with-SPL-for-iMX6UL/m-p/805594#M124357</guid>
      <dc:creator>julienpanis</dc:creator>
      <dc:date>2018-08-02T14:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Encrypted u-boot with SPL for iMX6UL</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Encrypted-u-boot-with-SPL-for-iMX6UL/m-p/805595#M124358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; If You use the CST 3.0 - please try the previous release CST 2.3&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Have a great day,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Yuri&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Note: If this post answers your question, please click the Correct Answer &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;button. Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2018 07:51:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Encrypted-u-boot-with-SPL-for-iMX6UL/m-p/805595#M124358</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2018-08-17T07:51:22Z</dc:date>
    </item>
  </channel>
</rss>

