arch/risc-v/espressif: Fix SHA errors

Fix SHA errors for esp32[-c3|-c6|-h2]

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
This commit is contained in:
Eren Terzioglu
2026-02-06 15:01:40 +01:00
committed by simbit18
parent 4775f5ba21
commit 19b6e15dbd
@@ -398,6 +398,15 @@ static int esp_newsession(uint32_t *sid, struct cryptoini *cri)
return -ENOBUFS;
}
if (cri->cri_klen / 8 > axf->keysize)
{
axf->init(data->hw_ictx);
axf->update(data->hw_ictx, (uint8_t *)cri->cri_key,
cri->cri_klen / 8);
axf->final((uint8_t *)cri->cri_key, data->hw_ictx);
cri->cri_klen = axf->hashsize * 8;
}
for (k = 0; k < cri->cri_klen / 8; k++)
{
cri->cri_key[k] ^= HMAC_IPAD_VAL;