<?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>Failed to use curve25519 in M52810</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42099/failed-to-use-curve25519-in-m52810</link><description>Hi, 
 I am testing curve25519 in M52810. 
 The following is snippet. 
 nrf_crypto_ecc_curve25519_private_key_t bob_private_key; nrf_crypto_ecc_curve25519_public_key_t bob_public_key; 
 nrf_crypto_ecc_key_pair_generate( NULL, (nrf_crypto_ecc_curve_info_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 01 Sep 2020 09:56:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42099/failed-to-use-curve25519-in-m52810" /><item><title>RE: Failed to use curve25519 in M52810</title><link>https://devzone.nordicsemi.com/thread/267417?ContentTypeID=1</link><pubDate>Tue, 01 Sep 2020 09:56:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b892c7e2-7e5d-44fe-942d-fa1050cc36d1</guid><dc:creator>Vishwas Jain</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am using nRF52840, SDK16 &amp;amp; SoftDevice140.&lt;/p&gt;
&lt;p&gt;I am integrating pm_init()(Peer Manager) into my project and I am getting error &lt;strong&gt;0xFFFFB180&lt;/strong&gt; from&lt;strong&gt; mbedtls_ecp_gen_keypair()&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Kindly help me out!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to use curve25519 in M52810</title><link>https://devzone.nordicsemi.com/thread/164098?ContentTypeID=1</link><pubDate>Sat, 05 Jan 2019 18:03:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c48f0f6b-a572-437e-a4fe-59ce707a9852</guid><dc:creator>hejianxuan</dc:creator><description>&lt;p&gt;Dear Thorsrud,&lt;/p&gt;
&lt;p&gt;Thanks for your great support!&lt;/p&gt;
&lt;p&gt;I have not traced&amp;nbsp;&lt;span&gt;the error into mbed TLS.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I need mbed TLS because of AES CCM.&amp;nbsp;I would encrypt/decrypt data by AES CCM after got secret key by ECDH.&lt;/p&gt;
&lt;p&gt;It seems that 52810 cannot meet my demand. I should try 52832.&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;Jianxuan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to use curve25519 in M52810</title><link>https://devzone.nordicsemi.com/thread/163900?ContentTypeID=1</link><pubDate>Fri, 04 Jan 2019 09:02:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f89be11-b527-47a6-8199-320d9f022e17</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Jianxuan,&lt;/p&gt;
&lt;p&gt;Ah, I did not spot that. The mbed TLS code is somewhat obfuscated. It seems likely that there is a memory allocation failure. Have you verified it by tracing the error further into mbed TLS?&lt;/p&gt;
&lt;p&gt;We have not tested ECDH properly on the nRF52810 (only the combinations which there are examples for in the SDK are part of the release testing). Fitting this into a nRF52810 with the S112 SoftDevice will be quite tight, though it depend on the amount of RAM needed for S112 (depending on configuration).&lt;/p&gt;
&lt;p&gt;You will probably have better luck by using the &lt;span&gt;Oberon&amp;nbsp;&lt;/span&gt;backend instead of mbed TLS as is less far memory hungry. Here (&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-0289561e324e43ee942354eb66b79081/nrf_5F00_crypto_5F00_ecdh_5F00_examples_5F00_more_5F00_boards.zip"&gt;devzone.nordicsemi.com/.../nrf_5F00_crypto_5F00_ecdh_5F00_examples_5F00_more_5F00_boards.zip&lt;/a&gt;) are&amp;nbsp;&lt;em&gt;untested&lt;/em&gt; project files of the ECDH example for more boards with and without a SoftDevice configured to use the Oberon backend. This includes a pca10040e project with SoftDevice. Note that the example is not updated to enable and use the SoftDevice, and that the application start address is probably too low for practical BLE applications (except for beacons), but you have some headroom when using the Oberon backend.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to use curve25519 in M52810</title><link>https://devzone.nordicsemi.com/thread/163815?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 15:52:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3db84040-9d78-4421-bb27-5296e97a8f17</guid><dc:creator>hejianxuan</dc:creator><description>&lt;p&gt;Dear Thorsrud,&lt;/p&gt;
&lt;p&gt;We know that ECDH need a lot of RAM and flash. I am worried that limitation of M52810 resource should cause uncertain problem while ECDH. You know, there is no&amp;nbsp;pca10040e&amp;nbsp; support in ECDH example.&lt;/p&gt;
&lt;p&gt;Thus, I want to know whether Nordic ran ECDH on M52810? If true, could you share ECDH project for pca10040e?&lt;/p&gt;
&lt;p&gt;Especially, ECDH project with softdevice for pca10040e would be highly appreciated! I could copy your project directly.&amp;nbsp; That is great!&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Jianxuan&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to use curve25519 in M52810</title><link>https://devzone.nordicsemi.com/thread/163812?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 15:34:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99a75002-ce24-49d4-9aad-3d27b6377ca9</guid><dc:creator>hejianxuan</dc:creator><description>&lt;p&gt;In&amp;nbsp;nRF5_SDK_15.2.0\external\mbedtls\include\mbedtls\bignum.h:&lt;/p&gt;
&lt;p&gt;#define MBEDTLS_MPI_CHK(f) do { if( ( ret = f ) != 0 ) goto cleanup; } while( 0 )&lt;/p&gt;
&lt;p&gt;This macro assign f to ret. In other words, the variable &amp;quot;ret&amp;quot; has been set before it is read.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to use curve25519 in M52810</title><link>https://devzone.nordicsemi.com/thread/163794?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 14:45:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1404a871-c1a2-4245-90b8-9b3e8f76a3ba</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;There seems to be a bug in mbed TLS. You can see in &amp;lt;SDK15.2&amp;gt;\external\mbedtls\library\ecp_curves.c, on line 660 there is a variable &amp;quot;ret&amp;quot; which is defined, but it is never set before it is read.&amp;nbsp;I suspect the proper fix is to delete line 660 and line 680-684, and always return 0 from&amp;nbsp;ecp_use_curve25519().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to use curve25519 in M52810</title><link>https://devzone.nordicsemi.com/thread/163788?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 14:27:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02f3deca-daee-4cb3-b577-42733ef9793a</guid><dc:creator>hejianxuan</dc:creator><description>&lt;p&gt;&lt;span&gt;The error is returned on line 124. The return value is&amp;nbsp;0xfffffff0.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to use curve25519 in M52810</title><link>https://devzone.nordicsemi.com/thread/163774?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 13:57:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:752d9b72-09b0-42bf-8d97-2664f4048297</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. Then the&amp;nbsp;NRF_ERROR_CRYPTO_INTERNAL return value should come from either line 124 or line 141 in &amp;lt;SDK 15.2&amp;gt;\components\libraries\crypto\backend\mbedtls\mbedtls_backend_ecc.c. Can you check using a debugger which it is?&lt;/p&gt;
&lt;p&gt;If the error is returned on line 124, then can you see the return value from&amp;nbsp;mbedtls_ecp_group_load() on line 75? And if&amp;nbsp;it comes from the call to&amp;nbsp;mbedtls_ecp_gen_keypair(), what is the return value from it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to use curve25519 in M52810</title><link>https://devzone.nordicsemi.com/thread/163766?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 13:41:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9071183b-f793-4950-a53c-93881577ec31</guid><dc:creator>hejianxuan</dc:creator><description>&lt;p&gt;&lt;span&gt;mbed TLS backend.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to use curve25519 in M52810</title><link>https://devzone.nordicsemi.com/thread/163761?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 13:23:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2da6df4-0822-436a-8d0d-57b41c422ad6</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Jianxuan,&lt;/p&gt;
&lt;p&gt;The error code is&amp;nbsp;NRF_ERROR_CRYPTO_INTERNAL. Which crypto backend have you enabled for Curve25519 in your projects sdk_config.h?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to use curve25519 in M52810</title><link>https://devzone.nordicsemi.com/thread/163758?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 13:17:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e2f9c11-1cae-4315-8c0f-93a15a14b7d3</guid><dc:creator>hejianxuan</dc:creator><description>&lt;p&gt;Dear&amp;nbsp;Thorsrud,&lt;/p&gt;
&lt;p&gt;SDK version is 15.2.0. The error code is&amp;nbsp;0x00008516.&lt;/p&gt;
&lt;p&gt;By the way, crypto init snippet is listed below:&lt;/p&gt;
&lt;p&gt;err_code = nrf_mem_init();&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;err_code = nrf_crypto_init();&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Jianxuan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failed to use curve25519 in M52810</title><link>https://devzone.nordicsemi.com/thread/163663?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 08:50:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09aed83a-f05c-44f2-a5a7-9f388d6dae76</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Which SDK version are you using?&amp;nbsp;What is the error code returned from the call to&amp;nbsp;nrf_crypto_ecc_key_pair_generate()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>