Showing results for 
Search instead for 
Did you mean: 

CCM stream decryption fails with hardware crypto implementation.

Associate II

Hello everyone,

I am currently evaluating SSL with a local server and an STM32 device. I'm unable to figure out why the decryption fails with CCM as the cipher suite.

FYI: I am using MbedTLS v2.14.1.


   I'm using x86 local server with STM32 device as a client.

Here is what happens-

1. Software CCM implementation on the client:

    When I use the software implementation of the CCM. Handshake and decryption is  successful. Therefore, I can stream the data from STM32 and read it on the local server.

2. Hardware CCM implementation with MBEDTLS_CCM_ALT:

   I have used ccm_alt.c provided from STM32Cube v1.9.0. Here, the handshake is successful. But decrypting the message fails.

The errors are:

ssl_decrypt_buf() returned -29056 (-0x7180)

mbedtls_ssl_read_record() returned -29056 (-0x7180)

Checks performed:

  • Same certificates are used for SW and HW implementations.
  • CCM self test returns '0' for both HW and SW CCM implementations.
  • I have reserved enough heap, no memory issues.

Please find all the necessary data in the attachment provided. I have added the logs from the server and the client. I have added the certificates and the code files as well.

It would be of great help if somebody could point at what might be going wrong.

Thank you!

Best regards,