<?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>CCM data structure</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103612/ccm-data-structure</link><description>Hi, 
 
 I am creating code for radio on nRF52840 without using SoftDevice. I want to secure packets using CCM periphery. In the nRF52840 documentation I found a CCM structure overview (see image below) that I have questions about. 
 
 
 Does the packet</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Sep 2023 12:56:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103612/ccm-data-structure" /><item><title>RE: CCM data structure</title><link>https://devzone.nordicsemi.com/thread/445418?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2023 12:56:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ec1df68-2c04-4544-8452-160ca525aff5</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is not much information about this, as it is aimed for bluetooth. However, there is some discussion on this topic here:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/84262/encrypting-decrypting-packets-on-the-fly"&gt;Encrypting/decrypting packets on-the-fly&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As well as an example on github:&amp;nbsp;&lt;a href="https://github.com/NordicPlayground/nrf52-esb-ccm-example"&gt;https://github.com/NordicPlayground/nrf52-esb-ccm-example&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Does the packet counter (PKTCTR) automatically increments, when packet is encrypted or does it need to be incremented by software?[/quote]
&lt;p&gt;You need to increment it.&lt;/p&gt;
[quote user=""]How often initialization vector (IV) need to be re-generated? I plan to use RNG for updating the IV field, which would take ~1ms. If the IV field has to be re-generated each time, the packet is encrypted/decrypted, it will create ~1ms spacing between each transmitted packet, which is a lot.[/quote]
&lt;p&gt;on boot up, unless stored and used at a later point, and on &amp;quot;reconnect&amp;quot; / &amp;quot;re-pair&amp;quot; / &amp;quot;re-sync&amp;quot;. Be sure to always change the counter, and never re-use a counter value unless the IV is also re-generated.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>