<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>verifying signature ecc dsa with secp256r1 zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78066/verifying-signature-ecc-dsa-with-secp256r1-zephyr</link><description>Hello, 
 
 I am trying to verify a signature with the `NIST p-256` curve. I had previously done this with the Nrf5 sdk and it is working: 
 
 
 I am now trying to migrate this into zephyr using the same public key but it is not working (failing on uECC_verify</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Aug 2021 13:30:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78066/verifying-signature-ecc-dsa-with-secp256r1-zephyr" /><item><title>RE: verifying signature ecc dsa with secp256r1 zephyr</title><link>https://devzone.nordicsemi.com/thread/322900?ContentTypeID=1</link><pubDate>Mon, 02 Aug 2021 13:30:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1465b202-7e01-4438-a7a6-51bcf16c9d27</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I suspect it might be related to the byte endianess of your inputs. uECC in the nRF5 SDK is compiled for little-endian which is converted to big endian at the nRF crypto layer above (see &lt;span&gt;&lt;a title="nrf_crypto_ecc_byte_order_invert" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__nrf__crypto__ecc.html?cp=8_1_6_10_11_14_27#gabedfa4cd51adab448cd4c90953082429"&gt;nrf_crypto_ecc_byte_order_invert&lt;/a&gt;&lt;/span&gt;). There&amp;#39;s is also a remark in the tinycrypt documentation about endianness which may be relevant:&lt;/p&gt;
&lt;div style="font-family:&amp;#39;Segoe UI&amp;#39;, system-ui, &amp;#39;Apple Color Emoji&amp;#39;, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0;text-transform:none;white-space:normal;"&gt;&amp;quot;Integer representation: To reduce code size, all large integers are represented using little-endian words - so the least significant word is first. You can use the &amp;#39;ecc_bytes2native()&amp;#39; and &amp;#39;ecc_native2bytes()&amp;#39; functions to convert between the native integer representation and the standardized octet representation.&amp;quot; &lt;a href="https://github.com/intel/tinycrypt/blob/master/documentation/tinycrypt.rst"&gt;https://github.com/intel/tinycrypt/blob/master/documentation/tinycrypt.rst&lt;/a&gt; &lt;/div&gt;
&lt;div style="font-family:&amp;#39;Segoe UI&amp;#39;, system-ui, &amp;#39;Apple Color Emoji&amp;#39;, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0;text-transform:none;white-space:normal;"&gt;&lt;/div&gt;
&lt;div style="font-family:&amp;#39;Segoe UI&amp;#39;, system-ui, &amp;#39;Apple Color Emoji&amp;#39;, &amp;#39;Segoe UI Emoji&amp;#39;, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;text-indent:0;text-transform:none;white-space:normal;"&gt;Another alternative you may consider is to use the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_security/README.html"&gt;Nordic security module&lt;/a&gt; as discussed in this thread: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/68985/trying-to-implement-ecdh-key-exchange-using-tinycrypt-but-the-random-num-gen-keeps-crashing/284564#284564"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/68985/trying-to-implement-ecdh-key-exchange-using-tinycrypt-but-the-random-num-gen-keeps-crashing/284564#284564&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>