<?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 X25519 algoritm doesn't generate the correct key in Secure Authentication</title>
    <link>https://community.nxp.com/t5/Secure-Authentication/X25519-algoritm-doesn-t-generate-the-correct-key/m-p/1011268#M187</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having trouble using the X25519 algorithm with the SE050C.&lt;/P&gt;&lt;P&gt;I've used the example keys from the&amp;nbsp;SE050 APDU Specification (AN 12413), see image.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="derive_ecdh_key_example.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/72285i49D93F57BB3DD342/image-size/large?v=v2&amp;amp;px=999" role="button" title="derive_ecdh_key_example.png" alt="derive_ecdh_key_example.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;According to the given example and the OpenSSL test (in attachments), the shared secret should be:&lt;BR /&gt;4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742 (HEX)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to derive&amp;nbsp;the shared secret&amp;nbsp;on the SE050C (development kit), I get the wrong key or the operation fails.&lt;/P&gt;&lt;P&gt;I've used 2 derive functions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;sss_derive_key_dh &lt;UL&gt;&lt;LI&gt;returns&amp;nbsp;kStatus_SSS_Fail&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Se05x_API_ECDHGenerateSharedSecret &lt;UL&gt;&lt;LI&gt;returns the wrong key:&lt;BR /&gt;68408B1BAA1BDC8EBA074E3A99AEF1B3C94EDFE9F52E60616D1F2A924B2F5D51 (HEX)&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does someone know how to correctly use the X25519 function or can anybody explain what I'm doing wrong? Help is very appreciated.&lt;/P&gt;&lt;P&gt;I've attached my code and the corresponding output. The code is very similar to the SDK example "ex_sss_ecdh".&lt;/P&gt;&lt;P&gt;I am using the latest version of&amp;nbsp;SE050-PLUG-TRUST-MW (version 2.12).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Jan 2020 16:34:58 GMT</pubDate>
    <dc:creator>jordyubink</dc:creator>
    <dc:date>2020-01-14T16:34:58Z</dc:date>
    <item>
      <title>X25519 algoritm doesn't generate the correct key</title>
      <link>https://community.nxp.com/t5/Secure-Authentication/X25519-algoritm-doesn-t-generate-the-correct-key/m-p/1011268#M187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having trouble using the X25519 algorithm with the SE050C.&lt;/P&gt;&lt;P&gt;I've used the example keys from the&amp;nbsp;SE050 APDU Specification (AN 12413), see image.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="derive_ecdh_key_example.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/72285i49D93F57BB3DD342/image-size/large?v=v2&amp;amp;px=999" role="button" title="derive_ecdh_key_example.png" alt="derive_ecdh_key_example.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;According to the given example and the OpenSSL test (in attachments), the shared secret should be:&lt;BR /&gt;4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742 (HEX)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to derive&amp;nbsp;the shared secret&amp;nbsp;on the SE050C (development kit), I get the wrong key or the operation fails.&lt;/P&gt;&lt;P&gt;I've used 2 derive functions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;sss_derive_key_dh &lt;UL&gt;&lt;LI&gt;returns&amp;nbsp;kStatus_SSS_Fail&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Se05x_API_ECDHGenerateSharedSecret &lt;UL&gt;&lt;LI&gt;returns the wrong key:&lt;BR /&gt;68408B1BAA1BDC8EBA074E3A99AEF1B3C94EDFE9F52E60616D1F2A924B2F5D51 (HEX)&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does someone know how to correctly use the X25519 function or can anybody explain what I'm doing wrong? Help is very appreciated.&lt;/P&gt;&lt;P&gt;I've attached my code and the corresponding output. The code is very similar to the SDK example "ex_sss_ecdh".&lt;/P&gt;&lt;P&gt;I am using the latest version of&amp;nbsp;SE050-PLUG-TRUST-MW (version 2.12).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jan 2020 16:34:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Secure-Authentication/X25519-algoritm-doesn-t-generate-the-correct-key/m-p/1011268#M187</guid>
      <dc:creator>jordyubink</dc:creator>
      <dc:date>2020-01-14T16:34:58Z</dc:date>
    </item>
  </channel>
</rss>

