Hello,
I am porting to nRF5340 from nRF52833. Previously, we were using sdk17.0.2 for nRF52833 and we were able to successfully implement encryption algorithm AES-CTR-128 with sdk 17.0.2.
Now that we are porting to nRF5340, we would want to implement the same encryption algorithm using Zephyr and NCS sdk.
I'm using the NCS 1.9.1 sdk and I was able to implement the PSA encryption AES-CTR-128 algorithm based on the example found in v1.9.1\nrf\samples\crypto\aes_ctr\
I was able to encrypt input messages successfully. But these input messages had to be multiples of 16 bytes. If I send a message of the size that is not a multiple of 16 bytes,
PSA_ERROR_INVALID_ARGUMENT.
This was not the case with sdk17.0.2 with nRF52833. I was able to encrypt messages of any length. I also understand that AES-CTR-128 algorithm does need padding. So it should be possible to encrypt/decrypt message of any length.
Could you let me know what I could be doing wrong? And how to achieve encryption using AES-CTR-128 algorithm for input messages of any length.
Thanks for your time!
Regards,
Regie