<?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>AES Encryption not working in nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53710/aes-encryption-not-working-in-nrf52840</link><description>Hello, 
 I am developing in Windows 10 machine in visual studio code. I cannot use Seggar studio. Devloping for nRF52840 dongle with nRF15 sdk. 
 I have written the below code to test the simple AES encryption in ECB mode. However, particularly at the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Oct 2019 08:39:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53710/aes-encryption-not-working-in-nrf52840" /><item><title>RE: AES Encryption not working in nRF52840</title><link>https://devzone.nordicsemi.com/thread/217001?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2019 08:39:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7c3344b-74fb-4b44-ace2-e809cbb9de6e</guid><dc:creator>AyushMet</dc:creator><description>&lt;p&gt;Today I got it completely running fine without any problem. Firstly, in line 21 of main.c, change key[128] to data_in[128]. Secondly, in lines 43,44,45 change 16 to 128 because our data to be encrypted is 128 bytes not 16 bytes. Thirdly, in line 40, change data_in[16] to key[16] because a key length is 128 bits or 16 bytes. And at last, all that was needed is:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the Makefile, under the library, include the following:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#&amp;nbsp;Libraries&amp;nbsp;common&amp;nbsp;to&amp;nbsp;all&amp;nbsp;targets&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;LIB_FILES&lt;/span&gt;&lt;span&gt;&amp;nbsp;+=&amp;nbsp;&lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;$(&lt;/span&gt;&lt;span&gt;SDK_ROOT&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;/external/nrf_cc310/lib/cortex-m4/hard-float/libnrf_cc310_0.9.12.a&amp;nbsp;&lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Th whole problem got resolved. The data got correctly encrypted. &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; Hopefully it can help someone else exploring crypto libraries.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>