All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Bibo Mao <maobibo@loongson.cn>
Cc: Gonglei <arei.gonglei@huawei.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	virtualization@lists.linux.dev, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 9/9] crypto: virtio: Add ecb aes algo support
Date: Thu, 4 Dec 2025 06:43:15 -0500	[thread overview]
Message-ID: <20251204064220-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20251204112612.2659650-1-maobibo@loongson.cn>

On Thu, Dec 04, 2025 at 07:26:11PM +0800, Bibo Mao wrote:
> ECB AES also is added here, its ivsize is zero and name is different
> compared with CBC AES algo.
> 
> Signed-off-by: Bibo Mao <maobibo@loongson.cn>

you did not post the cover letter, so the mail thread is malformed.

> ---
>  .../virtio/virtio_crypto_skcipher_algs.c      | 74 +++++++++++++------
>  1 file changed, 50 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c b/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c
> index b4b79121c37c..9b4ba6a6b9cf 100644
> --- a/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c
> +++ b/drivers/crypto/virtio/virtio_crypto_skcipher_algs.c
> @@ -559,31 +559,57 @@ static void virtio_crypto_skcipher_finalize_req(
>  					   req, err);
>  }
>  
> -static struct virtio_crypto_algo virtio_crypto_algs[] = { {
> -	.algonum = VIRTIO_CRYPTO_CIPHER_AES_CBC,
> -	.service = VIRTIO_CRYPTO_SERVICE_CIPHER,
> -	.algo.base = {
> -		.base.cra_name		= "cbc(aes)",
> -		.base.cra_driver_name	= "virtio_crypto_aes_cbc",
> -		.base.cra_priority	= 150,
> -		.base.cra_flags		= CRYPTO_ALG_ASYNC |
> -					  CRYPTO_ALG_ALLOCATES_MEMORY,
> -		.base.cra_blocksize	= AES_BLOCK_SIZE,
> -		.base.cra_ctxsize	= sizeof(struct virtio_crypto_skcipher_ctx),
> -		.base.cra_module	= THIS_MODULE,
> -		.init			= virtio_crypto_skcipher_init,
> -		.exit			= virtio_crypto_skcipher_exit,
> -		.setkey			= virtio_crypto_skcipher_setkey,
> -		.decrypt		= virtio_crypto_skcipher_decrypt,
> -		.encrypt		= virtio_crypto_skcipher_encrypt,
> -		.min_keysize		= AES_MIN_KEY_SIZE,
> -		.max_keysize		= AES_MAX_KEY_SIZE,
> -		.ivsize			= AES_BLOCK_SIZE,
> +static struct virtio_crypto_algo virtio_crypto_algs[] = {
> +	{
> +		.algonum = VIRTIO_CRYPTO_CIPHER_AES_CBC,
> +		.service = VIRTIO_CRYPTO_SERVICE_CIPHER,
> +		.algo.base = {
> +			.base.cra_name		= "cbc(aes)",
> +			.base.cra_driver_name	= "virtio_crypto_aes_cbc",
> +			.base.cra_priority	= 150,
> +			.base.cra_flags		= CRYPTO_ALG_ASYNC |
> +				CRYPTO_ALG_ALLOCATES_MEMORY,
> +			.base.cra_blocksize	= AES_BLOCK_SIZE,
> +			.base.cra_ctxsize	= sizeof(struct virtio_crypto_skcipher_ctx),
> +			.base.cra_module	= THIS_MODULE,
> +			.init			= virtio_crypto_skcipher_init,
> +			.exit			= virtio_crypto_skcipher_exit,
> +			.setkey			= virtio_crypto_skcipher_setkey,
> +			.decrypt		= virtio_crypto_skcipher_decrypt,
> +			.encrypt		= virtio_crypto_skcipher_encrypt,
> +			.min_keysize		= AES_MIN_KEY_SIZE,
> +			.max_keysize		= AES_MAX_KEY_SIZE,
> +			.ivsize			= AES_BLOCK_SIZE,
> +		},
> +		.algo.op = {
> +			.do_one_request = virtio_crypto_skcipher_crypt_req,
> +		},
>  	},
> -	.algo.op = {
> -		.do_one_request = virtio_crypto_skcipher_crypt_req,
> -	},
> -} };
> +	{
> +		.algonum = VIRTIO_CRYPTO_CIPHER_AES_ECB,
> +		.service = VIRTIO_CRYPTO_SERVICE_CIPHER,
> +		.algo.base = {
> +			.base.cra_name		= "ecb(aes)",
> +			.base.cra_driver_name	= "virtio_crypto_aes_ecb",
> +			.base.cra_priority	= 150,
> +			.base.cra_flags		= CRYPTO_ALG_ASYNC |
> +				CRYPTO_ALG_ALLOCATES_MEMORY,
> +			.base.cra_blocksize	= AES_BLOCK_SIZE,
> +			.base.cra_ctxsize	= sizeof(struct virtio_crypto_skcipher_ctx),
> +			.base.cra_module	= THIS_MODULE,
> +			.init			= virtio_crypto_skcipher_init,
> +			.exit			= virtio_crypto_skcipher_exit,
> +			.setkey			= virtio_crypto_skcipher_setkey,
> +			.decrypt		= virtio_crypto_skcipher_decrypt,
> +			.encrypt		= virtio_crypto_skcipher_encrypt,
> +			.min_keysize		= AES_MIN_KEY_SIZE,
> +			.max_keysize		= AES_MAX_KEY_SIZE,
> +		},
> +		.algo.op = {
> +			.do_one_request = virtio_crypto_skcipher_crypt_req,
> +		},
> +	}
> +};
>  
>  int virtio_crypto_skcipher_algs_register(struct virtio_crypto *vcrypto)
>  {
> -- 
> 2.39.3


  reply	other threads:[~2025-12-04 11:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250701030842.1136519-1-maobibo@loongson.cn=20251204112227.2659404-1-maobibo@loongson.cn>
2025-12-04 11:25 ` [PATCH v2 7/9] crypto: virtio: Add IV buffer in structure virtio_crypto_sym_request Bibo Mao
2025-12-04 12:48   ` Michael S. Tsirkin
2025-12-05  1:19     ` Bibo Mao
2025-12-04 11:25 ` [PATCH v2 8/9] crypto: virtio: Add skcipher support without IV Bibo Mao
2025-12-04 11:26 ` [PATCH v2 9/9] crypto: virtio: Add ecb aes algo support Bibo Mao
2025-12-04 11:43   ` Michael S. Tsirkin [this message]
2025-12-04 11:52     ` Bibo Mao

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=20251204064220-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=davem@davemloft.net \
    --cc=eperezma@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jasowang@redhat.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maobibo@loongson.cn \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    /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.