All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Brugger <matthias.bgg@gmail.com>
To: Ard Biesheuvel <ardb@kernel.org>, linux-crypto@vger.kernel.org
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Biggers <ebiggers@google.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v3 17/29] crypto: mediatek - switch to skcipher API
Date: Sun, 10 Nov 2019 19:31:48 +0100	[thread overview]
Message-ID: <fdba315c-a1db-4038-0775-e8016cab4045@gmail.com> (raw)
In-Reply-To: <20191105132826.1838-18-ardb@kernel.org>



On 05/11/2019 14:28, Ard Biesheuvel wrote:
> Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface")
> dated 20 august 2015 introduced the new skcipher API which is supposed to
> replace both blkcipher and ablkcipher. While all consumers of the API have
> been converted long ago, some producers of the ablkcipher remain, forcing
> us to keep the ablkcipher support routines alive, along with the matching
> code to expose [a]blkciphers via the skcipher API.
> 
> So switch this driver to the skcipher API, allowing us to finally drop the
> blkcipher code in the near future.
> 
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: linux-mediatek@lists.infradead.org
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>  drivers/crypto/mediatek/mtk-aes.c | 248 +++++++++-----------
>  1 file changed, 116 insertions(+), 132 deletions(-)
> 
> diff --git a/drivers/crypto/mediatek/mtk-aes.c b/drivers/crypto/mediatek/mtk-aes.c
> index d43410259113..90880a81c534 100644
> --- a/drivers/crypto/mediatek/mtk-aes.c
> +++ b/drivers/crypto/mediatek/mtk-aes.c
> @@ -11,6 +11,7 @@
>  
>  #include <crypto/aes.h>
>  #include <crypto/gcm.h>
> +#include <crypto/internal/skcipher.h>
>  #include "mtk-platform.h"
>  
>  #define AES_QUEUE_SIZE		512
> @@ -414,7 +415,7 @@ static int mtk_aes_map(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  static void mtk_aes_info_init(struct mtk_cryp *cryp, struct mtk_aes_rec *aes,
>  			      size_t len)
>  {
> -	struct ablkcipher_request *req = ablkcipher_request_cast(aes->areq);
> +	struct skcipher_request *req = skcipher_request_cast(aes->areq);
>  	struct mtk_aes_base_ctx *ctx = aes->ctx;
>  	struct mtk_aes_info *info = &ctx->info;
>  	u32 cnt = 0;
> @@ -450,7 +451,7 @@ static void mtk_aes_info_init(struct mtk_cryp *cryp, struct mtk_aes_rec *aes,
>  		return;
>  	}
>  
> -	mtk_aes_write_state_le(info->state + ctx->keylen, req->info,
> +	mtk_aes_write_state_le(info->state + ctx->keylen, (void *)req->iv,
>  			       AES_BLOCK_SIZE);
>  ctr:
>  	info->tfm[0] += AES_TFM_SIZE(SIZE_IN_WORDS(AES_BLOCK_SIZE));
> @@ -552,13 +553,13 @@ static int mtk_aes_transfer_complete(struct mtk_cryp *cryp,
>  
>  static int mtk_aes_start(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  {
> -	struct ablkcipher_request *req = ablkcipher_request_cast(aes->areq);
> -	struct mtk_aes_reqctx *rctx = ablkcipher_request_ctx(req);
> +	struct skcipher_request *req = skcipher_request_cast(aes->areq);
> +	struct mtk_aes_reqctx *rctx = skcipher_request_ctx(req);
>  
>  	mtk_aes_set_mode(aes, rctx);
>  	aes->resume = mtk_aes_transfer_complete;
>  
> -	return mtk_aes_dma(cryp, aes, req->src, req->dst, req->nbytes);
> +	return mtk_aes_dma(cryp, aes, req->src, req->dst, req->cryptlen);
>  }
>  
>  static inline struct mtk_aes_ctr_ctx *
> @@ -571,7 +572,7 @@ static int mtk_aes_ctr_transfer(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  {
>  	struct mtk_aes_base_ctx *ctx = aes->ctx;
>  	struct mtk_aes_ctr_ctx *cctx = mtk_aes_ctr_ctx_cast(ctx);
> -	struct ablkcipher_request *req = ablkcipher_request_cast(aes->areq);
> +	struct skcipher_request *req = skcipher_request_cast(aes->areq);
>  	struct scatterlist *src, *dst;
>  	u32 start, end, ctr, blocks;
>  	size_t datalen;
> @@ -579,11 +580,11 @@ static int mtk_aes_ctr_transfer(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  
>  	/* Check for transfer completion. */
>  	cctx->offset += aes->total;
> -	if (cctx->offset >= req->nbytes)
> +	if (cctx->offset >= req->cryptlen)
>  		return mtk_aes_transfer_complete(cryp, aes);
>  
>  	/* Compute data length. */
> -	datalen = req->nbytes - cctx->offset;
> +	datalen = req->cryptlen - cctx->offset;
>  	blocks = DIV_ROUND_UP(datalen, AES_BLOCK_SIZE);
>  	ctr = be32_to_cpu(cctx->iv[3]);
>  
> @@ -620,12 +621,12 @@ static int mtk_aes_ctr_transfer(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  static int mtk_aes_ctr_start(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  {
>  	struct mtk_aes_ctr_ctx *cctx = mtk_aes_ctr_ctx_cast(aes->ctx);
> -	struct ablkcipher_request *req = ablkcipher_request_cast(aes->areq);
> -	struct mtk_aes_reqctx *rctx = ablkcipher_request_ctx(req);
> +	struct skcipher_request *req = skcipher_request_cast(aes->areq);
> +	struct mtk_aes_reqctx *rctx = skcipher_request_ctx(req);
>  
>  	mtk_aes_set_mode(aes, rctx);
>  
> -	memcpy(cctx->iv, req->info, AES_BLOCK_SIZE);
> +	memcpy(cctx->iv, req->iv, AES_BLOCK_SIZE);
>  	cctx->offset = 0;
>  	aes->total = 0;
>  	aes->resume = mtk_aes_ctr_transfer;
> @@ -634,10 +635,10 @@ static int mtk_aes_ctr_start(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  }
>  
>  /* Check and set the AES key to transform state buffer */
> -static int mtk_aes_setkey(struct crypto_ablkcipher *tfm,
> +static int mtk_aes_setkey(struct crypto_skcipher *tfm,
>  			  const u8 *key, u32 keylen)
>  {
> -	struct mtk_aes_base_ctx *ctx = crypto_ablkcipher_ctx(tfm);
> +	struct mtk_aes_base_ctx *ctx = crypto_skcipher_ctx(tfm);
>  
>  	switch (keylen) {
>  	case AES_KEYSIZE_128:
> @@ -651,7 +652,7 @@ static int mtk_aes_setkey(struct crypto_ablkcipher *tfm,
>  		break;
>  
>  	default:
> -		crypto_ablkcipher_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
> +		crypto_skcipher_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
>  		return -EINVAL;
>  	}
>  
> @@ -661,10 +662,10 @@ static int mtk_aes_setkey(struct crypto_ablkcipher *tfm,
>  	return 0;
>  }
>  
> -static int mtk_aes_crypt(struct ablkcipher_request *req, u64 mode)
> +static int mtk_aes_crypt(struct skcipher_request *req, u64 mode)
>  {
> -	struct crypto_ablkcipher *ablkcipher = crypto_ablkcipher_reqtfm(req);
> -	struct mtk_aes_base_ctx *ctx = crypto_ablkcipher_ctx(ablkcipher);
> +	struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
> +	struct mtk_aes_base_ctx *ctx = crypto_skcipher_ctx(skcipher);
>  	struct mtk_aes_reqctx *rctx;
>  	struct mtk_cryp *cryp;
>  
> @@ -672,185 +673,168 @@ static int mtk_aes_crypt(struct ablkcipher_request *req, u64 mode)
>  	if (!cryp)
>  		return -ENODEV;
>  
> -	rctx = ablkcipher_request_ctx(req);
> +	rctx = skcipher_request_ctx(req);
>  	rctx->mode = mode;
>  
>  	return mtk_aes_handle_queue(cryp, !(mode & AES_FLAGS_ENCRYPT),
>  				    &req->base);
>  }
>  
> -static int mtk_aes_ecb_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ecb_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_ECB);
>  }
>  
> -static int mtk_aes_ecb_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ecb_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ECB);
>  }
>  
> -static int mtk_aes_cbc_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_cbc_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_CBC);
>  }
>  
> -static int mtk_aes_cbc_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_cbc_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_CBC);
>  }
>  
> -static int mtk_aes_ctr_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ctr_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_CTR);
>  }
>  
> -static int mtk_aes_ctr_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ctr_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_CTR);
>  }
>  
> -static int mtk_aes_ofb_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ofb_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_OFB);
>  }
>  
> -static int mtk_aes_ofb_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ofb_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_OFB);
>  }
>  
> -static int mtk_aes_cfb_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_cfb_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_CFB128);
>  }
>  
> -static int mtk_aes_cfb_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_cfb_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_CFB128);
>  }
>  
> -static int mtk_aes_cra_init(struct crypto_tfm *tfm)
> +static int mtk_aes_init_tfm(struct crypto_skcipher *tfm)
>  {
> -	struct mtk_aes_ctx *ctx = crypto_tfm_ctx(tfm);
> +	struct mtk_aes_ctx *ctx = crypto_skcipher_ctx(tfm);
>  
> -	tfm->crt_ablkcipher.reqsize = sizeof(struct mtk_aes_reqctx);
> +	crypto_skcipher_set_reqsize(tfm, sizeof(struct mtk_aes_reqctx));
>  	ctx->base.start = mtk_aes_start;
>  	return 0;
>  }
>  
> -static int mtk_aes_ctr_cra_init(struct crypto_tfm *tfm)
> +static int mtk_aes_ctr_init_tfm(struct crypto_skcipher *tfm)
>  {
> -	struct mtk_aes_ctx *ctx = crypto_tfm_ctx(tfm);
> +	struct mtk_aes_ctx *ctx = crypto_skcipher_ctx(tfm);
>  
> -	tfm->crt_ablkcipher.reqsize = sizeof(struct mtk_aes_reqctx);
> +	crypto_skcipher_set_reqsize(tfm, sizeof(struct mtk_aes_reqctx));
>  	ctx->base.start = mtk_aes_ctr_start;
>  	return 0;
>  }
>  
> -static struct crypto_alg aes_algs[] = {
> +static struct skcipher_alg aes_algs[] = {
>  {
> -	.cra_name		= "cbc(aes)",
> -	.cra_driver_name	= "cbc-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_cra_init,
> -	.cra_blocksize		= AES_BLOCK_SIZE,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_cbc_encrypt,
> -		.decrypt	= mtk_aes_cbc_decrypt,
> -		.ivsize		= AES_BLOCK_SIZE,
> -	}
> +	.base.cra_name		= "cbc(aes)",
> +	.base.cra_driver_name	= "cbc-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= AES_BLOCK_SIZE,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_cbc_encrypt,
> +	.decrypt		= mtk_aes_cbc_decrypt,
> +	.ivsize			= AES_BLOCK_SIZE,
> +	.init			= mtk_aes_init_tfm,
>  },
>  {
> -	.cra_name		= "ecb(aes)",
> -	.cra_driver_name	= "ecb-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_cra_init,
> -	.cra_blocksize		= AES_BLOCK_SIZE,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_ecb_encrypt,
> -		.decrypt	= mtk_aes_ecb_decrypt,
> -	}
> +	.base.cra_name		= "ecb(aes)",
> +	.base.cra_driver_name	= "ecb-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= AES_BLOCK_SIZE,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_ecb_encrypt,
> +	.decrypt		= mtk_aes_ecb_decrypt,
> +	.init			= mtk_aes_init_tfm,
>  },
>  {
> -	.cra_name		= "ctr(aes)",
> -	.cra_driver_name	= "ctr-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_ctr_cra_init,
> -	.cra_blocksize		= 1,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctr_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.ivsize		= AES_BLOCK_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_ctr_encrypt,
> -		.decrypt	= mtk_aes_ctr_decrypt,
> -	}
> +	.base.cra_name		= "ctr(aes)",
> +	.base.cra_driver_name	= "ctr-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= 1,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.ivsize			= AES_BLOCK_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_ctr_encrypt,
> +	.decrypt		= mtk_aes_ctr_decrypt,
> +	.init			= mtk_aes_ctr_init_tfm,
>  },
>  {
> -	.cra_name		= "ofb(aes)",
> -	.cra_driver_name	= "ofb-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_cra_init,
> -	.cra_blocksize		= 1,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.ivsize		= AES_BLOCK_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_ofb_encrypt,
> -		.decrypt	= mtk_aes_ofb_decrypt,
> -	}
> +	.base.cra_name		= "ofb(aes)",
> +	.base.cra_driver_name	= "ofb-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= AES_BLOCK_SIZE,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.ivsize			= AES_BLOCK_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_ofb_encrypt,
> +	.decrypt		= mtk_aes_ofb_decrypt,
>  },
>  {
> -	.cra_name		= "cfb(aes)",
> -	.cra_driver_name	= "cfb-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_cra_init,
> -	.cra_blocksize		= 1,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.ivsize		= AES_BLOCK_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_cfb_encrypt,
> -		.decrypt	= mtk_aes_cfb_decrypt,
> -	}
> +	.base.cra_name		= "cfb(aes)",
> +	.base.cra_driver_name	= "cfb-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= 1,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.ivsize			= AES_BLOCK_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_cfb_encrypt,
> +	.decrypt		= mtk_aes_cfb_decrypt,
>  },
>  };
>  
> @@ -1259,7 +1243,7 @@ static void mtk_aes_unregister_algs(void)
>  	crypto_unregister_aead(&aes_gcm_alg);
>  
>  	for (i = 0; i < ARRAY_SIZE(aes_algs); i++)
> -		crypto_unregister_alg(&aes_algs[i]);
> +		crypto_unregister_skcipher(&aes_algs[i]);
>  }
>  
>  static int mtk_aes_register_algs(void)
> @@ -1267,7 +1251,7 @@ static int mtk_aes_register_algs(void)
>  	int err, i;
>  
>  	for (i = 0; i < ARRAY_SIZE(aes_algs); i++) {
> -		err = crypto_register_alg(&aes_algs[i]);
> +		err = crypto_register_skcipher(&aes_algs[i]);
>  		if (err)
>  			goto err_aes_algs;
>  	}
> @@ -1280,7 +1264,7 @@ static int mtk_aes_register_algs(void)
>  
>  err_aes_algs:
>  	for (; i--; )
> -		crypto_unregister_alg(&aes_algs[i]);
> +		crypto_unregister_skcipher(&aes_algs[i]);
>  
>  	return err;
>  }
> 

WARNING: multiple messages have this Message-ID (diff)
From: Matthias Brugger <matthias.bgg@gmail.com>
To: Ard Biesheuvel <ardb@kernel.org>, linux-crypto@vger.kernel.org
Cc: Eric Biggers <ebiggers@google.com>,
	linux-mediatek@lists.infradead.org,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-arm-kernel@lists.infradead.org,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH v3 17/29] crypto: mediatek - switch to skcipher API
Date: Sun, 10 Nov 2019 19:31:48 +0100	[thread overview]
Message-ID: <fdba315c-a1db-4038-0775-e8016cab4045@gmail.com> (raw)
In-Reply-To: <20191105132826.1838-18-ardb@kernel.org>



On 05/11/2019 14:28, Ard Biesheuvel wrote:
> Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface")
> dated 20 august 2015 introduced the new skcipher API which is supposed to
> replace both blkcipher and ablkcipher. While all consumers of the API have
> been converted long ago, some producers of the ablkcipher remain, forcing
> us to keep the ablkcipher support routines alive, along with the matching
> code to expose [a]blkciphers via the skcipher API.
> 
> So switch this driver to the skcipher API, allowing us to finally drop the
> blkcipher code in the near future.
> 
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: linux-mediatek@lists.infradead.org
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>  drivers/crypto/mediatek/mtk-aes.c | 248 +++++++++-----------
>  1 file changed, 116 insertions(+), 132 deletions(-)
> 
> diff --git a/drivers/crypto/mediatek/mtk-aes.c b/drivers/crypto/mediatek/mtk-aes.c
> index d43410259113..90880a81c534 100644
> --- a/drivers/crypto/mediatek/mtk-aes.c
> +++ b/drivers/crypto/mediatek/mtk-aes.c
> @@ -11,6 +11,7 @@
>  
>  #include <crypto/aes.h>
>  #include <crypto/gcm.h>
> +#include <crypto/internal/skcipher.h>
>  #include "mtk-platform.h"
>  
>  #define AES_QUEUE_SIZE		512
> @@ -414,7 +415,7 @@ static int mtk_aes_map(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  static void mtk_aes_info_init(struct mtk_cryp *cryp, struct mtk_aes_rec *aes,
>  			      size_t len)
>  {
> -	struct ablkcipher_request *req = ablkcipher_request_cast(aes->areq);
> +	struct skcipher_request *req = skcipher_request_cast(aes->areq);
>  	struct mtk_aes_base_ctx *ctx = aes->ctx;
>  	struct mtk_aes_info *info = &ctx->info;
>  	u32 cnt = 0;
> @@ -450,7 +451,7 @@ static void mtk_aes_info_init(struct mtk_cryp *cryp, struct mtk_aes_rec *aes,
>  		return;
>  	}
>  
> -	mtk_aes_write_state_le(info->state + ctx->keylen, req->info,
> +	mtk_aes_write_state_le(info->state + ctx->keylen, (void *)req->iv,
>  			       AES_BLOCK_SIZE);
>  ctr:
>  	info->tfm[0] += AES_TFM_SIZE(SIZE_IN_WORDS(AES_BLOCK_SIZE));
> @@ -552,13 +553,13 @@ static int mtk_aes_transfer_complete(struct mtk_cryp *cryp,
>  
>  static int mtk_aes_start(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  {
> -	struct ablkcipher_request *req = ablkcipher_request_cast(aes->areq);
> -	struct mtk_aes_reqctx *rctx = ablkcipher_request_ctx(req);
> +	struct skcipher_request *req = skcipher_request_cast(aes->areq);
> +	struct mtk_aes_reqctx *rctx = skcipher_request_ctx(req);
>  
>  	mtk_aes_set_mode(aes, rctx);
>  	aes->resume = mtk_aes_transfer_complete;
>  
> -	return mtk_aes_dma(cryp, aes, req->src, req->dst, req->nbytes);
> +	return mtk_aes_dma(cryp, aes, req->src, req->dst, req->cryptlen);
>  }
>  
>  static inline struct mtk_aes_ctr_ctx *
> @@ -571,7 +572,7 @@ static int mtk_aes_ctr_transfer(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  {
>  	struct mtk_aes_base_ctx *ctx = aes->ctx;
>  	struct mtk_aes_ctr_ctx *cctx = mtk_aes_ctr_ctx_cast(ctx);
> -	struct ablkcipher_request *req = ablkcipher_request_cast(aes->areq);
> +	struct skcipher_request *req = skcipher_request_cast(aes->areq);
>  	struct scatterlist *src, *dst;
>  	u32 start, end, ctr, blocks;
>  	size_t datalen;
> @@ -579,11 +580,11 @@ static int mtk_aes_ctr_transfer(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  
>  	/* Check for transfer completion. */
>  	cctx->offset += aes->total;
> -	if (cctx->offset >= req->nbytes)
> +	if (cctx->offset >= req->cryptlen)
>  		return mtk_aes_transfer_complete(cryp, aes);
>  
>  	/* Compute data length. */
> -	datalen = req->nbytes - cctx->offset;
> +	datalen = req->cryptlen - cctx->offset;
>  	blocks = DIV_ROUND_UP(datalen, AES_BLOCK_SIZE);
>  	ctr = be32_to_cpu(cctx->iv[3]);
>  
> @@ -620,12 +621,12 @@ static int mtk_aes_ctr_transfer(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  static int mtk_aes_ctr_start(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  {
>  	struct mtk_aes_ctr_ctx *cctx = mtk_aes_ctr_ctx_cast(aes->ctx);
> -	struct ablkcipher_request *req = ablkcipher_request_cast(aes->areq);
> -	struct mtk_aes_reqctx *rctx = ablkcipher_request_ctx(req);
> +	struct skcipher_request *req = skcipher_request_cast(aes->areq);
> +	struct mtk_aes_reqctx *rctx = skcipher_request_ctx(req);
>  
>  	mtk_aes_set_mode(aes, rctx);
>  
> -	memcpy(cctx->iv, req->info, AES_BLOCK_SIZE);
> +	memcpy(cctx->iv, req->iv, AES_BLOCK_SIZE);
>  	cctx->offset = 0;
>  	aes->total = 0;
>  	aes->resume = mtk_aes_ctr_transfer;
> @@ -634,10 +635,10 @@ static int mtk_aes_ctr_start(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  }
>  
>  /* Check and set the AES key to transform state buffer */
> -static int mtk_aes_setkey(struct crypto_ablkcipher *tfm,
> +static int mtk_aes_setkey(struct crypto_skcipher *tfm,
>  			  const u8 *key, u32 keylen)
>  {
> -	struct mtk_aes_base_ctx *ctx = crypto_ablkcipher_ctx(tfm);
> +	struct mtk_aes_base_ctx *ctx = crypto_skcipher_ctx(tfm);
>  
>  	switch (keylen) {
>  	case AES_KEYSIZE_128:
> @@ -651,7 +652,7 @@ static int mtk_aes_setkey(struct crypto_ablkcipher *tfm,
>  		break;
>  
>  	default:
> -		crypto_ablkcipher_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
> +		crypto_skcipher_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
>  		return -EINVAL;
>  	}
>  
> @@ -661,10 +662,10 @@ static int mtk_aes_setkey(struct crypto_ablkcipher *tfm,
>  	return 0;
>  }
>  
> -static int mtk_aes_crypt(struct ablkcipher_request *req, u64 mode)
> +static int mtk_aes_crypt(struct skcipher_request *req, u64 mode)
>  {
> -	struct crypto_ablkcipher *ablkcipher = crypto_ablkcipher_reqtfm(req);
> -	struct mtk_aes_base_ctx *ctx = crypto_ablkcipher_ctx(ablkcipher);
> +	struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
> +	struct mtk_aes_base_ctx *ctx = crypto_skcipher_ctx(skcipher);
>  	struct mtk_aes_reqctx *rctx;
>  	struct mtk_cryp *cryp;
>  
> @@ -672,185 +673,168 @@ static int mtk_aes_crypt(struct ablkcipher_request *req, u64 mode)
>  	if (!cryp)
>  		return -ENODEV;
>  
> -	rctx = ablkcipher_request_ctx(req);
> +	rctx = skcipher_request_ctx(req);
>  	rctx->mode = mode;
>  
>  	return mtk_aes_handle_queue(cryp, !(mode & AES_FLAGS_ENCRYPT),
>  				    &req->base);
>  }
>  
> -static int mtk_aes_ecb_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ecb_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_ECB);
>  }
>  
> -static int mtk_aes_ecb_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ecb_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ECB);
>  }
>  
> -static int mtk_aes_cbc_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_cbc_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_CBC);
>  }
>  
> -static int mtk_aes_cbc_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_cbc_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_CBC);
>  }
>  
> -static int mtk_aes_ctr_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ctr_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_CTR);
>  }
>  
> -static int mtk_aes_ctr_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ctr_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_CTR);
>  }
>  
> -static int mtk_aes_ofb_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ofb_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_OFB);
>  }
>  
> -static int mtk_aes_ofb_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ofb_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_OFB);
>  }
>  
> -static int mtk_aes_cfb_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_cfb_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_CFB128);
>  }
>  
> -static int mtk_aes_cfb_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_cfb_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_CFB128);
>  }
>  
> -static int mtk_aes_cra_init(struct crypto_tfm *tfm)
> +static int mtk_aes_init_tfm(struct crypto_skcipher *tfm)
>  {
> -	struct mtk_aes_ctx *ctx = crypto_tfm_ctx(tfm);
> +	struct mtk_aes_ctx *ctx = crypto_skcipher_ctx(tfm);
>  
> -	tfm->crt_ablkcipher.reqsize = sizeof(struct mtk_aes_reqctx);
> +	crypto_skcipher_set_reqsize(tfm, sizeof(struct mtk_aes_reqctx));
>  	ctx->base.start = mtk_aes_start;
>  	return 0;
>  }
>  
> -static int mtk_aes_ctr_cra_init(struct crypto_tfm *tfm)
> +static int mtk_aes_ctr_init_tfm(struct crypto_skcipher *tfm)
>  {
> -	struct mtk_aes_ctx *ctx = crypto_tfm_ctx(tfm);
> +	struct mtk_aes_ctx *ctx = crypto_skcipher_ctx(tfm);
>  
> -	tfm->crt_ablkcipher.reqsize = sizeof(struct mtk_aes_reqctx);
> +	crypto_skcipher_set_reqsize(tfm, sizeof(struct mtk_aes_reqctx));
>  	ctx->base.start = mtk_aes_ctr_start;
>  	return 0;
>  }
>  
> -static struct crypto_alg aes_algs[] = {
> +static struct skcipher_alg aes_algs[] = {
>  {
> -	.cra_name		= "cbc(aes)",
> -	.cra_driver_name	= "cbc-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_cra_init,
> -	.cra_blocksize		= AES_BLOCK_SIZE,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_cbc_encrypt,
> -		.decrypt	= mtk_aes_cbc_decrypt,
> -		.ivsize		= AES_BLOCK_SIZE,
> -	}
> +	.base.cra_name		= "cbc(aes)",
> +	.base.cra_driver_name	= "cbc-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= AES_BLOCK_SIZE,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_cbc_encrypt,
> +	.decrypt		= mtk_aes_cbc_decrypt,
> +	.ivsize			= AES_BLOCK_SIZE,
> +	.init			= mtk_aes_init_tfm,
>  },
>  {
> -	.cra_name		= "ecb(aes)",
> -	.cra_driver_name	= "ecb-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_cra_init,
> -	.cra_blocksize		= AES_BLOCK_SIZE,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_ecb_encrypt,
> -		.decrypt	= mtk_aes_ecb_decrypt,
> -	}
> +	.base.cra_name		= "ecb(aes)",
> +	.base.cra_driver_name	= "ecb-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= AES_BLOCK_SIZE,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_ecb_encrypt,
> +	.decrypt		= mtk_aes_ecb_decrypt,
> +	.init			= mtk_aes_init_tfm,
>  },
>  {
> -	.cra_name		= "ctr(aes)",
> -	.cra_driver_name	= "ctr-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_ctr_cra_init,
> -	.cra_blocksize		= 1,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctr_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.ivsize		= AES_BLOCK_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_ctr_encrypt,
> -		.decrypt	= mtk_aes_ctr_decrypt,
> -	}
> +	.base.cra_name		= "ctr(aes)",
> +	.base.cra_driver_name	= "ctr-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= 1,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.ivsize			= AES_BLOCK_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_ctr_encrypt,
> +	.decrypt		= mtk_aes_ctr_decrypt,
> +	.init			= mtk_aes_ctr_init_tfm,
>  },
>  {
> -	.cra_name		= "ofb(aes)",
> -	.cra_driver_name	= "ofb-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_cra_init,
> -	.cra_blocksize		= 1,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.ivsize		= AES_BLOCK_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_ofb_encrypt,
> -		.decrypt	= mtk_aes_ofb_decrypt,
> -	}
> +	.base.cra_name		= "ofb(aes)",
> +	.base.cra_driver_name	= "ofb-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= AES_BLOCK_SIZE,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.ivsize			= AES_BLOCK_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_ofb_encrypt,
> +	.decrypt		= mtk_aes_ofb_decrypt,
>  },
>  {
> -	.cra_name		= "cfb(aes)",
> -	.cra_driver_name	= "cfb-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_cra_init,
> -	.cra_blocksize		= 1,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.ivsize		= AES_BLOCK_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_cfb_encrypt,
> -		.decrypt	= mtk_aes_cfb_decrypt,
> -	}
> +	.base.cra_name		= "cfb(aes)",
> +	.base.cra_driver_name	= "cfb-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= 1,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.ivsize			= AES_BLOCK_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_cfb_encrypt,
> +	.decrypt		= mtk_aes_cfb_decrypt,
>  },
>  };
>  
> @@ -1259,7 +1243,7 @@ static void mtk_aes_unregister_algs(void)
>  	crypto_unregister_aead(&aes_gcm_alg);
>  
>  	for (i = 0; i < ARRAY_SIZE(aes_algs); i++)
> -		crypto_unregister_alg(&aes_algs[i]);
> +		crypto_unregister_skcipher(&aes_algs[i]);
>  }
>  
>  static int mtk_aes_register_algs(void)
> @@ -1267,7 +1251,7 @@ static int mtk_aes_register_algs(void)
>  	int err, i;
>  
>  	for (i = 0; i < ARRAY_SIZE(aes_algs); i++) {
> -		err = crypto_register_alg(&aes_algs[i]);
> +		err = crypto_register_skcipher(&aes_algs[i]);
>  		if (err)
>  			goto err_aes_algs;
>  	}
> @@ -1280,7 +1264,7 @@ static int mtk_aes_register_algs(void)
>  
>  err_aes_algs:
>  	for (; i--; )
> -		crypto_unregister_alg(&aes_algs[i]);
> +		crypto_unregister_skcipher(&aes_algs[i]);
>  
>  	return err;
>  }
> 

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Matthias Brugger <matthias.bgg@gmail.com>
To: Ard Biesheuvel <ardb@kernel.org>, linux-crypto@vger.kernel.org
Cc: Eric Biggers <ebiggers@google.com>,
	linux-mediatek@lists.infradead.org,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-arm-kernel@lists.infradead.org,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH v3 17/29] crypto: mediatek - switch to skcipher API
Date: Sun, 10 Nov 2019 19:31:48 +0100	[thread overview]
Message-ID: <fdba315c-a1db-4038-0775-e8016cab4045@gmail.com> (raw)
In-Reply-To: <20191105132826.1838-18-ardb@kernel.org>



On 05/11/2019 14:28, Ard Biesheuvel wrote:
> Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface")
> dated 20 august 2015 introduced the new skcipher API which is supposed to
> replace both blkcipher and ablkcipher. While all consumers of the API have
> been converted long ago, some producers of the ablkcipher remain, forcing
> us to keep the ablkcipher support routines alive, along with the matching
> code to expose [a]blkciphers via the skcipher API.
> 
> So switch this driver to the skcipher API, allowing us to finally drop the
> blkcipher code in the near future.
> 
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: linux-mediatek@lists.infradead.org
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>  drivers/crypto/mediatek/mtk-aes.c | 248 +++++++++-----------
>  1 file changed, 116 insertions(+), 132 deletions(-)
> 
> diff --git a/drivers/crypto/mediatek/mtk-aes.c b/drivers/crypto/mediatek/mtk-aes.c
> index d43410259113..90880a81c534 100644
> --- a/drivers/crypto/mediatek/mtk-aes.c
> +++ b/drivers/crypto/mediatek/mtk-aes.c
> @@ -11,6 +11,7 @@
>  
>  #include <crypto/aes.h>
>  #include <crypto/gcm.h>
> +#include <crypto/internal/skcipher.h>
>  #include "mtk-platform.h"
>  
>  #define AES_QUEUE_SIZE		512
> @@ -414,7 +415,7 @@ static int mtk_aes_map(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  static void mtk_aes_info_init(struct mtk_cryp *cryp, struct mtk_aes_rec *aes,
>  			      size_t len)
>  {
> -	struct ablkcipher_request *req = ablkcipher_request_cast(aes->areq);
> +	struct skcipher_request *req = skcipher_request_cast(aes->areq);
>  	struct mtk_aes_base_ctx *ctx = aes->ctx;
>  	struct mtk_aes_info *info = &ctx->info;
>  	u32 cnt = 0;
> @@ -450,7 +451,7 @@ static void mtk_aes_info_init(struct mtk_cryp *cryp, struct mtk_aes_rec *aes,
>  		return;
>  	}
>  
> -	mtk_aes_write_state_le(info->state + ctx->keylen, req->info,
> +	mtk_aes_write_state_le(info->state + ctx->keylen, (void *)req->iv,
>  			       AES_BLOCK_SIZE);
>  ctr:
>  	info->tfm[0] += AES_TFM_SIZE(SIZE_IN_WORDS(AES_BLOCK_SIZE));
> @@ -552,13 +553,13 @@ static int mtk_aes_transfer_complete(struct mtk_cryp *cryp,
>  
>  static int mtk_aes_start(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  {
> -	struct ablkcipher_request *req = ablkcipher_request_cast(aes->areq);
> -	struct mtk_aes_reqctx *rctx = ablkcipher_request_ctx(req);
> +	struct skcipher_request *req = skcipher_request_cast(aes->areq);
> +	struct mtk_aes_reqctx *rctx = skcipher_request_ctx(req);
>  
>  	mtk_aes_set_mode(aes, rctx);
>  	aes->resume = mtk_aes_transfer_complete;
>  
> -	return mtk_aes_dma(cryp, aes, req->src, req->dst, req->nbytes);
> +	return mtk_aes_dma(cryp, aes, req->src, req->dst, req->cryptlen);
>  }
>  
>  static inline struct mtk_aes_ctr_ctx *
> @@ -571,7 +572,7 @@ static int mtk_aes_ctr_transfer(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  {
>  	struct mtk_aes_base_ctx *ctx = aes->ctx;
>  	struct mtk_aes_ctr_ctx *cctx = mtk_aes_ctr_ctx_cast(ctx);
> -	struct ablkcipher_request *req = ablkcipher_request_cast(aes->areq);
> +	struct skcipher_request *req = skcipher_request_cast(aes->areq);
>  	struct scatterlist *src, *dst;
>  	u32 start, end, ctr, blocks;
>  	size_t datalen;
> @@ -579,11 +580,11 @@ static int mtk_aes_ctr_transfer(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  
>  	/* Check for transfer completion. */
>  	cctx->offset += aes->total;
> -	if (cctx->offset >= req->nbytes)
> +	if (cctx->offset >= req->cryptlen)
>  		return mtk_aes_transfer_complete(cryp, aes);
>  
>  	/* Compute data length. */
> -	datalen = req->nbytes - cctx->offset;
> +	datalen = req->cryptlen - cctx->offset;
>  	blocks = DIV_ROUND_UP(datalen, AES_BLOCK_SIZE);
>  	ctr = be32_to_cpu(cctx->iv[3]);
>  
> @@ -620,12 +621,12 @@ static int mtk_aes_ctr_transfer(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  static int mtk_aes_ctr_start(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  {
>  	struct mtk_aes_ctr_ctx *cctx = mtk_aes_ctr_ctx_cast(aes->ctx);
> -	struct ablkcipher_request *req = ablkcipher_request_cast(aes->areq);
> -	struct mtk_aes_reqctx *rctx = ablkcipher_request_ctx(req);
> +	struct skcipher_request *req = skcipher_request_cast(aes->areq);
> +	struct mtk_aes_reqctx *rctx = skcipher_request_ctx(req);
>  
>  	mtk_aes_set_mode(aes, rctx);
>  
> -	memcpy(cctx->iv, req->info, AES_BLOCK_SIZE);
> +	memcpy(cctx->iv, req->iv, AES_BLOCK_SIZE);
>  	cctx->offset = 0;
>  	aes->total = 0;
>  	aes->resume = mtk_aes_ctr_transfer;
> @@ -634,10 +635,10 @@ static int mtk_aes_ctr_start(struct mtk_cryp *cryp, struct mtk_aes_rec *aes)
>  }
>  
>  /* Check and set the AES key to transform state buffer */
> -static int mtk_aes_setkey(struct crypto_ablkcipher *tfm,
> +static int mtk_aes_setkey(struct crypto_skcipher *tfm,
>  			  const u8 *key, u32 keylen)
>  {
> -	struct mtk_aes_base_ctx *ctx = crypto_ablkcipher_ctx(tfm);
> +	struct mtk_aes_base_ctx *ctx = crypto_skcipher_ctx(tfm);
>  
>  	switch (keylen) {
>  	case AES_KEYSIZE_128:
> @@ -651,7 +652,7 @@ static int mtk_aes_setkey(struct crypto_ablkcipher *tfm,
>  		break;
>  
>  	default:
> -		crypto_ablkcipher_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
> +		crypto_skcipher_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
>  		return -EINVAL;
>  	}
>  
> @@ -661,10 +662,10 @@ static int mtk_aes_setkey(struct crypto_ablkcipher *tfm,
>  	return 0;
>  }
>  
> -static int mtk_aes_crypt(struct ablkcipher_request *req, u64 mode)
> +static int mtk_aes_crypt(struct skcipher_request *req, u64 mode)
>  {
> -	struct crypto_ablkcipher *ablkcipher = crypto_ablkcipher_reqtfm(req);
> -	struct mtk_aes_base_ctx *ctx = crypto_ablkcipher_ctx(ablkcipher);
> +	struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
> +	struct mtk_aes_base_ctx *ctx = crypto_skcipher_ctx(skcipher);
>  	struct mtk_aes_reqctx *rctx;
>  	struct mtk_cryp *cryp;
>  
> @@ -672,185 +673,168 @@ static int mtk_aes_crypt(struct ablkcipher_request *req, u64 mode)
>  	if (!cryp)
>  		return -ENODEV;
>  
> -	rctx = ablkcipher_request_ctx(req);
> +	rctx = skcipher_request_ctx(req);
>  	rctx->mode = mode;
>  
>  	return mtk_aes_handle_queue(cryp, !(mode & AES_FLAGS_ENCRYPT),
>  				    &req->base);
>  }
>  
> -static int mtk_aes_ecb_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ecb_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_ECB);
>  }
>  
> -static int mtk_aes_ecb_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ecb_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ECB);
>  }
>  
> -static int mtk_aes_cbc_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_cbc_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_CBC);
>  }
>  
> -static int mtk_aes_cbc_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_cbc_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_CBC);
>  }
>  
> -static int mtk_aes_ctr_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ctr_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_CTR);
>  }
>  
> -static int mtk_aes_ctr_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ctr_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_CTR);
>  }
>  
> -static int mtk_aes_ofb_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ofb_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_OFB);
>  }
>  
> -static int mtk_aes_ofb_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_ofb_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_OFB);
>  }
>  
> -static int mtk_aes_cfb_encrypt(struct ablkcipher_request *req)
> +static int mtk_aes_cfb_encrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_ENCRYPT | AES_FLAGS_CFB128);
>  }
>  
> -static int mtk_aes_cfb_decrypt(struct ablkcipher_request *req)
> +static int mtk_aes_cfb_decrypt(struct skcipher_request *req)
>  {
>  	return mtk_aes_crypt(req, AES_FLAGS_CFB128);
>  }
>  
> -static int mtk_aes_cra_init(struct crypto_tfm *tfm)
> +static int mtk_aes_init_tfm(struct crypto_skcipher *tfm)
>  {
> -	struct mtk_aes_ctx *ctx = crypto_tfm_ctx(tfm);
> +	struct mtk_aes_ctx *ctx = crypto_skcipher_ctx(tfm);
>  
> -	tfm->crt_ablkcipher.reqsize = sizeof(struct mtk_aes_reqctx);
> +	crypto_skcipher_set_reqsize(tfm, sizeof(struct mtk_aes_reqctx));
>  	ctx->base.start = mtk_aes_start;
>  	return 0;
>  }
>  
> -static int mtk_aes_ctr_cra_init(struct crypto_tfm *tfm)
> +static int mtk_aes_ctr_init_tfm(struct crypto_skcipher *tfm)
>  {
> -	struct mtk_aes_ctx *ctx = crypto_tfm_ctx(tfm);
> +	struct mtk_aes_ctx *ctx = crypto_skcipher_ctx(tfm);
>  
> -	tfm->crt_ablkcipher.reqsize = sizeof(struct mtk_aes_reqctx);
> +	crypto_skcipher_set_reqsize(tfm, sizeof(struct mtk_aes_reqctx));
>  	ctx->base.start = mtk_aes_ctr_start;
>  	return 0;
>  }
>  
> -static struct crypto_alg aes_algs[] = {
> +static struct skcipher_alg aes_algs[] = {
>  {
> -	.cra_name		= "cbc(aes)",
> -	.cra_driver_name	= "cbc-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_cra_init,
> -	.cra_blocksize		= AES_BLOCK_SIZE,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_cbc_encrypt,
> -		.decrypt	= mtk_aes_cbc_decrypt,
> -		.ivsize		= AES_BLOCK_SIZE,
> -	}
> +	.base.cra_name		= "cbc(aes)",
> +	.base.cra_driver_name	= "cbc-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= AES_BLOCK_SIZE,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_cbc_encrypt,
> +	.decrypt		= mtk_aes_cbc_decrypt,
> +	.ivsize			= AES_BLOCK_SIZE,
> +	.init			= mtk_aes_init_tfm,
>  },
>  {
> -	.cra_name		= "ecb(aes)",
> -	.cra_driver_name	= "ecb-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_cra_init,
> -	.cra_blocksize		= AES_BLOCK_SIZE,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_ecb_encrypt,
> -		.decrypt	= mtk_aes_ecb_decrypt,
> -	}
> +	.base.cra_name		= "ecb(aes)",
> +	.base.cra_driver_name	= "ecb-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= AES_BLOCK_SIZE,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_ecb_encrypt,
> +	.decrypt		= mtk_aes_ecb_decrypt,
> +	.init			= mtk_aes_init_tfm,
>  },
>  {
> -	.cra_name		= "ctr(aes)",
> -	.cra_driver_name	= "ctr-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_ctr_cra_init,
> -	.cra_blocksize		= 1,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctr_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.ivsize		= AES_BLOCK_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_ctr_encrypt,
> -		.decrypt	= mtk_aes_ctr_decrypt,
> -	}
> +	.base.cra_name		= "ctr(aes)",
> +	.base.cra_driver_name	= "ctr-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= 1,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.ivsize			= AES_BLOCK_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_ctr_encrypt,
> +	.decrypt		= mtk_aes_ctr_decrypt,
> +	.init			= mtk_aes_ctr_init_tfm,
>  },
>  {
> -	.cra_name		= "ofb(aes)",
> -	.cra_driver_name	= "ofb-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_cra_init,
> -	.cra_blocksize		= 1,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.ivsize		= AES_BLOCK_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_ofb_encrypt,
> -		.decrypt	= mtk_aes_ofb_decrypt,
> -	}
> +	.base.cra_name		= "ofb(aes)",
> +	.base.cra_driver_name	= "ofb-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= AES_BLOCK_SIZE,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.ivsize			= AES_BLOCK_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_ofb_encrypt,
> +	.decrypt		= mtk_aes_ofb_decrypt,
>  },
>  {
> -	.cra_name		= "cfb(aes)",
> -	.cra_driver_name	= "cfb-aes-mtk",
> -	.cra_priority		= 400,
> -	.cra_flags		= CRYPTO_ALG_TYPE_ABLKCIPHER |
> -				  CRYPTO_ALG_ASYNC,
> -	.cra_init		= mtk_aes_cra_init,
> -	.cra_blocksize		= 1,
> -	.cra_ctxsize		= sizeof(struct mtk_aes_ctx),
> -	.cra_alignmask		= 0xf,
> -	.cra_type		= &crypto_ablkcipher_type,
> -	.cra_module		= THIS_MODULE,
> -	.cra_u.ablkcipher = {
> -		.min_keysize	= AES_MIN_KEY_SIZE,
> -		.max_keysize	= AES_MAX_KEY_SIZE,
> -		.ivsize		= AES_BLOCK_SIZE,
> -		.setkey		= mtk_aes_setkey,
> -		.encrypt	= mtk_aes_cfb_encrypt,
> -		.decrypt	= mtk_aes_cfb_decrypt,
> -	}
> +	.base.cra_name		= "cfb(aes)",
> +	.base.cra_driver_name	= "cfb-aes-mtk",
> +	.base.cra_priority	= 400,
> +	.base.cra_flags		= CRYPTO_ALG_ASYNC,
> +	.base.cra_blocksize	= 1,
> +	.base.cra_ctxsize	= sizeof(struct mtk_aes_ctx),
> +	.base.cra_alignmask	= 0xf,
> +	.base.cra_module	= THIS_MODULE,
> +
> +	.min_keysize		= AES_MIN_KEY_SIZE,
> +	.max_keysize		= AES_MAX_KEY_SIZE,
> +	.ivsize			= AES_BLOCK_SIZE,
> +	.setkey			= mtk_aes_setkey,
> +	.encrypt		= mtk_aes_cfb_encrypt,
> +	.decrypt		= mtk_aes_cfb_decrypt,
>  },
>  };
>  
> @@ -1259,7 +1243,7 @@ static void mtk_aes_unregister_algs(void)
>  	crypto_unregister_aead(&aes_gcm_alg);
>  
>  	for (i = 0; i < ARRAY_SIZE(aes_algs); i++)
> -		crypto_unregister_alg(&aes_algs[i]);
> +		crypto_unregister_skcipher(&aes_algs[i]);
>  }
>  
>  static int mtk_aes_register_algs(void)
> @@ -1267,7 +1251,7 @@ static int mtk_aes_register_algs(void)
>  	int err, i;
>  
>  	for (i = 0; i < ARRAY_SIZE(aes_algs); i++) {
> -		err = crypto_register_alg(&aes_algs[i]);
> +		err = crypto_register_skcipher(&aes_algs[i]);
>  		if (err)
>  			goto err_aes_algs;
>  	}
> @@ -1280,7 +1264,7 @@ static int mtk_aes_register_algs(void)
>  
>  err_aes_algs:
>  	for (; i--; )
> -		crypto_unregister_alg(&aes_algs[i]);
> +		crypto_unregister_skcipher(&aes_algs[i]);
>  
>  	return err;
>  }
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-11-10 18:31 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05 13:27 [PATCH v3 00/29] crypto: convert h/w accelerator drivers to skcipher API Ard Biesheuvel
2019-11-05 13:27 ` Ard Biesheuvel
2019-11-05 13:27 ` [PATCH v3 01/29] crypto: virtio - implement missing support for output IVs Ard Biesheuvel
2019-11-05 13:27   ` Ard Biesheuvel
2019-11-05 13:27 ` [PATCH v3 02/29] crypto: virtio - deal with unsupported input sizes Ard Biesheuvel
2019-11-05 13:27   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 03/29] crypto: virtio - switch to skcipher API Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 17:32   ` Eric Biggers
2019-11-05 17:32     ` Eric Biggers
2019-11-05 13:28 ` [PATCH v3 04/29] crypto: ccp - switch from ablkcipher to skcipher Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 05/29] crypto: omap - switch to skcipher API Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 06/29] crypto: ux500 " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 07/29] crypto: s5p " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 08/29] crypto: atmel-aes " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-09  6:23   ` Tudor.Ambarus
2019-11-09  6:23     ` Tudor.Ambarus
2019-11-05 13:28 ` [PATCH v3 09/29] crypto: atmel-tdes " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-09  6:17   ` Tudor.Ambarus
2019-11-09  6:17     ` Tudor.Ambarus
2019-11-05 13:28 ` [PATCH v3 10/29] crypto: bcm-spu " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 11/29] crypto: nitrox - remove cra_type reference to ablkcipher Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 12/29] crypto: cavium/cpt - switch to skcipher API Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 13/29] crypto: chelsio " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 14/29] crypto: hifn " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 15/29] crypto: ixp4xx " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 16/29] crypto: mxs " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 17/29] crypto: mediatek " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-10 18:31   ` Matthias Brugger [this message]
2019-11-10 18:31     ` Matthias Brugger
2019-11-10 18:31     ` Matthias Brugger
2019-11-05 13:28 ` [PATCH v3 18/29] crypto: sahara " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 19/29] crypto: picoxcell " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 20/29] crypto: qce " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 21/29] crypto: stm32 " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 22/29] crypto: niagara2 " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 23/29] crypto: rockchip " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 24/29] crypto: talitos " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 25/29] crypto: qat " Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-07 11:26   ` Giovanni Cabiddu
2019-11-07 11:26     ` Giovanni Cabiddu
2019-11-07 11:34     ` Ard Biesheuvel
2019-11-07 11:34       ` Ard Biesheuvel
2019-11-08  9:14       ` Herbert Xu
2019-11-08  9:14         ` Herbert Xu
2019-11-05 13:28 ` [PATCH v3 26/29] crypto: marvell/cesa - rename blkcipher to skcipher Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 27/29] crypto: nx - remove stale comment referring to the blkcipher walk API Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 13:28 ` [PATCH v3 28/29] crypto: remove deprecated and unused ablkcipher support Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-05 17:52   ` Eric Biggers
2019-11-05 17:52     ` Eric Biggers
2019-11-06  4:03     ` Herbert Xu
2019-11-06  4:03       ` Herbert Xu
2019-11-05 13:28 ` [PATCH v3 29/29] crypto: ccree - update a stale reference to ablkcipher Ard Biesheuvel
2019-11-05 13:28   ` Ard Biesheuvel
2019-11-06  6:24   ` Gilad Ben-Yossef
2019-11-06  6:24     ` Gilad Ben-Yossef

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fdba315c-a1db-4038-0775-e8016cab4045@gmail.com \
    --to=matthias.bgg@gmail.com \
    --cc=ardb@kernel.org \
    --cc=davem@davemloft.net \
    --cc=ebiggers@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.