<?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>i.MX ProcessorsのトピックRe: CAAM operation failure with secure memory</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/CAAM-operation-failure-with-secure-memory/m-p/565045#M87218</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi NXP Team,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any update on this issue? We're still anticipating for your rely since September, thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Teddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Nov 2016 07:40:25 GMT</pubDate>
    <dc:creator>teddyhsiung</dc:creator>
    <dc:date>2016-11-17T07:40:25Z</dc:date>
    <item>
      <title>CAAM operation failure with secure memory</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/CAAM-operation-failure-with-secure-memory/m-p/565042#M87215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;When we use the linux asynchronous crypto api calls with the secure memory slots as source and destination of the operations, they complete without reporting any error, but when we examine the destination slot, its contents remain unchanged.&lt;/P&gt;&lt;P&gt;When we use buffers allocated using kmalloc or buffers on the stack, the destination buffers are properly updated with the desired results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is how we use the secure memory with the linux crypto API:&lt;/P&gt;&lt;P&gt;(we don't use unit 0 when establishing keystores.)&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_14701958522224517 jive_macro_code jive_text_macro" data-hasrefreshed="true" data-renderedposition="260.3999938964844_50_798_256" jivemacro_uid="_14701958522224517"&gt;&lt;P&gt;// init.. establist keystore using secure memory api, acquire/init cipher etc.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;// allocate secure memory slots for src and dst&lt;/P&gt;&lt;P&gt;sm_keystore_slot_alloc(ksdev, unit, size, &amp;amp;slot_src);&lt;/P&gt;&lt;P&gt;sm_keystore_slot_alloc(ksdev, unit, size, &amp;amp;slot_dst);&lt;/P&gt;&lt;P&gt;// get address of the src and dst slots&lt;/P&gt;&lt;P&gt;addr_src=kspriv-&amp;gt;slot_get_address(ksdev, unit, slot_src);&lt;/P&gt;&lt;P&gt;addr_dst = kspriv-&amp;gt;slot_get_address(ksdev, unit, slot_dst);&lt;/P&gt;&lt;P&gt;// copy data to source (addr_src)&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;// set src and dst scatterlists&lt;/P&gt;&lt;P&gt;sg_init_one(&amp;amp;sg_src, addr_src, size);&lt;/P&gt;&lt;P&gt;sg_init_one(&amp;amp;sg_dst, addr_dst, size);&lt;/P&gt;&lt;P&gt;// invoke appropriate linux async crypto api calls&lt;/P&gt;&lt;P&gt;ablkcipher_request_set_crypt(ablk-&amp;gt;req, &amp;amp;sg_src, &amp;amp;sg_dst, size, iv_data);&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this using scenario allowed with the CAAM implementation?&lt;BR /&gt;And how to make it work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 03:51:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/CAAM-operation-failure-with-secure-memory/m-p/565042#M87215</guid>
      <dc:creator>ethanyang</dc:creator>
      <dc:date>2016-08-03T03:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: CAAM operation failure with secure memory</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/CAAM-operation-failure-with-secure-memory/m-p/565043#M87216</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;&amp;nbsp; Hope the following helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/message/825746"&gt;https://community.nxp.com/message/825746&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Yuri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 08:11:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/CAAM-operation-failure-with-secure-memory/m-p/565043#M87216</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2016-09-01T08:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: CAAM operation failure with secure memory</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/CAAM-operation-failure-with-secure-memory/m-p/565044#M87217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yuri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;In the sample code, they use buffer allocated with kzalloc() as the&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;input = kzalloc(block_size, GFP_KERNEL | GFP_DMA);
 memcpy(input, text, block_size);
 sg_init_one(sg, input, block_size);
iv_len = crypto_ablkcipher_ivsize(tfm);
 if (iv_len)
 memset(&amp;amp;iv, 0xff, iv_len);
ablkcipher_request_set_crypt(req, sg, sg, block_size, iv);‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is is possible to use the memory from keystore to do the ciphering?&lt;/P&gt;&lt;OL class="" start="1" style="color: #5c5c5c; background-color: #ffffff; border: none; font-size: 12px; margin: 0px 0px 1px 45px !important;"&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f6f6f6; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; font-weight: inherit; font-size: 12px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;addr_dst&amp;nbsp;=&amp;nbsp;kspriv-&amp;gt;slot_get_address(ksdev,&amp;nbsp;unit,&amp;nbsp;slot_dst);&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI class="" style="color: #5c5c5c; background-color: #f6f6f6; border-top: none; border-bottom: none; border-left: 3px solid #6ce26c; border-right: none; font-weight: inherit; font-size: 12px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;sm_keystore_slot_alloc(ksdev,&amp;nbsp;unit,&amp;nbsp;size,&amp;nbsp;&amp;amp;slot_dst);&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 9pt !important;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 15px;"&gt;We need this when we're doing the key variant calculation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 15px;"&gt;We want the calculated result is located in the secure memory as it will be used as a cipher key.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 15px;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background-color: inherit; border: 0px; font-weight: inherit; font-size: 15px;"&gt;Ethan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 13:27:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/CAAM-operation-failure-with-secure-memory/m-p/565044#M87217</guid>
      <dc:creator>ethanyang</dc:creator>
      <dc:date>2016-09-09T13:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: CAAM operation failure with secure memory</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/CAAM-operation-failure-with-secure-memory/m-p/565045#M87218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi NXP Team,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any update on this issue? We're still anticipating for your rely since September, thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Teddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2016 07:40:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/CAAM-operation-failure-with-secure-memory/m-p/565045#M87218</guid>
      <dc:creator>teddyhsiung</dc:creator>
      <dc:date>2016-11-17T07:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: CAAM operation failure with secure memory</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/CAAM-operation-failure-with-secure-memory/m-p/565046#M87219</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;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;“CAAM implements operations that convert between blob encapsulation &lt;BR /&gt;and black-key encapsulation without exposing the key in plaintext.” &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp;But we do not have such example for publishing, sorry.&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;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.nxp.com/support/nxp-professional-services:PROFESSIONAL-SERVICE" title="http://www.nxp.com/support/nxp-professional-services:PROFESSIONAL-SERVICE"&gt;NXP Professional Services|NXP&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Yuri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2016 06:29:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/CAAM-operation-failure-with-secure-memory/m-p/565046#M87219</guid>
      <dc:creator>Yuri</dc:creator>
      <dc:date>2016-12-02T06:29:32Z</dc:date>
    </item>
  </channel>
</rss>

