Showing results for 
Search instead for 
Did you mean: 

CRC engine is reseted to default when crypto lib is used.


Hello st forum, 

I'm currently working on mcu STM32G0B1VCI6; the part of the code that I'm using is considering the setup of the crypto lib and the CRC engine. However, I noted that the CRC configuration is being changed automatically when some crypto functions are invoked. Example:

  1. Initialize CRC engine with specific configuration.
  2. Initialize crypto Lib by calling cmox_initialize
  3. Call cmox_ecdsa_verify to verify signature.
  4. Calculate some CRC of certain memory block.


The result in step 4 is different than the expected (compared against an online tool) but if the CRC is calculated between step 2 and 3, the CRC matches. 

I wonder if crypto library forces a reset in the CRC registers for its own purposes.

Is this a bug in the crypto lib or is expected? if it is expected how can I use the desired CRC configuration without impacting crypto lib?

I hope you can help, 


José Daniel


>>Is this a bug in the crypto lib or is expected?

Yes, it locks things to the STM32 architecture. They basically use it to do a pattern test, and xor against obfuscated constants.

Massive PITA

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks for the reply @Tesla DeLorean 

So, would be ok to call HAL_CRC_Init just one line before calling HAL_CRC_Calculate? or this would impact crypto lib for further operations?


ST Employee

Hello @JDaniel1 


This post has been escalated to the ST Online Support Team for additional assistance.  We'll contact you directly.