This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Enabling Crypto Hardware backend feature on nRF52840

Hello,

I am using nRF52840, SDK_16.0.0, S140 SoftDevice and Segger 4.16 for flashing the image. I am using ‘ble_app_blinky’.

I have queries on enabling HW crpto accelerator and back end mode.

1) If I want to enable HW crypto accelerator then do I need to enable NRF_CRYPTO_BACKEND_CC310_ENABLED or already taken care by NRF_CRYPTO_BACKEND_CC310_BL_ENABLED ?

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v16.0.0%2Flib_crypto_config.html

2) If I enable NRF_CRYPTO_BACKEND_CC310_ENABLED, whether there is no need of micro-ecc and can I disable NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED ?

a) Even whether there is no need to compile and include micro_ecc_lib_nrf52.a if HW crypto accelerator is enabled.

Whether my above assumptions are correct ?

3) If I want to enable backend crypto, then whether do I need to disable NRF_CRYPTO_ENABLED.

a) As per below statement for frontend still needs backend functionality. But if I want backend functionality, still do I need front end by enabling NRF_CRYPTO_ENABLED.

“Keep in mind that at least one of the nrf_crypto backends is required to use the API functions”

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v16.0.0%2Flib_crypto_config.html&anchor=lib_crypto_config_automatic_defines_usage

4) Whether all above macros changes to be enabled only in "Secure BLE bootloader" or even at application (Ex: ble_app_blinky).

5) What is the difference between “pca10056_s140_ble_debug” and “pca10056_s140_ble” (With and without _debug).

 

6) What is the difference between cryptography library with backend and frontend

a) (Is backend mean crypto runs in hardware and frontend mean crypto runs is in software. Then in that case what is “software backend” and “hardware backend”. Bit confusion about the terminology.

 

Thanks & Regards

Vishnu Beema

Parents
  • Hi Vishnu,

    1a). No, you can use CryptoCell (CC310) in the bootloader, but you need to use the CC310_BL backend for size reasons. This only supports the operations that are needed for the bootloader. So in the bootloader, you should set NRF_CRYPTO_BACKEND_CC310_ENABLED to 0 and NRF_CRYPTO_BACKEND_CC310_BL_ENABLED to 1. If you use the "normal" (non-BL) variant in the bootloader, you will get problems fitting it unless you increase the bootloader size.

    1b) No. The only difference is that the library is stripped down to only provide what is needed by the bootloader. There is no impact on current consumption. (Also, the crypto operations in the bootloder normally only happen during DFU, which is not performed often, so even if it was different with regards to current consumption - which it is not - it would not matter much.

    2) Why do you want to use micro-ecc on the nRF52840 when you have CC310? I do not see a good reason for it, unless in some very specific corner cases. I suggest you set NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED to 0 in both the application and bootloader. This is also the default in SDK example projects for nRF52840 (those targeting pca10056). Note that for DFU, you just need ECC support (via CC310 I recomend) in the bootloader. Unless you have other use for it in the application you kan disable it. But there is no need to change if you do not want since it will anyway be removed from the linker since it is not used.

    2a) I don't understand the problem? If you do not  need eliptic curve cryptography in your application, it is not relevant there. And if you need it in the bootloader, you should use CC310_BL. So the best is to just forget about micro-ecc.

    Br,

    Einar

Reply
  • Hi Vishnu,

    1a). No, you can use CryptoCell (CC310) in the bootloader, but you need to use the CC310_BL backend for size reasons. This only supports the operations that are needed for the bootloader. So in the bootloader, you should set NRF_CRYPTO_BACKEND_CC310_ENABLED to 0 and NRF_CRYPTO_BACKEND_CC310_BL_ENABLED to 1. If you use the "normal" (non-BL) variant in the bootloader, you will get problems fitting it unless you increase the bootloader size.

    1b) No. The only difference is that the library is stripped down to only provide what is needed by the bootloader. There is no impact on current consumption. (Also, the crypto operations in the bootloder normally only happen during DFU, which is not performed often, so even if it was different with regards to current consumption - which it is not - it would not matter much.

    2) Why do you want to use micro-ecc on the nRF52840 when you have CC310? I do not see a good reason for it, unless in some very specific corner cases. I suggest you set NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED to 0 in both the application and bootloader. This is also the default in SDK example projects for nRF52840 (those targeting pca10056). Note that for DFU, you just need ECC support (via CC310 I recomend) in the bootloader. Unless you have other use for it in the application you kan disable it. But there is no need to change if you do not want since it will anyway be removed from the linker since it is not used.

    2a) I don't understand the problem? If you do not  need eliptic curve cryptography in your application, it is not relevant there. And if you need it in the bootloader, you should use CC310_BL. So the best is to just forget about micro-ecc.

    Br,

    Einar

Children
No Data
Related