2020-07-28 07:19:58

by Herbert Xu

[permalink] [raw]
Subject: [v3 PATCH 16/31] crypto: caam/qi2 - Set final_chunksize on chacha

The chacha implementation in caam/qi2 does not support partial
operation and therefore this patch sets its final_chunksize to -1
to mark this fact.

This patch also sets the chunksize to the chacha block size.

Signed-off-by: Herbert Xu <[email protected]>
---

drivers/crypto/caam/caamalg_qi2.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/caamalg_qi2.c
index 1b0c286759065..6294c104bf7a9 100644
--- a/drivers/crypto/caam/caamalg_qi2.c
+++ b/drivers/crypto/caam/caamalg_qi2.c
@@ -1689,6 +1689,8 @@ static struct caam_skcipher_alg driver_algs[] = {
.min_keysize = CHACHA_KEY_SIZE,
.max_keysize = CHACHA_KEY_SIZE,
.ivsize = CHACHA_IV_SIZE,
+ .chunksize = CHACHA_BLOCK_SIZE,
+ .final_chunksize = -1,
},
.caam.class1_alg_type = OP_ALG_ALGSEL_CHACHA20,
},


2020-08-10 15:27:59

by Horia Geanta

[permalink] [raw]
Subject: Re: [v3 PATCH 16/31] crypto: caam/qi2 - Set final_chunksize on chacha

On 7/28/2020 10:19 AM, Herbert Xu wrote:
> The chacha implementation in caam/qi2 does not support partial
> operation and therefore this patch sets its final_chunksize to -1
> to mark this fact.
>
> This patch also sets the chunksize to the chacha block size.
>
> Signed-off-by: Herbert Xu <[email protected]>
Reviewed-by: Horia Geantă <[email protected]>

Thanks,
Horia