-
Couldn't load subscription status.
- Fork 8.1k
drivers: crypto: hash driver for the STM32H7RS series #94749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
west build -p -b nucleo_h7s3l8 tests/crypto/crypto_hash/ with LOG |
a13bcc9 to
fbf3bda
Compare
635d0b2 to
67b6ed6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM aside some indentation issues to be addressed or not.
67b6ed6 to
00e5575
Compare
|
Requires one commit to fix regression after #94869 --> fix the CI error on build
|
00e5575 to
cdd996e
Compare
cdd996e to
91cc28e
Compare
|
Requires #95470 |
Adapt the stm32 crypto hash driver for the stm32h7rs HAL modules Create hal_func_hash_SHAxxx_start to abstract the algorithm The crypto algo is set by the HAL_HASH_SetConfig function Signed-off-by: Francois Ramu <[email protected]>
Add the HASH processor "st,stm32-hash" of the stm32H7RS series. Signed-off-by: Francois Ramu <[email protected]>
Enables the crypto HASH processor on the nucleo_h7s3l8. Signed-off-by: Francois Ramu <[email protected]>
Enable crypto.hash test on nucleo_h7s3l8 board disco kit Signed-off-by: Francois Ramu <[email protected]>
91cc28e to
d6cb04f
Compare
|
rebase on f878a55 |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Some coding style minor issues worth to address but not blocking.
| { | ||
| #if defined(CONFIG_SOC_SERIES_STM32H7RSX) | ||
| hhash->Init.Algorithm = HASH_ALGOSELECTION_SHA256; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpicking consistency: remove this empty line, as in hal_func_hash_SHA224_start().
| static inline HAL_StatusTypeDef hal_func_hash_SHA224_start(HASH_HandleTypeDef *hhash, | ||
| void *p_in_buffer, | ||
| uint32_t in_size_byte, | ||
| void *p_out_buffer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indenattion
static inline HAL_StatusTypeDef hal_func_hash_SHA224_start(HASH_HandleTypeDef *hhash,
void *p_in_buffer,
uint32_t in_size_byte,
void *p_out_buffer)Ditto for hal_func_hash_SHA256_start().
| pkt->out_buf, HAL_MAX_DELAY); | ||
| LOG_DBG("HASH compute SHA256"); | ||
| status = hal_func_hash_SHA256_start(&data->hhash, pkt->in_buf, pkt->in_len, | ||
| pkt->out_buf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
status = hal_func_hash_SHA256_start(&data->hhash, pkt->in_buf, pkt->in_len,
pkt->out_buf);| uint32_t in_size_byte, | ||
| void *p_out_buffer) | ||
| { | ||
| #if defined(CONFIG_SOC_SERIES_STM32H7RSX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can see, this implementation (calling HAL_HASH_SetConfig()/HAL_HASH_Start() instead of HAL_HASHEx_SHA224_Start() is also common with other all recent STM32 series (H5,MP2,N6,U3,WBA).
In order to avoid updating driver code with || defined(CONFIG_SOC_SERIES_STM32FOO) for each new series, let's define a new Kconfig (CRYPTO_STM32_HASH_HAL_CFG_START for instance) that would be selected by these series when driver support is added. That would minimize effort to add new series and be better for code readability.
(I'm not proposing a new compatible, as I think this is not an issue of HW, but pure HAL implementation, but I could be wrong)
|
to be reconsidered later "on-demand" |



Following the #93923
this PR adds the support of crypto hash hardware to the stm32h7RS
Note that
-T crypto.hashwill use the SW hashThe testcase only tests the SHA256, more SHA are available on the stm32 hash hw processors and main could be extended