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

Bootloader build with ECDSA256 (nRF52832, SDK 16.0.0, S132 v7.0.1)

I want to bring up a secure bootloader with support for ECDSA and SHA-256.

I am having a hard time coming up with a combination of SDK components (frontend, backend), external libraries, and preprocessor symbol definitions in the sdk_config.h file.

I am a novice when it comes to security and am somewhat clueless as to what is needed to create such a firmware design.

I have been able to 'compile' the uECC source code with the GCC ARM compiler of my choice.

The first issue I ran into was that I need to set up a 'frontend' and a 'backend'.

1. In this regard I am not sure what role is played by the external uECC library that I built with GCC ARM.

2.I was able to recreate the build used by the secure_bootloader example but over time I am beginning to get the feeling that the configuration out of the box does not support ECDSA-256 (?)

3. I found out, after navigating through many web pages and spending quite a few hours, that the 310 backend is NOT supported on the nRF52832. Now I don't know what is ACTUALLY supported on the nRF52832 -- should Iuse uECC or should I use OBERON or 'nrf sw implementation/?

I have been playing with the various options and some builds do complete with no errors but there are warnings that I am not comfortable about ignoring.
An example is when I tried to enable the OBERON backend --
  If I enable all the same flags in the basic crypto example I get this warning (even though the build succeeds)
        #warning "NRF_CRYPTO_CURVE25519_BIG_ENDIAN_ENABLED not defined. Please define it to choose the endianness of Curve25519 parameters."

If I do not define the Curve25519 specific parameters then I get this warning:
        #warning NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED define not found in sdk_config.h (Is the sdk_config.h valid?)

Basically I think I am just going through a lot of trial and error without any clear idea of how to approach this problem.

Any input would be appreciated.

Cheers

RMV

  • Hi RMV,

    RVM said:
    The problem is that I never seem to get a clean build with NO WARNINGS in the build output.

    I am not sure why that causes (if you need assistance on that please provide more information or code). But as explained before, the SDK bootloader example works with ECDSA_P256_SHA256 boot validation out of the box, and the example bootloader builds without any warnings or errors. So you need to look into your changes.

    RVM said:
    I have now been made aware that one of the warnings I see can  and should be ignored so maybe I should not be so paranoic about it

    Not sure about that, I would say you should always make your code warning free. If not, you risk tuning your mind to ignoring warnings that actually matter, and then you will regret going down that path in the first place Slight smile

    Einar

  • Hi RMV, 

    RVM said:
    It looks like this symbol is defined in one of these backends (cc310, cc310_bl, mbedtls, nrf_sw, oberon) but I do not see this symbol being defined in the micro-ecc. How then does one use the micro-ecc for the backend?

    micro-ecc will do the elliptic curve cryptography, but no the hashing. I recommend you just refer to a example bootloader project for the nRF52832. Then you will see that in addition to the micro-ecc backend, NRF_CRYPTO_BACKEND_NRF_SW_ENABLED is set to 1 and NRF_CRYPTO_BACKEND_NRF_SW_HASH_SHA256_ENABLED is set to 1. That provides the SHA256 support that you are currently missing.

    Einar

  • Hi Einar,

    I don't think I quite agree with all the arrangements but I will mark this as answered so this ticket can be closed.

    Cheers

    RMV

Related