I did not find how to manage MD5 calculation.
The closiest exapmle is `samples/crypto/sha256` and I have started to play with it. Simple replacement of "alg" parameter from "PSA_ALG_SHA_256" to "PSA_ALG_MD5" in functions psa_hash_compute(psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *hash, size_t hash_size, size_t *hash_length) and psa_hash_compare(psa_algorithm_t alg, const uint8_t *input, size_t input_length, const uint8_t *hash, size_t hash_length) produces errors:
*** Booting Zephyr OS build v3.2.99-ncs1 ***
[00:00:00.613,220] <inf> sha256: Starting SHA256 example...
[00:00:00.613,250] <inf> sha256: Hashing using SHA256...
[00:00:00.613,464] <inf> sha256: psa_hash_compute failed! (Error: -134)
[00:00:00.613,464] <inf> sha256: Example exited with error!
Error means PSA_ERROR_NOT_SUPPORTED. I have tried different configuration options with same negative effect.
I am using:
Windows 10 Home
nrf-connect.sdk:2.2.0
nrf-connect.toolchain:2.2.0
nRF9160-DK version NRF9160_xxAA_REV2
My last configuration is:
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_LOG=y
CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_BUFFER_SIZE=15360
CONFIG_BUILD_WITH_TFM=y
CONFIG_TFM_PROFILE_TYPE_NOT_SET=y
# Enable nordic security backend and PSA APIs
CONFIG_NRF_SECURITY=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=8192
CONFIG_PSA_CRYPTO_DRIVER_OBERON=n
CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y
CONFIG_MBEDTLS_PSA_BUILTIN_ALG_MD5=y
CONFIG_PSA_WANT_ALG_MD5=y