All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: linux-crypto@vger.kernel.org
Subject: [PATCH 15/17] crypto: adiantum - stop using alignmask of shash_alg
Date: Wed, 18 Oct 2023 22:53:41 -0700	[thread overview]
Message-ID: <20231019055343.588846-16-ebiggers@kernel.org> (raw)
In-Reply-To: <20231019055343.588846-1-ebiggers@kernel.org>

From: Eric Biggers <ebiggers@google.com>

Now that the shash algorithm type does not support nonzero alignmasks,
shash_alg::base.cra_alignmask is always 0, so OR-ing it into another
value is a no-op.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 crypto/adiantum.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/crypto/adiantum.c b/crypto/adiantum.c
index 51703746d91e2..064a0a57c77c1 100644
--- a/crypto/adiantum.c
+++ b/crypto/adiantum.c
@@ -554,22 +554,21 @@ static int adiantum_create(struct crypto_template *tmpl, struct rtattr **tb)
 		goto err_free_inst;
 	if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME,
 		     "adiantum(%s,%s,%s)",
 		     streamcipher_alg->base.cra_driver_name,
 		     blockcipher_alg->cra_driver_name,
 		     hash_alg->base.cra_driver_name) >= CRYPTO_MAX_ALG_NAME)
 		goto err_free_inst;
 
 	inst->alg.base.cra_blocksize = BLOCKCIPHER_BLOCK_SIZE;
 	inst->alg.base.cra_ctxsize = sizeof(struct adiantum_tfm_ctx);
-	inst->alg.base.cra_alignmask = streamcipher_alg->base.cra_alignmask |
-				       hash_alg->base.cra_alignmask;
+	inst->alg.base.cra_alignmask = streamcipher_alg->base.cra_alignmask;
 	/*
 	 * The block cipher is only invoked once per message, so for long
 	 * messages (e.g. sectors for disk encryption) its performance doesn't
 	 * matter as much as that of the stream cipher and hash function.  Thus,
 	 * weigh the block cipher's ->cra_priority less.
 	 */
 	inst->alg.base.cra_priority = (4 * streamcipher_alg->base.cra_priority +
 				       2 * hash_alg->base.cra_priority +
 				       blockcipher_alg->cra_priority) / 7;
 
-- 
2.42.0


  parent reply	other threads:[~2023-10-19  5:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19  5:53 [PATCH 00/17] crypto: stop supporting alignmask in shash Eric Biggers
2023-10-19  5:53 ` [PATCH 01/17] crypto: sparc/crc32c - stop using the shash alignmask Eric Biggers
2023-10-19  5:53 ` [PATCH 02/17] crypto: stm32 - remove unnecessary alignmask Eric Biggers
2023-10-19  5:53 ` [PATCH 03/17] crypto: xilinx/zynqmp-sha " Eric Biggers
2023-10-19  5:53 ` [PATCH 04/17] crypto: mips/crc32 - remove redundant setting of alignmask to 0 Eric Biggers
2023-10-19  5:53 ` [PATCH 05/17] crypto: loongarch/crc32 " Eric Biggers
2023-10-19  5:53 ` [PATCH 06/17] crypto: cbcmac - remove unnecessary alignment logic Eric Biggers
2023-10-19  5:53 ` [PATCH 07/17] crypto: cmac " Eric Biggers
2023-10-19  5:53 ` [PATCH 08/17] crypto: hmac " Eric Biggers
2023-10-19  5:53 ` [PATCH 09/17] crypto: vmac - don't set alignmask Eric Biggers
2023-10-19  5:53 ` [PATCH 10/17] crypto: xcbc - remove unnecessary alignment logic Eric Biggers
2023-10-19  5:53 ` [PATCH 11/17] crypto: shash - remove support for nonzero alignmask Eric Biggers
2023-10-19  5:53 ` [PATCH 12/17] libceph: stop checking crypto_shash_alignmask Eric Biggers
2023-10-19  5:53 ` [PATCH 13/17] crypto: drbg - " Eric Biggers
2023-10-19  5:53 ` [PATCH 14/17] crypto: testmgr " Eric Biggers
2023-10-19  5:53 ` Eric Biggers [this message]
2023-10-19  5:53 ` [PATCH 16/17] crypto: hctr2 - stop using alignmask of shash_alg Eric Biggers
2023-10-19  5:53 ` [PATCH 17/17] crypto: shash - remove crypto_shash_alignmask Eric Biggers
2023-10-27 10:52 ` [PATCH 00/17] crypto: stop supporting alignmask in shash Herbert Xu

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=20231019055343.588846-16-ebiggers@kernel.org \
    --to=ebiggers@kernel.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
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.