<?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>S32KのトピックRe: pKeyPtr in crypto_cse_loadkey</title>
    <link>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1425191#M14318</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197709"&gt;@RedOne&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;&lt;SPAN&gt;KeyUpdatePRAM is nothing but&amp;nbsp;M1 concatenated with M2 and M3, i.e. the first 16 bytes of&amp;nbsp;KeyUpdatePRAM are M1, next 32 bytes of&amp;nbsp;KeyUpdatePRAM are M2 and the last 16 bytes of&amp;nbsp;KeyUpdatePRAM are M3.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Nam&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Mar 2022 10:02:09 GMT</pubDate>
    <dc:creator>namnguyenviet</dc:creator>
    <dc:date>2022-03-09T10:02:09Z</dc:date>
    <item>
      <title>pKeyPtr in crypto_cse_loadkey</title>
      <link>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1423223#M14259</link>
      <description>&lt;P&gt;I’m trying to load user keys by using function crypto_cse load key in crypto mcal module. This keys, unlike master key will come as an input array. This keys need to be updateble by function&lt;/P&gt;&lt;P&gt;first I’m using cse module standalone to reset memory, init cse and write master key in nvm. For that I’m using cse functions provided by nxp. Next I’m trying to update user keys by using crypto_loadKey func, which eventually gets me to crypto_cse_loadkey, which needs a ptr to key value and other stuff that I need to pass in order for it to write key correctly. Judging by use of loadkey in other functions I pass new key value as ptr to array of its value. Question is, how am I supposed to generate other stuff that will go in keyM1ptr keyM2ptr and keyM3 ptr? Cause only thing that I need to pass are IDs of keys. Do I need to do some other function first?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 09:33:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1423223#M14259</guid>
      <dc:creator>RedOne</dc:creator>
      <dc:date>2022-03-04T09:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: pKeyPtr in crypto_cse_loadkey</title>
      <link>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1425095#M14316</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm afraid that I didn't get this function:&amp;nbsp;&lt;SPAN&gt;crypto_loadKey. Did you mention Crypto_KeyElementSet?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Given that you have a user key as a 8-byte array. Because the M1M2M3 calculation functionality isn't available in the driver, you need to write it by your own (but I guess you've already had this function, since it's also required to load the master key), in order to convert the raw 8-byte data key to M1M2M3 format. After that, you will "append" the M1, M2 and M3 into an array, which will be used as the key data. Then you will pass the pointer to the key data to the Crypto_KeyElementSet() function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the snippet code:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="namnguyenviet_0-1646813907406.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/172880i9C8E43DFE01AD5E7/image-size/large?v=v2&amp;amp;px=999" role="button" title="namnguyenviet_0-1646813907406.png" alt="namnguyenviet_0-1646813907406.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Nam&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 08:40:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1425095#M14316</guid>
      <dc:creator>namnguyenviet</dc:creator>
      <dc:date>2022-03-09T08:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: pKeyPtr in crypto_cse_loadkey</title>
      <link>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1425143#M14317</link>
      <description>&lt;P&gt;In crypto_KeyElementSet there’s a function Crypto_Ipw_loadKey which passes keyptr further to crypto_cse_loadKey, which uses Crypto_cae_writePagesToPRAM in order to write key in to memory. This function returns key invalid error when I’m trying to point array of initial value of the key to it. So, as I understand from your answer I need to generate M1, M2 and M3, however I don’t understand the KeyUpdatePRAM function from your answer array. Can you elaborate what is it?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 09:15:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1425143#M14317</guid>
      <dc:creator>RedOne</dc:creator>
      <dc:date>2022-03-09T09:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: pKeyPtr in crypto_cse_loadkey</title>
      <link>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1425191#M14318</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197709"&gt;@RedOne&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;&lt;SPAN&gt;KeyUpdatePRAM is nothing but&amp;nbsp;M1 concatenated with M2 and M3, i.e. the first 16 bytes of&amp;nbsp;KeyUpdatePRAM are M1, next 32 bytes of&amp;nbsp;KeyUpdatePRAM are M2 and the last 16 bytes of&amp;nbsp;KeyUpdatePRAM are M3.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Nam&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 10:02:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1425191#M14318</guid>
      <dc:creator>namnguyenviet</dc:creator>
      <dc:date>2022-03-09T10:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: pKeyPtr in crypto_cse_loadkey</title>
      <link>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1425263#M14325</link>
      <description>&lt;P&gt;Is there an example of how keyUpdatePram should look in memory when it passes to memory? Or example of some program that uses it?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 12:29:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1425263#M14325</guid>
      <dc:creator>RedOne</dc:creator>
      <dc:date>2022-03-09T12:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: pKeyPtr in crypto_cse_loadkey</title>
      <link>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1425960#M14343</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197709"&gt;@RedOne&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I shared with you an example to your email (&lt;A href="mailto:kanaqw2@gmail.com" target="_blank" rel="noopener"&gt;kanaqw2@gmail.com&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Nam&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 08:19:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1425960#M14343</guid>
      <dc:creator>namnguyenviet</dc:creator>
      <dc:date>2022-03-10T08:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: pKeyPtr in crypto_cse_loadkey</title>
      <link>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1426000#M14348</link>
      <description>&lt;P&gt;Didn’t receive it. Can you send it again?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 09:03:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1426000#M14348</guid>
      <dc:creator>RedOne</dc:creator>
      <dc:date>2022-03-10T09:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: pKeyPtr in crypto_cse_loadkey</title>
      <link>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1426016#M14350</link>
      <description>&lt;P&gt;Try to access to your case here:&amp;nbsp;&lt;A href="https://support.nxp.com/s/case/5002p00002fZw5XAAS" target="_blank" rel="noopener"&gt;https://support.nxp.com/s/case/5002p00002fZw5XAAS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Nam&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 09:14:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1426016#M14350</guid>
      <dc:creator>namnguyenviet</dc:creator>
      <dc:date>2022-03-10T09:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: pKeyPtr in crypto_cse_loadkey</title>
      <link>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1427476#M14409</link>
      <description>&lt;P&gt;Tried with your code, function Crypto_Cse_LoadKey returns CRYPTO_CSE_KEY_UPDATE_ERROR, when checking of key was written to PRAM or not. Description says that it happens when there's an errors in verification of the messages, but what does that means exactly? What is going wrong?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 05:48:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1427476#M14409</guid>
      <dc:creator>RedOne</dc:creator>
      <dc:date>2022-03-14T05:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: pKeyPtr in crypto_cse_loadkey</title>
      <link>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1427530#M14412</link>
      <description>&lt;P&gt;Tried your function, however, after generating M1 M2 and M3 and passing it to function Crypto_Cse_LoadKey, function returns CRYPTO_CSE_ERC_KEY_UPDATE_ERROR, which indicates that verification of messages is incorrect. Could you tell me what exactly could be this error in verification specifically?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ps Sending this message second time, because first doesn't display&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 07:13:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1427530#M14412</guid>
      <dc:creator>RedOne</dc:creator>
      <dc:date>2022-03-14T07:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: pKeyPtr in crypto_cse_loadkey</title>
      <link>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1429117#M14456</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197709"&gt;@RedOne&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;CRYPTO_CSE_ERC_KEY_UPDATE_ERROR could because of there was an available key and you don't know the authentication key for that key in order to update that. You can try to load the key in a slot that you haven't used it before.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Nam&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 08:34:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1429117#M14456</guid>
      <dc:creator>namnguyenviet</dc:creator>
      <dc:date>2022-03-16T08:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: pKeyPtr in crypto_cse_loadkey</title>
      <link>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1429393#M14464</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image001.png" style="width: 1675px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/173934iA7C74F4A89234DEC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="image001.png" alt="image001.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I think I found the issue, it's looks like that function Crypto_Cse_WritePagesToPRAM reversing endianess of key, making it invalid. How should I modify the code so it doesn't do this? Or should I modify input to be reversed already?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 15:00:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1429393#M14464</guid>
      <dc:creator>RedOne</dc:creator>
      <dc:date>2022-03-16T15:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: pKeyPtr in crypto_cse_loadkey</title>
      <link>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1429411#M14466</link>
      <description>&lt;P&gt;Nevermind, already checked solution on StackOverflow. Turned out, function that I've been using from CSE to loadkey uses low endian, when Crypto loadkey reverses it to big endian, making key invalid in process. Don't know if it version problems or something else but I think it's a bug somewhere&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 15:21:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/pKeyPtr-in-crypto-cse-loadkey/m-p/1429411#M14466</guid>
      <dc:creator>RedOne</dc:creator>
      <dc:date>2022-03-16T15:21:42Z</dc:date>
    </item>
  </channel>
</rss>

