uboot-mediatek: update to version 2022.01
[openwrt/staging/mkresin.git] / target / linux / ipq40xx / patches-5.4 / 0008-v5.6-crypto-qce-fix-ctr-aes-qce-block-chunk-sizes.patch
1 From bb5c863b3d3cbd10e80b2ebf409934a091058f54 Mon Sep 17 00:00:00 2001
2 From: Eneas U de Queiroz <cotequeiroz@gmail.com>
3 Date: Fri, 20 Dec 2019 16:02:13 -0300
4 Subject: [PATCH 02/11] crypto: qce - fix ctr-aes-qce block, chunk sizes
5
6 Set blocksize of ctr-aes-qce to 1, so it can operate as a stream cipher,
7 adding the definition for chucksize instead, where the underlying block
8 size belongs.
9
10 Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
11 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
12 ---
13 drivers/crypto/qce/skcipher.c | 5 ++++-
14 1 file changed, 4 insertions(+), 1 deletion(-)
15
16 --- a/drivers/crypto/qce/skcipher.c
17 +++ b/drivers/crypto/qce/skcipher.c
18 @@ -270,6 +270,7 @@ struct qce_skcipher_def {
19 const char *name;
20 const char *drv_name;
21 unsigned int blocksize;
22 + unsigned int chunksize;
23 unsigned int ivsize;
24 unsigned int min_keysize;
25 unsigned int max_keysize;
26 @@ -298,7 +299,8 @@ static const struct qce_skcipher_def skc
27 .flags = QCE_ALG_AES | QCE_MODE_CTR,
28 .name = "ctr(aes)",
29 .drv_name = "ctr-aes-qce",
30 - .blocksize = AES_BLOCK_SIZE,
31 + .blocksize = 1,
32 + .chunksize = AES_BLOCK_SIZE,
33 .ivsize = AES_BLOCK_SIZE,
34 .min_keysize = AES_MIN_KEY_SIZE,
35 .max_keysize = AES_MAX_KEY_SIZE,
36 @@ -368,6 +370,7 @@ static int qce_skcipher_register_one(con
37 def->drv_name);
38
39 alg->base.cra_blocksize = def->blocksize;
40 + alg->chunksize = def->chunksize;
41 alg->ivsize = def->ivsize;
42 alg->min_keysize = def->min_keysize;
43 alg->max_keysize = def->max_keysize;