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

Is this a bug in 'nrf_crypto_hash.c'

I have been trying to bring up a secure boot loader for our product based on the nRF52832 SoC.

I have reviewed three SDK versions (17.0.2, 16.0.0, 15.3.0) and observe the same misleading 'WARNING' when compiling the file 'components/libraries/crypto/nrf_crypto_hash.c'

// Internal allocation of context not available for CC310_BL in order to save code size.
#if defined(NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED) && (NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED == 1)
    // Do nothing
#elif defined(NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED) && (NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED == 0)
    // Validate input. Only validate input parameters that are used locally, others are validated
    // in the init, update and/or finalize functions.
    VERIFY_TRUE(p_info != NULL, NRF_ERROR_CRYPTO_INPUT_NULL);
    // Allocate context if needed (not provided by the user).
    if (p_context == NULL)
    {
        p_allocated_context = NRF_CRYPTO_ALLOC(p_info->context_size);
        if (p_allocated_context == NULL)
        {
            return NRF_ERROR_CRYPTO_ALLOC_FAILED;
        }
        p_ctx = (nrf_crypto_hash_context_t *)p_allocated_context;
    }    
#else
    #warning NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED define not found in sdk_config.h (Is the sdk_config.h valid?).
#endif // NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED

I think this is not right -- there is NO CC310 component in the nRF52832 device and this warning is absolutely misleading -- I lost quite a few hours trying to see why my
specific configuration was generating this --- when all along I suspect it is wrong code released in this SDK.

Cheers
RMV
Parents Reply Children
No Data
Related