]> git.openpandora.org Git - pandora-kernel.git/commitdiff
crypto: x86/sha512_ssse3 - move SHA-384/512 SSSE3 implementation to base layer
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 9 Apr 2015 10:55:48 +0000 (12:55 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 10 Apr 2015 13:39:48 +0000 (21:39 +0800)
This removes all the boilerplate from the existing implementation,
and replaces it with calls into the base layer.  It also changes the
prototypes of the core asm functions to be compatible with the base
prototype

  void (sha512_block_fn)(struct sha256_state *sst, u8 const *src, int blocks)

so that they can be passed to the base layer directly.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/sha512-avx-asm.S
arch/x86/crypto/sha512-avx2-asm.S
arch/x86/crypto/sha512-ssse3-asm.S
arch/x86/crypto/sha512_ssse3_glue.c

index 974dde9bc6cd220960b9d053a82e81c78596449e..565274d6a6419faac4a376aa658540372fecee26 100644 (file)
@@ -54,9 +54,9 @@
 
 # Virtual Registers
 # ARG1
-msg    = %rdi
+digest = %rdi
 # ARG2
-digest = %rsi
+msg    = %rsi
 # ARG3
 msglen = %rdx
 T1     = %rcx
@@ -271,7 +271,7 @@ frame_size = frame_GPRSAVE + GPRSAVE_SIZE
 .endm
 
 ########################################################################
-# void sha512_transform_avx(const void* M, void* D, u64 L)
+# void sha512_transform_avx(void* D, const void* M, u64 L)
 # Purpose: Updates the SHA512 digest stored at D with the message stored in M.
 # The size of the message pointed to by M must be an integer multiple of SHA512
 # message blocks.
index 568b96105f5cdb20d625c15564ff81d2df992301..a4771dcd1fcf4ff6c2a778ed481174b4cfefe694 100644 (file)
@@ -70,9 +70,9 @@ XFER  = YTMP0
 BYTE_FLIP_MASK  = %ymm9
 
 # 1st arg
-INP         = %rdi
+CTX         = %rdi
 # 2nd arg
-CTX         = %rsi
+INP         = %rsi
 # 3rd arg
 NUM_BLKS    = %rdx
 
@@ -562,7 +562,7 @@ frame_size = frame_GPRSAVE + GPRSAVE_SIZE
 .endm
 
 ########################################################################
-# void sha512_transform_rorx(const void* M, void* D, uint64_t L)#
+# void sha512_transform_rorx(void* D, const void* M, uint64_t L)#
 # Purpose: Updates the SHA512 digest stored at D with the message stored in M.
 # The size of the message pointed to by M must be an integer multiple of SHA512
 #   message blocks.
index fb56855d51f553f2705d537128169bc963610658..e610e29cbc81841eddbd5d8954b2dff997c541f3 100644 (file)
@@ -53,9 +53,9 @@
 
 # Virtual Registers
 # ARG1
-msg =          %rdi
+digest =       %rdi
 # ARG2
-digest =       %rsi
+msg =          %rsi
 # ARG3
 msglen =       %rdx
 T1 =           %rcx
@@ -269,7 +269,7 @@ frame_size = frame_GPRSAVE + GPRSAVE_SIZE
 .endm
 
 ########################################################################
-# void sha512_transform_ssse3(const void* M, void* D, u64 L)#
+# void sha512_transform_ssse3(void* D, const void* M, u64 L)#
 # Purpose: Updates the SHA512 digest stored at D with the message stored in M.
 # The size of the message pointed to by M must be an integer multiple of SHA512
 #   message blocks.
Simple merge