summaryrefslogtreecommitdiff
path: root/arch/arm/crypto/sha2-ce-core.S
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-04-09 13:55:43 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2015-04-10 16:39:45 +0300
commit9205b94923213ee164d7398fdc90826e463c281a (patch)
tree4391d6b50ba266a9538dac2f8eba5f9d18370c38 /arch/arm/crypto/sha2-ce-core.S
parentb59e2ae3690c8ef5f8ddeeb0b6b3313521b915e6 (diff)
downloadlinux-9205b94923213ee164d7398fdc90826e463c281a.tar.xz
crypto: arm/sha2-ce - move SHA-224/256 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/sha2-ce-core.S')
-rw-r--r--arch/arm/crypto/sha2-ce-core.S19
1 files changed, 5 insertions, 14 deletions
diff --git a/arch/arm/crypto/sha2-ce-core.S b/arch/arm/crypto/sha2-ce-core.S
index 96af09fe957b..87ec11a5f405 100644
--- a/arch/arm/crypto/sha2-ce-core.S
+++ b/arch/arm/crypto/sha2-ce-core.S
@@ -69,27 +69,18 @@
.word 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
/*
- * void sha2_ce_transform(int blocks, u8 const *src, u32 *state,
- * u8 *head);
+ * void sha2_ce_transform(struct sha256_state *sst, u8 const *src,
+ int blocks);
*/
ENTRY(sha2_ce_transform)
/* load state */
- vld1.32 {dga-dgb}, [r2]
-
- /* load partial input (if supplied) */
- teq r3, #0
- beq 0f
- vld1.32 {q0-q1}, [r3]!
- vld1.32 {q2-q3}, [r3]
- teq r0, #0
- b 1f
+ vld1.32 {dga-dgb}, [r0]
/* load input */
0: vld1.32 {q0-q1}, [r1]!
vld1.32 {q2-q3}, [r1]!
- subs r0, r0, #1
+ subs r2, r2, #1
-1:
#ifndef CONFIG_CPU_BIG_ENDIAN
vrev32.8 q0, q0
vrev32.8 q1, q1
@@ -129,6 +120,6 @@ ENTRY(sha2_ce_transform)
bne 0b
/* store new state */
- vst1.32 {dga-dgb}, [r2]
+ vst1.32 {dga-dgb}, [r0]
bx lr
ENDPROC(sha2_ce_transform)