I am using iMX6 SABRE board for smart devices and the platform SDK. I am trying to use AES encrpt/decrypt capability of the CAAM module. I see sample code for encryption in: sdk/drivers/caam/src/caam.c camm_enc_data() but can't find a similar function for decryption. Based on my reading of the security manual, I changed the ENCRYPT_DESC4 to 0x8210020C from 0x8210020D. I am still keeping the DK bit to 0, so the CAAM can convert the encrypt key form to decrypt key form and using the same encryption function. I get decrypt errors. How do I get decryption to work? Thanks.
Unfortunately, we do not have a ready code for i.MX6 processors that would
be used as an example for decryption. Perhaps it makes sense to apply to u-Boot
sources, concerned with Power architecture systems, equipped with CAAM module,
which is generally compatible with one of i.MX6. Although this code has not been
directly verified on our ARM devices, it can serve as a reference :
cmd_esbc_validate.c
fsl_validate.c
jobdesc.c
Have a great day,
Yuri
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------