mbedtls PBKDF2: Activating function in prj.conf is not possible

Hello,

I want to use the function mbedtls_pkcs5_pbkdf2_hmac which can be found in mbedtls\library\pkc5s.c.

There is a compiler switch named  MBEDTLS_PKCS5_C which activates this function.

I thougt if I set the following configurations in prj.conf the function would be available for compiling my code. But it is not:

CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_PKCS5_C=y
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=8192


If I uncomment MBEDTLS_PKCS5_C in file pkc5s.c it is working as intended.
Should this be activated in another way? There is also a config-file called: nrf-config-user.h Should I use this instead? If yes, how?
I am using nrf connect v2.0.0.
Regards
Jan
Parents
  • Hi,

    Do you have TF-M (_ns) enabled for your device?
    If so, this can change how things work.

    Also, to make sure it is not an XY problem, can you shortly explain why you need the mbedtls_pkcs5_pbkdf2_hmac function?

    For some docs, see Nordic Security Module. When i get more information, I can probably give you more specific docs as well

    Regards,
    Sigurd Hellesvik

  • Thanks for the fast reply!

    In our project we commited to use the PBKDF2 for key derviation. Because it is supported on all platforms we use. I found out that the mbedtls provides this function.
    As I mentioned I am currently working with the v2.0.0. It seems that PBKDF2 is not supported by the Nordic security module (nrf_security/doc/driver_config). Only in the link you posted (latest version of nrf Connect) the CONFIG_PSA_WANT_ALG_PBKDF2_HMAC is mentioned which will possibly meet my requirements.

    After my holiday I will upgrade to the latest version of nrf Connect and try it.
    Just to clearify there is a note in your posted link: PBKDF2 algorithms are not supported with TF-M. 

    So I cannot use it with the _ns board build configuration?

Reply
  • Thanks for the fast reply!

    In our project we commited to use the PBKDF2 for key derviation. Because it is supported on all platforms we use. I found out that the mbedtls provides this function.
    As I mentioned I am currently working with the v2.0.0. It seems that PBKDF2 is not supported by the Nordic security module (nrf_security/doc/driver_config). Only in the link you posted (latest version of nrf Connect) the CONFIG_PSA_WANT_ALG_PBKDF2_HMAC is mentioned which will possibly meet my requirements.

    After my holiday I will upgrade to the latest version of nrf Connect and try it.
    Just to clearify there is a note in your posted link: PBKDF2 algorithms are not supported with TF-M. 

    So I cannot use it with the _ns board build configuration?

Children
Related