<?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>Struggling with encryption, nrf52840 using ncs 1.3.1</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67297/struggling-with-encryption-nrf52840-using-ncs-1-3-1</link><description>Hi, 
 I&amp;#39;m really struggling with encryption, kind of lost in the woods of libraries, api&amp;#39;s and documentation. Can anyone point me in the right direction? 
 Config: I have CONFIG_NORDIC_SECURITY_BACKEND=y set 
 To start simple, I want to encrypt a block</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 23 Oct 2020 08:03:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67297/struggling-with-encryption-nrf52840-using-ncs-1-3-1" /><item><title>RE: Struggling with encryption, nrf52840 using ncs 1.3.1</title><link>https://devzone.nordicsemi.com/thread/276560?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2020 08:03:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1070ea1e-dd2c-4938-bf30-ba6eccb10396</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hm, okay. That sounds strange, but as long as it&amp;#39;s working for you!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you want, I can read through your .config file (which yes, is the complete list of configurations&amp;nbsp; in the build) to check.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Let me know if there&amp;#39;s anything else I can do for you. :)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Struggling with encryption, nrf52840 using ncs 1.3.1</title><link>https://devzone.nordicsemi.com/thread/276487?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 15:11:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f6407da-bb7b-4867-8dad-a1f2c0d027ee</guid><dc:creator>basvkesteren</dc:creator><description>&lt;p&gt;Hello Heidi,&lt;/p&gt;
&lt;p&gt;I have to admit that the build-system isn&amp;#39;t 100% clear to me (still learning...), but the build/zephyr/.config file (which, as far as i understand it, is the actual config file after all the build-system magic has happened) contains CONFIG_CC310_BACKEND=y&lt;/p&gt;
&lt;p&gt;In my prj.conf file I have, among others, CONFIG_NORDIC_SECURITY_BACKEND=y&lt;/p&gt;
&lt;p&gt;As far as i can tell there are no other lines in my prj.conf file that do anything encryption-related&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;-Bastiaan&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Struggling with encryption, nrf52840 using ncs 1.3.1</title><link>https://devzone.nordicsemi.com/thread/276474?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 14:20:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88bd2fd5-248a-4262-8ca8-3ba072a44f26</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;CONFIG_CC3XX_BACKEND will select CONFIG_CC310_BACKEND when&amp;nbsp;&lt;span&gt;SOC_NRF52840 &amp;amp;&amp;amp; NORDIC_SECURITY_BACKEND is true, see &lt;a href="https://github.com/nrfconnect/sdk-nrfxlib/blob/master/nrf_security/Kconfig#L121"&gt;here&lt;/a&gt;. So it&amp;#39;s just a more general configuration.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote user="basvkesteren"]Enabling CONFIG_NORDIC_SECURITY_BACKEND automagically enables CONFIG_CC310_BACKEND for me, so i think i already have the setting you mean enabled?[/quote]
&lt;p&gt;&amp;nbsp;Are you sure? In the documentation, it doesn&amp;#39;t look like this configuration selects the CC310_BACKEND. Perhaps you have something else enabled that does it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Heidi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Struggling with encryption, nrf52840 using ncs 1.3.1</title><link>https://devzone.nordicsemi.com/thread/276093?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2020 07:57:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b69f53c6-9efd-433d-b555-32b4bfe3121b</guid><dc:creator>basvkesteren</dc:creator><description>&lt;p&gt;Hello Heidi,&lt;/p&gt;
&lt;p&gt;Thanks for the response! But, I&amp;#39;m not quite getting it (sorry... ;) )&lt;/p&gt;
&lt;p&gt;Is the CONFIG_CC310_BACKEND the same as CONFIG_CC3XX_BACKEND? Because i cant find the latter...?&lt;/p&gt;
&lt;p&gt;Enabling CONFIG_NORDIC_SECURITY_BACKEND automagically enables CONFIG_CC310_BACKEND for me, so i think i already have the setting you mean enabled?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;-Bastiaan&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Struggling with encryption, nrf52840 using ncs 1.3.1</title><link>https://devzone.nordicsemi.com/thread/276018?ContentTypeID=1</link><pubDate>Tue, 20 Oct 2020 17:38:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08e75d38-5019-446b-bd30-642929290b57</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Right now, you only have &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_security/doc/backends.html#nrf-oberon-backend"&gt;nrf_oberon&lt;/a&gt;&amp;nbsp;enabled as backend, which only runs in software To use the CC310 module,&amp;nbsp;you need to enable&amp;nbsp;&lt;span&gt;the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_security/doc/backends.html#arm-cryptocell-cc3xx-backend"&gt;Arm CryptoCell cc3xx backend&lt;/a&gt;,&amp;nbsp;by enabling&amp;nbsp;&lt;/span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/CONFIG_CC3XX_BACKEND.html#cmdoption-arg-CONFIG_CC3XX_BACKEND"&gt;CONFIG_CC3XX_BACKEND&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The functions you are calling (mbedtls_aes_setkey_enc and&amp;nbsp;mbedtls_aes_crypt_cbc) are part of the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_security/doc/glue_layer.html"&gt;mbed TLS glue layer&lt;/a&gt;&amp;nbsp;(&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_security/doc/api.html"&gt;API reference&lt;/a&gt;), which allows you to use both the HW and SW implementations simultaneously, which means you can have both of these backends enabled in your application.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When you have multiple backends available,&amp;nbsp;the mbed TLS glue layer enables a dynamic check to verify whether the cryptographic algorithm is supported in hardware. For instance, t&lt;span&gt;he&amp;nbsp;&lt;/span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_security/doc/backends.html#nrf-security-backends-cc3xx"&gt;&lt;span&gt;cc3xx backend&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;is limited to key sizes of 128 bits on devices with CC310. In this case, the layer will call into&amp;nbsp;&lt;/span&gt;a different enabled backend (nrf_oberon) as a fallback.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Let me know if this clears things up for you!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Heidi&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Struggling with encryption, nrf52840 using ncs 1.3.1</title><link>https://devzone.nordicsemi.com/thread/275417?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 15:38:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff6aeec8-2c56-485b-b948-34b0a7d0a60c</guid><dc:creator>basvkesteren</dc:creator><description>&lt;p&gt;Ah, it seems that enabling the oberon stuff (CONFIG_NRF_OBERON=y, CONFIG_OBERON_BACKEND=y) does wonders;&lt;/p&gt;
&lt;p&gt;The mbedtls_aes_setkey_enc/mbedtls_aes_crypt_cbc code now works, have not tested the mbedtls_cipher API bu t I assume that works aswell.&lt;/p&gt;
&lt;p&gt;Does this mean my code doesn&amp;#39;t work on the CC310 module? As I understand it, I&amp;#39;m doing AES-128 here, and the CC310 should support that, right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>