2024-09-24 05:26 AM - edited 2024-09-24 06:12 AM
Hi,
I am implementing the sbsfu encryption functionality on the stm32u575 micros which do not contain hardware accelerator. For this I have decided to use x-cube cryptolib to be able to encrypt and decrypt messages. I have tested the example aes_cbc_encryptdecrypt on the u575zi-q motherboard and it works perfectly. Now I am trying to implement the same example on a u575 micro with sbsfu, but when encrypting, it does not produce the expected ciphertext values for the default text. Any help?
Solved! Go to Solution.
2024-09-26 08:13 AM
Hello @Istillaga,
I could reproduce the problem.
The issue is that SBSFU is using CRC.
What you need to do is to reset the CRC.
In cmox_low_level.c please add the force reset of the CRC IP like this:
cmox_init_retval_t cmox_ll_init(void *pArg)
{
(void)pArg;
/* Ensure CRC is enabled for cryptographic processing */
__HAL_RCC_CRC_FORCE_RESET();
__HAL_RCC_CRC_RELEASE_RESET();
__HAL_RCC_CRC_CLK_ENABLE();
return CMOX_INIT_SUCCESS;
}
Then you should be ok
Best regards
Jocelyn
2024-09-25 09:25 AM
Hello @Istillaga ,
I'm not sure to understand your setup.
"I am implementing the sbsfu encryption functionality" does not really makes sense to me.
You use SBSFU to launch your application securely and you implement crypto inside your application ?
Is that what your are saying?
Best regards
Jocelyn
2024-09-25 09:52 AM - edited 2024-09-25 09:53 AM
Hello @Jocelyn RICARD,
Yes, that's what I wanted to say. I have implemented crypto in my application but it is not encrypting well.
I'm sorry I wrote quickly and I didn't realise that the sentence didn't make sense.
2024-09-26 08:13 AM
Hello @Istillaga,
I could reproduce the problem.
The issue is that SBSFU is using CRC.
What you need to do is to reset the CRC.
In cmox_low_level.c please add the force reset of the CRC IP like this:
cmox_init_retval_t cmox_ll_init(void *pArg)
{
(void)pArg;
/* Ensure CRC is enabled for cryptographic processing */
__HAL_RCC_CRC_FORCE_RESET();
__HAL_RCC_CRC_RELEASE_RESET();
__HAL_RCC_CRC_CLK_ENABLE();
return CMOX_INIT_SUCCESS;
}
Then you should be ok
Best regards
Jocelyn