<?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>Getting started with RNG and Crypto</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110481/getting-started-with-rng-and-crypto</link><description>We need to do some crypto. The first task being to generate a random number with rng. I have been fighting through the sdk_config.h defines, and the list of modules that need to be added to our build for the nRF52840 and ended up with a module that gets</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 24 Apr 2024 11:49:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110481/getting-started-with-rng-and-crypto" /><item><title>RE: Getting started with RNG and Crypto</title><link>https://devzone.nordicsemi.com/thread/480434?ContentTypeID=1</link><pubDate>Wed, 24 Apr 2024 11:49:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f64585f4-e3e0-4a9d-aee1-c476f10029d0</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Good to hear you got it working, I will close the ticket then &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with RNG and Crypto</title><link>https://devzone.nordicsemi.com/thread/480294?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2024 19:29:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae6063e2-bf79-425d-8f08-c3c7a0a4b6bb</guid><dc:creator>wdtj</dc:creator><description>&lt;p&gt;Thanks for the tip to use the non-short-wchar library from the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/index.html?cp=9_1_0"&gt;SDK release notes&lt;/a&gt;.&amp;nbsp; This solved the issue with getting the rng example to build.&amp;nbsp; With the rng example, I found that I was missing a call to SaSi_LibInit() before calling nrf_crypto_init.&amp;nbsp; I then tripped over the issue in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/63876/nrf_crypto_init-error-initialization-or-startup-of-rng-failed"&gt;nrf_crypto_init ERROR Initialization or startup of RNG failed&lt;/a&gt;.&amp;nbsp; I&amp;#39;m now happily generating random numbers.&lt;/p&gt;
&lt;p&gt;Thanks again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with RNG and Crypto</title><link>https://devzone.nordicsemi.com/thread/480232?ContentTypeID=1</link><pubDate>Tue, 23 Apr 2024 13:33:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:376d5974-11fc-4a1d-9f11-d8bbda00e49d</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/index.html?cp=9_1_0"&gt;SDK release notes&lt;/a&gt; have some information on this, including some workarounds:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Libraries for IAR 8 require wchar_t to be of size 32 bits while IAR 7 requires 16 bits.
  
To run a project using IAR 8, follow these instructions:
 1. Open the IAR project in IAR 8. The IAR workbench will automatically generate an IAR 8 compatible project file.
 2. If the project contains one of the precompiled libraries listed below, replace it
    with the IAR 8 compatible alternative (there are no projects targeting nRF51 in this SDK).
 3. Save the project.
 4. When building the project, you might get the warning: &amp;quot;The header file &amp;#39;cmsis_iar.h&amp;#39; is obsolete and should not be used. [...]&amp;quot;.
    - The problem is described in DevZone post: https://devzone.nordicsemi.com/f/nordic-q-a/31123/iar-ewarm-8-22-1-complains-about-cmsis_iar-h
      The solution is to remove all occurrences of #include &amp;lt;cmsis_iar.h&amp;gt;.
     
The affected libraries are:
 - micro-ecc crypto:
    - IAR7: Includes library located in the folder named “…_iar\…”.
    - IAR8: Switch to using the library from the folder named “…_armgcc\…”.
 - nrf_cc310, nrf_cc310_bl, and nrf_oberon:
    - IAR7: Link to a library where “short_wchar” is part of the folder name.
    - IAR8: Link to a library without “short_wchar” in the folder name.
 - Gazell, NFC Tag, and 802.15.4:
    - IAR7: Includes the library where the file name ends with “_iar”.
    - IAR8: Switch to using the library with similar file name that ends with “_gcc”.
*****&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with RNG and Crypto</title><link>https://devzone.nordicsemi.com/thread/480072?ContentTypeID=1</link><pubDate>Mon, 22 Apr 2024 21:40:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f10dd927-3f9f-46c8-883e-120587fcc030</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;This is a good start: &lt;em&gt;wchar_t&lt;/em&gt; changed in IAR v8:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/40887/inconsistent-wchar_t-size"&gt;inconsistent-wchar_t-size&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with RNG and Crypto</title><link>https://devzone.nordicsemi.com/thread/480066?ContentTypeID=1</link><pubDate>Mon, 22 Apr 2024 19:13:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26cd326a-66bb-4deb-ae59-cba243192586</guid><dc:creator>wdtj</dc:creator><description>&lt;p&gt;When defining &lt;span style="background-color:#ffffff;padding:0px 0px 0px 2px;"&gt;&lt;span style="background-color:#ffffff;color:#000000;font-family:&amp;#39;Consolas&amp;#39;;font-size:10pt;white-space:pre;"&gt;&lt;span style="color:#000000;"&gt;NRF_CRYPTO_BACKEND_CC310_RNG&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;, I&amp;#39;ve run into the error:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;br /&gt;Warning[Li026]: the module &amp;quot;crys_rnd.c.obj(libnrf_cc310_0.9.13.a)&amp;quot; (and 14 other modules) do not contain information to support Virtual Function Elimination&lt;/p&gt;
&lt;p&gt;Does this mean I have used the wrong version of libnrf_cc310?&amp;nbsp; Which is the correct lib?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with RNG and Crypto</title><link>https://devzone.nordicsemi.com/thread/480065?ContentTypeID=1</link><pubDate>Mon, 22 Apr 2024 18:49:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d991b448-0f01-4503-83d8-bbf172a8be4d</guid><dc:creator>wdtj</dc:creator><description>&lt;p&gt;Code I am using to call the RNG is:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;static int rnd_std_rand(void *rng_state, unsigned char *output, size_t len)
{
    ret_code_t err_code = nrf_crypto_init();
    nrf_crypto_rng_init(NULL, NULL);
    memset(output, 0xaa, len);
    nrf_crypto_rng_vector_generate(output, len);
    return 0;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>