Hi I am working on a security focused project. I have written some functions that perform AES-128 cipher encryption using PSA_ALG_CBC_NO_PADDING and a key with a persistent lifetime PSA_KEY_LIFETIME_PERSISTENT. I developed and tested the functions initially without TF-M and they worked as expected. Now I am switching to using the TF-M environment with PSA_CRYPT in a secure partition.
The issue that I'm having is that I get an PSA_ERROR_INVALID_ARGUMENT (-135) when I call psa_cipher_encrypt.
I was able to trace the code down through submitting the IPC call and also after it has reached tfm_crypto_sfn.
I was also able to confirm it reached nrfxlib/nrf_security/src/psa_crypto_drivers_wrapper psa_driver_wrapper_cipher_encrypt(...) but from there I was unable to trace it any further. While debugging it appeared to reach line 897 where it would call cc3xx_cipher_encrypt but VS Code cannot find the source for this function.
I should note, I am calling the psa_cipher_encrypt from a secure partition, though I suspect the problem would be same if I call from the non-secure partition as well.
I have attached the zephyr/.config file (as example.config)
I suspect there is a mis-configuration that is selecting the OBERON driver instead of the nrf_cc3xx driver, but I'm not sure how/why that is occurring.
Any recommendations on how to track down the issue?
Why does VSCode get lost when it tries to enter cc3xx_cipher_encrypt?