summaryrefslogtreecommitdiff
path: root/arch/arm/crypto/sha1-ce-core.S
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-04-09 12:55:41 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2015-04-10 21:39:44 +0800
commitdde00981e64b3c6621cafe3eea2eef6a4055208c (patch)
treef1c1694f6d66b592e98e5306035eae903b922707 /arch/arm/crypto/sha1-ce-core.S
parent51e515faa887e40e7e30a3e13607ea6be418e4c4 (diff)
crypto: arm/sha1-ce - move SHA-1 ARMv8 implementation to base layer
This removes all the boilerplate from the existing implementation, and replaces it with calls into the base layer. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/arm/crypto/sha1-ce-core.S')
-rw-r--r--arch/arm/crypto/sha1-ce-core.S23
1 files changed, 7 insertions, 16 deletions
diff --git a/arch/arm/crypto/sha1-ce-core.S b/arch/arm/crypto/sha1-ce-core.S
index 4aad520935d8..b623f51ccbcf 100644
--- a/arch/arm/crypto/sha1-ce-core.S
+++ b/arch/arm/crypto/sha1-ce-core.S
@@ -61,8 +61,8 @@
.word 0xca62c1d6, 0xca62c1d6, 0xca62c1d6, 0xca62c1d6
/*
- * void sha1_ce_transform(int blocks, u8 const *src, u32 *state,
- * u8 *head);
+ * void sha1_ce_transform(struct sha1_state *sst, u8 const *src,
+ * int blocks);
*/
ENTRY(sha1_ce_transform)
/* load round constants */
@@ -71,23 +71,14 @@ ENTRY(sha1_ce_transform)
vld1.32 {k2-k3}, [ip, :128]
/* load state */
- vld1.32 {dga}, [r2]
- vldr dgbs, [r2, #16]
-
- /* load partial input (if supplied) */
- teq r3, #0
- beq 0f
- vld1.32 {q8-q9}, [r3]!
- vld1.32 {q10-q11}, [r3]
- teq r0, #0
- b 1f
+ vld1.32 {dga}, [r0]
+ vldr dgbs, [r0, #16]
/* load input */
0: vld1.32 {q8-q9}, [r1]!
vld1.32 {q10-q11}, [r1]!
- subs r0, r0, #1
+ subs r2, r2, #1
-1:
#ifndef CONFIG_CPU_BIG_ENDIAN
vrev32.8 q8, q8
vrev32.8 q9, q9
@@ -128,7 +119,7 @@ ENTRY(sha1_ce_transform)
bne 0b
/* store new state */
- vst1.32 {dga}, [r2]
- vstr dgbs, [r2, #16]
+ vst1.32 {dga}, [r0]
+ vstr dgbs, [r0, #16]
bx lr
ENDPROC(sha1_ce_transform)