Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Problems in Using nrf crypto hash function

Hello all. I have been having issues using the hash functionality of the nrf crypto library.

Above is the screenshot of the output I am getting for the code shown below:

What I am confused about is two things: it seems that the error code that the function returns (30466) is not defined anywhere, so I am lost on what is actually going wrong.

In addition, it is even more bizarre to me because I have another piece of code based on the nrf crypto library somewhere else in my library that actually does work, and is almost identical to the code that is causing problems:

Both of these functions can compile, but one of them works and the other returns an error that is not defined, and I am not sure what the difference is.

I have actually been having rather a lot of trouble in getting the nrf crypto libraries to work when I move them to different files like this, and it makes me think that maybe I am doing something wrong; I am calling nrf_crypto_init(), but is there something else that I have to do that I need to do in order to get the nrf crypto library to work when it is not in the main.c file?

Thank you very much for any advice or help.

Related