This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

AES hardware decryption

Hello. We are using nrf52840 for our product and I wanted to use aes ccm encryption for security. I was able to integrate CC310 library but I found out that encryption works fine but decryption returns CRYS_FATAL_ERROR (0x00F50000). I tried basic example and it fails the same way if I change mode to decrypt (examples/crypto/nrf_cc310/aes, main.c:90 ret = CRYS_AESCCM(SASI_AES_DECRYPT,). 

Regards

Parents
  • Turns out that valid MAC must be provided. Otherewise decryption fails with this not very descriptive error code. 

    NORDIC: Consider creating error code for wrong MAC. Also it would be nice to mention MAC will be checked internally. My understanding was that MAC will be calculated over decrypted message and returned to user to compare with received one. Maybe that solution is obvious for people common with crypto but that wasnt me Slight smile

Reply
  • Turns out that valid MAC must be provided. Otherewise decryption fails with this not very descriptive error code. 

    NORDIC: Consider creating error code for wrong MAC. Also it would be nice to mention MAC will be checked internally. My understanding was that MAC will be calculated over decrypted message and returned to user to compare with received one. Maybe that solution is obvious for people common with crypto but that wasnt me Slight smile

Children
Related