CCM data structure

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.

  1. Does the packet counter (PKTCTR) automatically increments, when packet is encrypted or does it need to be incremented by software?
  2. 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.
  3. How to use the Direction bit, if my implementation won't have master/slave device, as Bluetooth has. Can it be set by random?

Thank you all for the answers.

Parents
  • Hi,

     

    There is not much information about this, as it is aimed for bluetooth. However, there is some discussion on this topic here:

     Encrypting/decrypting packets on-the-fly 

    As well as an example on github: https://github.com/NordicPlayground/nrf52-esb-ccm-example

     

    Does the packet counter (PKTCTR) automatically increments, when packet is encrypted or does it need to be incremented by software?

    You need to increment it.

    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.

    on boot up, unless stored and used at a later point, and on "reconnect" / "re-pair" / "re-sync". Be sure to always change the counter, and never re-use a counter value unless the IV is also re-generated.

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    There is not much information about this, as it is aimed for bluetooth. However, there is some discussion on this topic here:

     Encrypting/decrypting packets on-the-fly 

    As well as an example on github: https://github.com/NordicPlayground/nrf52-esb-ccm-example

     

    Does the packet counter (PKTCTR) automatically increments, when packet is encrypted or does it need to be incremented by software?

    You need to increment it.

    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.

    on boot up, unless stored and used at a later point, and on "reconnect" / "re-pair" / "re-sync". Be sure to always change the counter, and never re-use a counter value unless the IV is also re-generated.

     

    Kind regards,

    Håkon

Children
No Data
Related