<?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 Re: Modifying SE05X Library on Arduino Portenta C33 for Custom Crypto Key Generation (SECP256K1) in Smart Cards and Secure Element</title>
    <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/Modifying-SE05X-Library-on-Arduino-Portenta-C33-for-Custom/m-p/1799781#M98</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/228918"&gt;@MaxMustermann84&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you have to find the curve type definition in the&amp;nbsp;SE05X Library on Arduino Portenta C33 and change it from&amp;nbsp;&lt;SPAN&gt;ECCurve&lt;/SPAN&gt;&lt;SPAN&gt;_NIST&lt;/SPAN&gt;&lt;SPAN&gt;_P256 to&amp;nbsp;ECCurve_SECP256K1. Please kindly refer to the following for more details.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kan_Li_0-1706781065805.png" style="width: 549px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/261314iAE58B77BD6D25444/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kan_Li_0-1706781065805.png" alt="Kan_Li_0-1706781065805.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;BR /&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Feb 2024 09:52:30 GMT</pubDate>
    <dc:creator>Kan_Li</dc:creator>
    <dc:date>2024-02-01T09:52:30Z</dc:date>
    <item>
      <title>Modifying SE05X Library on Arduino Portenta C33 for Custom Crypto Key Generation (SECP256K1)</title>
      <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/Modifying-SE05X-Library-on-Arduino-Portenta-C33-for-Custom/m-p/1798526#M97</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I&lt;/SPAN&gt;&lt;SPAN&gt;'m working with an Arduino Portenta C33 and am facing a challenge related to its integrated SE05X security element&lt;/SPAN&gt;&lt;SPAN&gt;. The current SE05X library allows for the generation of ECCurve&lt;/SPAN&gt;&lt;SPAN&gt;_NIST&lt;/SPAN&gt;&lt;SPAN&gt;_P256 key pairs &lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;A title="https://github.com/arduino/ArduinoCore-renesas/blob/main/libraries/SE05X/examples/SE05XPrivateKey/SE05XPrivateKey.ino" href="https://github.com/arduino/ArduinoCore-renesas/blob/main/libraries/SE05X/examples/SE05XPrivateKey/SE05XPrivateKey.ino" target="_blank" rel="noreferrer noopener"&gt;&lt;SPAN&gt;https://github.com/arduino/ArduinoCore-renesas/blob/main/libraries/SE05X/examples/SE05XPrivateKey/SE05XPrivateKey.ino&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;, but I need to generate a key pair using the SECP256K1 curve&lt;/SPAN&gt;&lt;SPAN&gt;. Does anyone have example code or tips on how to solve this problem&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;/*
  SE05X Private Key

  This sketch uses the SE05X to generate a new EC NIST P-256 keypair
  and store it with id 999, then the public key is printed in DER format.

  Circuit:
   - Portenta C33
*/

#include &amp;lt;SE05X.h&amp;gt;
#include &amp;lt;Wire.h&amp;gt;

void printBufferHex(const byte input[], size_t inputLength) {
  for (size_t i = 0; i &amp;lt; inputLength; i++) {
    Serial.print(input[i] &amp;gt;&amp;gt; 4, HEX);
    Serial.print(input[i] &amp;amp; 0x0f, HEX);
  }
  Serial.println();
}

void setup() {
  Serial.begin(9600);
  while (!Serial);

  if (!SE05X.begin()) {
    Serial.println("Failed to communicate with SE05X!");
    while (1);
  }

  const int KeyId = 999;
  byte derBuf[256];
  size_t derSize;

  SE05X.generatePrivateKey(KeyId, derBuf, sizeof(derBuf), &amp;amp;derSize);
  printBufferHex(derBuf, derSize);
}

void loop() {

  
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 09:17:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/Modifying-SE05X-Library-on-Arduino-Portenta-C33-for-Custom/m-p/1798526#M97</guid>
      <dc:creator>MaxMustermann84</dc:creator>
      <dc:date>2024-01-31T09:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying SE05X Library on Arduino Portenta C33 for Custom Crypto Key Generation (SECP256K1)</title>
      <link>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/Modifying-SE05X-Library-on-Arduino-Portenta-C33-for-Custom/m-p/1799781#M98</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/228918"&gt;@MaxMustermann84&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you have to find the curve type definition in the&amp;nbsp;SE05X Library on Arduino Portenta C33 and change it from&amp;nbsp;&lt;SPAN&gt;ECCurve&lt;/SPAN&gt;&lt;SPAN&gt;_NIST&lt;/SPAN&gt;&lt;SPAN&gt;_P256 to&amp;nbsp;ECCurve_SECP256K1. Please kindly refer to the following for more details.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kan_Li_0-1706781065805.png" style="width: 549px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/261314iAE58B77BD6D25444/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kan_Li_0-1706781065805.png" alt="Kan_Li_0-1706781065805.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;BR /&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 09:52:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Smart-Cards-and-Secure-Element/Modifying-SE05X-Library-on-Arduino-Portenta-C33-for-Custom/m-p/1799781#M98</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2024-02-01T09:52:30Z</dc:date>
    </item>
  </channel>
</rss>

