<?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 boot in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Encrypted-boot/m-p/448792#M69382</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using CST to generate encrypted image. I am setting MAC = 16 bytes in my CSF. However, I see 32 bytes of MAC being generated in the CSF output. I see a constant 4 byte pattern and the rest 28 bytes of random data. Any idea where the MAC data is put in these bytes, and what the extra bytes are?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Jul 2015 16:15:28 GMT</pubDate>
    <dc:creator>sara</dc:creator>
    <dc:date>2015-07-01T16:15:28Z</dc:date>
    <item>
      <title>Encrypted boot</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Encrypted-boot/m-p/448792#M69382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using CST to generate encrypted image. I am setting MAC = 16 bytes in my CSF. However, I see 32 bytes of MAC being generated in the CSF output. I see a constant 4 byte pattern and the rest 28 bytes of random data. Any idea where the MAC data is put in these bytes, and what the extra bytes are?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 16:15:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Encrypted-boot/m-p/448792#M69382</guid>
      <dc:creator>sara</dc:creator>
      <dc:date>2015-07-01T16:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Encrypted boot</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Encrypted-boot/m-p/448793#M69383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sara,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am assuming that you are referring to csf.bin.&amp;nbsp; And that the [Decrypt Data] command is the last command on your CSF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When in the presence of [Decrypt Data], CST will encrypt the data blocks in-place(data blocks in the input file are replaced by their encrypted version), using the data encryption key. And it also generates a MAC tag of the file and appends it to the CSF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, at boot time HAB&amp;nbsp; needs to know what algorithm and what size use to authenticate the MAC.&amp;nbsp; Let's take the following example of&amp;nbsp; csf.bin:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AC 00 24 41&amp;nbsp; 00 0C 00 10&amp;nbsp; 54 46 4E 21 27 6D C9 16&amp;nbsp; CA A0 BE 70&amp;nbsp; 11 DE 64 1A&amp;nbsp; F2 20 D4 93&amp;nbsp; B1 DB C3 75&amp;nbsp; 98 72 E5 F3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we parse the HAB data structure, it would be like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AC 00 24 41&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[HAB_TAG_MAC] [LENGTH][VERSION]&lt;/P&gt;&lt;P&gt;HAB_TAG_MAC =&lt;STRONG&gt; 0xAC&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;length = &lt;STRONG&gt;0x0024&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;version = &lt;STRONG&gt;0x41&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So this part of the structure is the 4 byte pattern that you probably are looking at.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HAB uses CBC-MAC, therefore a nonce and a length are required .Then the next word is divded in two.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;00 0C 00 10&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[NONCE LENGTH][MAC LENGTH]&lt;/P&gt;&lt;P&gt;NONCE LENGTH = &lt;STRONG&gt;0x000C&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MAC LENGTH =&lt;STRONG&gt; 0x0010&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then by intuition, we can tell that the nonce is:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG&gt;54 46 4E 21 27 6D C9 16&amp;nbsp; CA A0 BE 70&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and that the mac is&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;11 DE 64 1A&amp;nbsp; F2 20 D4 93&amp;nbsp; B1 DB C3 75&amp;nbsp; 98 72 E5 F3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you need more information about on the parameters and algorithms. I would read the Security Reference manual for your target board&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ulises Cardenas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2015 18:26:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Encrypted-boot/m-p/448793#M69383</guid>
      <dc:creator>raulcardenas-b4</dc:creator>
      <dc:date>2015-07-06T18:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Encrypted boot</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Encrypted-boot/m-p/448794#M69384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ulises,&lt;/P&gt;&lt;P&gt;Thank you so much for the response. That clears up my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sara Gurunathan&lt;/P&gt;&lt;P&gt;Senior Software Engineer&lt;/P&gt;&lt;P&gt;SRI International/Sarnoff&lt;/P&gt;&lt;P&gt;Products &amp;amp; Services&lt;/P&gt;&lt;P&gt;201 Washington Road&lt;/P&gt;&lt;P&gt;Princeton NJ  08540&lt;/P&gt;&lt;P&gt;609-734-3191&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2015 11:00:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Encrypted-boot/m-p/448794#M69384</guid>
      <dc:creator>sara</dc:creator>
      <dc:date>2015-07-07T11:00:39Z</dc:date>
    </item>
  </channel>
</rss>

