Open fermentedfly opened 1 year ago
Hello @fermentedfly,
Thank you for this report. We will get back to you as soon as we analyze it further. This may take some time. Thank you for your comprehension.
With regards,
Hello @fermentedfly,
Thank you for this contribution. Could you please give me more details about this issue, I need to know what internally linked functions you are talking about?
Best Regards,
Hello @HBOSTM ,
I had a deeper look in stm32h7xx_hal_cryp.c
and my initial estimate was a bit optimistic.
I use AES CBC & GCM.
For CBC, making static void CRYP_AES_ProcessData(CRYP_HandleTypeDef *hcryp, uint32_t Timeout)
public is enough although a separate Init()
would be very convenient.
For GCM, static HAL_StatusTypeDef CRYP_AESGCM_Process(CRYP_HandleTypeDef *hcryp, uint32_t Timeout)
needs refactoring, i.e. the function needs to be split in it's three phases (header, data, finalize) in order to feed data multiple times.
For reference, please have a look in stm32l4xx_hal_cryp.c
& stm32l4xx_hal_cryp_ex.c
.
It got my use case (both CBC & GCM) to work while using
HAL_StatusTypeDef HAL_CRYP_Init(CRYP_HandleTypeDef *hcryp)
HAL_StatusTypeDef HAL_CRYPEx_AES(CRYP_HandleTypeDef *hcryp, uint8_t *pInputData, uint16_t Size, uint8_t *pOutputData, uint32_t Timeout)
HAL_StatusTypeDef HAL_CRYPEx_AES_Auth(CRYP_HandleTypeDef *hcryp, uint8_t *pInputData, uint64_t Size, uint8_t *pOutputData, uint32_t Timeout)
(GCM only)It would be superb if you can provide a similar API for STM32H7.
Regards, Manuel
ST Internal Reference: 191062
Hi @fermentedfly,
Your proposal has been forwarded to our development teams. I will get back to you once I have their feedback.
With regards,
As far as I can tell the current
HAL_CRYP_Encrypt
(decrypt as well) provides an all-in-one solution for encryption. This is fine but my use case requires an API that can be initialized and then fed with multiple blocks of data, i.e. something likeInit
->Encrypt Block 1
->Encrypt Block 2
-> ... ->Finalize
Some other HAL implementations, e.g. STM32L4, provide functionality to do this. I've had a look in stm32h7xx_hal_cryp.c and it seems all the required functions are already present but have internal linkage. Please consider making those functions public.
Regards, Manuel