Linux-Crypto Archive on lore.kernel.org
 help / color / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: linux-crypto@vger.kernel.org
Cc: Ard Biesheuvel <ardb@kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Biggers <ebiggers@google.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 26/29] crypto: marvell/cesa - rename blkcipher to skcipher
Date: Sat,  9 Nov 2019 18:09:51 +0100
Message-ID: <20191109170954.756-27-ardb@kernel.org> (raw)
In-Reply-To: <20191109170954.756-1-ardb@kernel.org>

The driver specific types contain some rudimentary references to the
blkcipher API, which is deprecated and will be removed. To avoid confusion,
rename these to skcipher. This is a cosmetic change only, as the code does
not actually use the blkcipher API.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 drivers/crypto/marvell/cesa.h   |  6 +++---
 drivers/crypto/marvell/cipher.c | 14 +++++++-------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/crypto/marvell/cesa.h b/drivers/crypto/marvell/cesa.h
index d63a6ee905c9..f1ed3b85c0d2 100644
--- a/drivers/crypto/marvell/cesa.h
+++ b/drivers/crypto/marvell/cesa.h
@@ -232,13 +232,13 @@ struct mv_cesa_sec_accel_desc {
 };
 
 /**
- * struct mv_cesa_blkcipher_op_ctx - cipher operation context
+ * struct mv_cesa_skcipher_op_ctx - cipher operation context
  * @key:	cipher key
  * @iv:		cipher IV
  *
  * Context associated to a cipher operation.
  */
-struct mv_cesa_blkcipher_op_ctx {
+struct mv_cesa_skcipher_op_ctx {
 	u32 key[8];
 	u32 iv[4];
 };
@@ -265,7 +265,7 @@ struct mv_cesa_hash_op_ctx {
 struct mv_cesa_op_ctx {
 	struct mv_cesa_sec_accel_desc desc;
 	union {
-		struct mv_cesa_blkcipher_op_ctx blkcipher;
+		struct mv_cesa_skcipher_op_ctx skcipher;
 		struct mv_cesa_hash_op_ctx hash;
 	} ctx;
 };
diff --git a/drivers/crypto/marvell/cipher.c b/drivers/crypto/marvell/cipher.c
index 84ceddfee76b..d8e8c857770c 100644
--- a/drivers/crypto/marvell/cipher.c
+++ b/drivers/crypto/marvell/cipher.c
@@ -209,7 +209,7 @@ mv_cesa_skcipher_complete(struct crypto_async_request *req)
 		struct mv_cesa_req *basereq;
 
 		basereq = &creq->base;
-		memcpy(skreq->iv, basereq->chain.last->op->ctx.blkcipher.iv,
+		memcpy(skreq->iv, basereq->chain.last->op->ctx.skcipher.iv,
 		       ivsize);
 	} else {
 		memcpy_fromio(skreq->iv,
@@ -470,7 +470,7 @@ static int mv_cesa_des_op(struct skcipher_request *req,
 	mv_cesa_update_op_cfg(tmpl, CESA_SA_DESC_CFG_CRYPTM_DES,
 			      CESA_SA_DESC_CFG_CRYPTM_MSK);
 
-	memcpy(tmpl->ctx.blkcipher.key, ctx->key, DES_KEY_SIZE);
+	memcpy(tmpl->ctx.skcipher.key, ctx->key, DES_KEY_SIZE);
 
 	return mv_cesa_skcipher_queue_req(req, tmpl);
 }
@@ -523,7 +523,7 @@ static int mv_cesa_cbc_des_op(struct skcipher_request *req,
 	mv_cesa_update_op_cfg(tmpl, CESA_SA_DESC_CFG_CRYPTCM_CBC,
 			      CESA_SA_DESC_CFG_CRYPTCM_MSK);
 
-	memcpy(tmpl->ctx.blkcipher.iv, req->iv, DES_BLOCK_SIZE);
+	memcpy(tmpl->ctx.skcipher.iv, req->iv, DES_BLOCK_SIZE);
 
 	return mv_cesa_des_op(req, tmpl);
 }
@@ -575,7 +575,7 @@ static int mv_cesa_des3_op(struct skcipher_request *req,
 	mv_cesa_update_op_cfg(tmpl, CESA_SA_DESC_CFG_CRYPTM_3DES,
 			      CESA_SA_DESC_CFG_CRYPTM_MSK);
 
-	memcpy(tmpl->ctx.blkcipher.key, ctx->key, DES3_EDE_KEY_SIZE);
+	memcpy(tmpl->ctx.skcipher.key, ctx->key, DES3_EDE_KEY_SIZE);
 
 	return mv_cesa_skcipher_queue_req(req, tmpl);
 }
@@ -628,7 +628,7 @@ struct skcipher_alg mv_cesa_ecb_des3_ede_alg = {
 static int mv_cesa_cbc_des3_op(struct skcipher_request *req,
 			       struct mv_cesa_op_ctx *tmpl)
 {
-	memcpy(tmpl->ctx.blkcipher.iv, req->iv, DES3_EDE_BLOCK_SIZE);
+	memcpy(tmpl->ctx.skcipher.iv, req->iv, DES3_EDE_BLOCK_SIZE);
 
 	return mv_cesa_des3_op(req, tmpl);
 }
@@ -694,7 +694,7 @@ static int mv_cesa_aes_op(struct skcipher_request *req,
 		key = ctx->aes.key_enc;
 
 	for (i = 0; i < ctx->aes.key_length / sizeof(u32); i++)
-		tmpl->ctx.blkcipher.key[i] = cpu_to_le32(key[i]);
+		tmpl->ctx.skcipher.key[i] = cpu_to_le32(key[i]);
 
 	if (ctx->aes.key_length == 24)
 		cfg |= CESA_SA_DESC_CFG_AES_LEN_192;
@@ -755,7 +755,7 @@ static int mv_cesa_cbc_aes_op(struct skcipher_request *req,
 {
 	mv_cesa_update_op_cfg(tmpl, CESA_SA_DESC_CFG_CRYPTCM_CBC,
 			      CESA_SA_DESC_CFG_CRYPTCM_MSK);
-	memcpy(tmpl->ctx.blkcipher.iv, req->iv, AES_BLOCK_SIZE);
+	memcpy(tmpl->ctx.skcipher.iv, req->iv, AES_BLOCK_SIZE);
 
 	return mv_cesa_aes_op(req, tmpl);
 }
-- 
2.17.1


  parent reply index

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

Reply instructions:

You may reply publically 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=20191109170954.756-27-ardb@kernel.org \
    --to=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 \
    /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

Linux-Crypto Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-crypto/0 linux-crypto/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-crypto linux-crypto/ https://lore.kernel.org/linux-crypto \
		linux-crypto@vger.kernel.org
	public-inbox-index linux-crypto

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-crypto


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git