Linux-Crypto Archive mirror
 help / color / mirror / Atom feed
From: "Stefan Kanthak" <stefan.kanthak@nexgo.de>
To: <linux-kernel@vger.kernel.org>, <linux-crypto@vger.kernel.org>
Cc: <tim.c.chen@linux.intel.com>, "Eric Biggers" <ebiggers@kernel.org>
Subject: [PATCH v2 1/2] crypto: s(h)aving 16 byte constant off arch/x86/crypto/sha1_ni_asm.S
Date: Mon, 8 Apr 2024 16:08:52 +0200	[thread overview]
Message-ID: <20240408140852.7IrbCT995YfkzWGvzZecmdDaYREy6yttd_Db6j1dPAQ@z> (raw)

Get rid of 16 byte constant, use shift instead of mask

--- -/arch/x86/crypto/sha1_ni_asm.S
+++ +/arch/x86/crypto/sha1_ni_asm.S
@@ -104,9 +104,9 @@
 	add		DATA_PTR, NUM_BLKS	/* pointer to end of data */
 
 	/* load initial hash values */
-	pinsrd		$3, 1*16(DIGEST_PTR), E0
+	pinsrd		$0, 1*16(DIGEST_PTR), E0
 	movdqu		0*16(DIGEST_PTR), ABCD
-	pand		UPPER_WORD_MASK(%rip), E0
+	pslldq		$12, E0
 	pshufd		$0x1B, ABCD, ABCD
 
 	movdqa		PSHUFFLE_BYTE_FLIP_MASK(%rip), SHUF_MASK
@@ -297,8 +297,3 @@
 .align 16
 PSHUFFLE_BYTE_FLIP_MASK:
 	.octa 0x000102030405060708090a0b0c0d0e0f
-
-.section	.rodata.cst16.UPPER_WORD_MASK, "aM", @progbits, 16
-.align 16
-UPPER_WORD_MASK:
-	.octa 0xFFFFFFFF000000000000000000000000

             reply	other threads:[~2024-04-08 14:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08 14:08 Stefan Kanthak [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-04-08 14:08 [PATCH v2 1/2] crypto: s(h)aving 16 byte constant off arch/x86/crypto/sha1_ni_asm.S Stefan Kanthak
     [not found] <20240408141817.E22F8128369@smtp.subspace.kernel.org>
2024-04-08 14:37 ` Ard Biesheuvel

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=20240408140852.7IrbCT995YfkzWGvzZecmdDaYREy6yttd_Db6j1dPAQ@z \
    --to=stefan.kanthak@nexgo.de \
    --cc=ebiggers@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tim.c.chen@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).