linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/6] crypto: arm64/sha1-ce - fix for big endian
Date: Sun,  9 Oct 2016 18:42:22 +0100	[thread overview]
Message-ID: <1476034945-9186-4-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1476034945-9186-1-git-send-email-ard.biesheuvel@linaro.org>

The SHA1 digest is an array of 5 32-bit quantities, so we should refer
to them as such in order for this code to work correctly when built for
big endian. So replace 16 byte scalar loads and stores with 4x4 vector
ones where appropriate.

Fixes: 2c98833a42cd ("arm64/crypto: SHA-1 using ARMv8 Crypto Extensions")
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 arch/arm64/crypto/sha1-ce-core.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/crypto/sha1-ce-core.S b/arch/arm64/crypto/sha1-ce-core.S
index 033aae6d732a..c98e7e849f06 100644
--- a/arch/arm64/crypto/sha1-ce-core.S
+++ b/arch/arm64/crypto/sha1-ce-core.S
@@ -78,7 +78,7 @@ ENTRY(sha1_ce_transform)
 	ld1r		{k3.4s}, [x6]
 
 	/* load state */
-	ldr		dga, [x0]
+	ld1		{dgav.4s}, [x0]
 	ldr		dgb, [x0, #16]
 
 	/* load sha1_ce_state::finalize */
@@ -144,7 +144,7 @@ CPU_LE(	rev32		v11.16b, v11.16b	)
 	b		1b
 
 	/* store new state */
-3:	str		dga, [x0]
+3:	st1		{dgav.4s}, [x0]
 	str		dgb, [x0, #16]
 	ret
 ENDPROC(sha1_ce_transform)
-- 
2.7.4

  parent reply	other threads:[~2016-10-09 17:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-09 17:42 [PATCH 0/6] crypto: arm64 - big endian fixes Ard Biesheuvel
2016-10-09 17:42 ` [PATCH 1/6] crypto: arm64/aes-ce - fix for big endian Ard Biesheuvel
2016-10-09 17:42 ` [PATCH 2/6] crypto: arm64/ghash-ce " Ard Biesheuvel
2016-10-09 17:42 ` Ard Biesheuvel [this message]
2016-10-09 17:42 ` [PATCH 4/6] crypto: arm64/sha2-ce " Ard Biesheuvel
2016-10-09 17:42 ` [PATCH 5/6] crypto: arm64/aes-ccm-ce: " Ard Biesheuvel
2016-10-09 17:42 ` [PATCH 6/6] crypto: arm64/aes-neon - " Ard Biesheuvel
2016-10-10 11:26 ` [PATCH 0/6] crypto: arm64 - big endian fixes Ard Biesheuvel
2016-10-11  2:12   ` Herbert Xu
2016-10-11 11:01     ` 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=1476034945-9186-4-git-send-email-ard.biesheuvel@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --cc=linux-arm-kernel@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 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 NNTP newsgroup(s).