X-CUBE cryptolib in sbsfu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-24 5:26 AM - edited ‎2024-09-24 6: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.
- Labels:
-
SBSFU
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-26 8: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-25 9: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-25 9:52 AM - edited ‎2024-09-25 9: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-26 8: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
