Re: [v5 PATCH 5/7] crypto: stm32 - Move hash state into separate structure

From: Linus Walleij
Date: Mon Mar 06 2023 - 04:59:24 EST


Hi Herbert,

thanks for keeping going at this!

On Mon, Mar 6, 2023 at 5:42 AM Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:

> Create a new struct stm32_hash_state so that it may be exported
> in future instead of the entire request context.
>
> Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

First the patch bugged but I found the problem in a small semantic
glitch:

diff --git a/drivers/crypto/stm32/stm32-hash.c
b/drivers/crypto/stm32/stm32-hash.c
index de8275a80271..3743f55b5c04 100644
--- a/drivers/crypto/stm32/stm32-hash.c
+++ b/drivers/crypto/stm32/stm32-hash.c
@@ -785,7 +785,7 @@ static int stm32_hash_final_req(struct stm32_hash_dev *hdev)
if (state->flags & HASH_FLAGS_FINUP)
return stm32_hash_update_req(hdev);

- return stm32_hash_xmit_cpu(hdev, state->buffer, state->buflen, 1);
+ return stm32_hash_xmit_cpu(hdev, state->buffer, state->bufcnt, 1);
}

static void stm32_hash_emptymsg_fallback(struct ahash_request *req)

Afte this all (extended) tests pass fine.

Just fold in this and you can add:
Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
Tested-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Yours,
Linus Walleij