[PATCH v2 03/11] arm64/crypto: GHASH secure hash using ARMv8 Crypto Extensions

2014-05-14 Thread Ard Biesheuvel
This is a port to ARMv8 (Crypto Extensions) of the Intel implementation of the GHASH Secure Hash (used in the Galois/Counter chaining mode). It relies on the optional PMULL/PMULL2 instruction (polynomial multiply long, what Intel call carry-less multiply). Signed-off-by: Ard Biesheuvel Acked-by

[PATCH v2 06/11] arm64: pull in from asm-generic

2014-05-14 Thread Ard Biesheuvel
Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/Kbuild | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild index 83f71b3004a8..42c7eecd2bb6 100644 --- a/arch/arm64/include/asm/Kbuild +++ b/arch/arm64/include/asm/Kbuild

[PATCH v2 05/11] arm64/crypto: AES in CCM mode using ARMv8 Crypto Extensions

2014-05-14 Thread Ard Biesheuvel
This patch adds support for the AES-CCM encryption algorithm for CPUs that have support for the AES part of the ARM v8 Crypto Extensions. Signed-off-by: Ard Biesheuvel Acked-by: Herbert Xu --- arch/arm64/crypto/Kconfig | 7 + arch/arm64/crypto/Makefile | 3 + arch/arm64

[PATCH v2 02/11] arm64/crypto: SHA-224/SHA-256 using ARMv8 Crypto Extensions

2014-05-14 Thread Ard Biesheuvel
This patch adds support for the SHA-224 and SHA-256 Secure Hash Algorithms for CPUs that have support for the SHA-2 part of the ARM v8 Crypto Extensions. Signed-off-by: Ard Biesheuvel Acked-by: Herbert Xu --- arch/arm64/crypto/Kconfig| 5 + arch/arm64/crypto/Makefile | 3

[PATCH v2 00/11] arm64 crypto roundup

2014-05-14 Thread Ard Biesheuvel
All patches operate correctly under their respective 'tcrypt.ko mode=xx' tests. Ard Biesheuvel (11): arm64/crypto: SHA-1 using ARMv8 Crypto Extensions arm64/crypto: SHA-224/SHA-256 using ARMv8 Crypto Extensions arm64/crypto: GHASH secure hash using ARMv8 Crypto Extensions arm64/cr

[PATCH v2 08/11] arm64/crypto: add shared macro to test for NEED_RESCHED

2014-05-14 Thread Ard Biesheuvel
This adds the asm macro definition 'b_if_no_resched' that performs a conditional branch depending on the preempt need_resched state. Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/assembler.h | 21 + 1 file changed, 21 insertions(+) diff --git a/arch/arm

[PATCH v2 07/11] arm64/crypto: AES-ECB/CBC/CTR/XTS using ARMv8 NEON and Crypto Extensions

2014-05-14 Thread Ard Biesheuvel
nsion routines were borrowed from aes_generic. Signed-off-by: Ard Biesheuvel Acked-by: Herbert Xu --- arch/arm64/crypto/Kconfig | 14 ++ arch/arm64/crypto/Makefile| 14 ++ arch/arm64/crypto/aes-ce.S| 133 +++ arch/arm64/crypto/aes-glue.c

[PATCH v2 09/11] arm64/crypto: add voluntary preemption to Crypto Extensions SHA1

2014-05-14 Thread Ard Biesheuvel
the scheduler. Signed-off-by: Ard Biesheuvel Acked-by: Herbert Xu --- arch/arm64/crypto/sha1-ce-core.S | 19 --- arch/arm64/crypto/sha1-ce-glue.c | 52 ++-- 2 files changed, 44 insertions(+), 27 deletions(-) diff --git a/arch/arm64/crypto/sha1-ce

[PATCH v2 01/11] arm64/crypto: SHA-1 using ARMv8 Crypto Extensions

2014-05-14 Thread Ard Biesheuvel
This patch adds support for the SHA-1 Secure Hash Algorithm for CPUs that have support for the SHA-1 part of the ARM v8 Crypto Extensions. Signed-off-by: Ard Biesheuvel Acked-by: Herbert Xu --- arch/arm64/Kconfig | 3 + arch/arm64/Makefile | 1 + arch/arm64

[PATCH v2 10/11] arm64/crypto: add voluntary preemption to Crypto Extensions SHA2

2014-05-14 Thread Ard Biesheuvel
the scheduler. Signed-off-by: Ard Biesheuvel Acked-by: Herbert Xu --- arch/arm64/crypto/sha2-ce-core.S | 19 --- arch/arm64/crypto/sha2-ce-glue.c | 51 ++-- 2 files changed, 44 insertions(+), 26 deletions(-) diff --git a/arch/arm64/crypto/sha2-ce

[PATCH v2 11/11] arm64/crypto: add voluntary preemption to Crypto Extensions GHASH

2014-05-14 Thread Ard Biesheuvel
the scheduler. Signed-off-by: Ard Biesheuvel Acked-by: Herbert Xu --- arch/arm64/crypto/ghash-ce-core.S | 10 ++ arch/arm64/crypto/ghash-ce-glue.c | 34 ++ 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/arch/arm64/crypto/ghash-ce-core.S

[PATCH v2 04/11] arm64/crypto: AES using ARMv8 Crypto Extensions

2014-05-14 Thread Ard Biesheuvel
This patch adds support for the AES symmetric encryption algorithm for CPUs that have support for the AES part of the ARM v8 Crypto Extensions. Signed-off-by: Ard Biesheuvel Acked-by: Herbert Xu --- arch/arm64/crypto/Kconfig | 7 +- arch/arm64/crypto/Makefile| 3 + arch

Re: [PATCH v2 09/11] arm64/crypto: add voluntary preemption to Crypto Extensions SHA1

2014-05-15 Thread Ard Biesheuvel
On 15 May 2014 10:24, Catalin Marinas wrote: > On Wed, May 14, 2014 at 07:17:29PM +0100, Ard Biesheuvel wrote: >> The Crypto Extensions based SHA1 implementation uses the NEON register file, >> and hence runs with preemption disabled. This patch adds a TIF_NEED_RESCHED >> ch

Re: [PATCH v2 09/11] arm64/crypto: add voluntary preemption to Crypto Extensions SHA1

2014-05-15 Thread Ard Biesheuvel
On 15 May 2014 14:47, Catalin Marinas wrote: > On 15 May 2014, at 22:35, Ard Biesheuvel wrote: >> On 15 May 2014 10:24, Catalin Marinas wrote: >>> On Wed, May 14, 2014 at 07:17:29PM +0100, Ard Biesheuvel wrote: >>>> +static u8 const *sha1_do_update(struct sh

[PATCH] crypto: add 4 more test vectors for GHASH

2014-06-12 Thread Ard Biesheuvel
This adds 4 test vectors for GHASH (of which one for chunked mode), making a total of 5. Signed-off-by: Ard Biesheuvel --- crypto/testmgr.h | 49 + 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/crypto/testmgr.h b/crypto/testmgr.h

Re: [PATCH 1/2] crypto: sha1/ARM: make use of common SHA-1 structures

2014-06-28 Thread Ard Biesheuvel
On 28 June 2014 12:39, Jussi Kivilinna wrote: > Common SHA-1 structures are defined in for code sharing. > > This patch changes SHA-1/ARM glue code to use these structures. > > Signed-off-by: Jussi Kivilinna Acked-by: Ard Biesheuvel > --- > arch/arm/cryp

Re: [PATCH 2/2] crypto: sha1: add ARM NEON implementation

2014-06-28 Thread Ard Biesheuvel
Hi Jussi, On 28 June 2014 12:40, Jussi Kivilinna wrote: > This patch adds ARM NEON assembly implementation of SHA-1 algorithm. > > tcrypt benchmark results on Cortex-A8, sha1-arm-asm vs sha1-neon-asm: > > block-size bytes/updateold-vs-new > 16 16 1.06x > 64

Re: [PATCH 2/2] [v2] crypto: sha1: add ARM NEON implementation

2014-06-30 Thread Ard Biesheuvel
1.63x > > Changes in v2: > - Use ENTRY/ENDPROC > - Don't provide Thumb2 version > - Move contants to .text section > - Further tweaks to implementation for ~10% speed-up. > Please move the changelog to below the '---' so it doesn't end up in the kernel c

Re: [PATCH] [v2] crypto: sha512: add ARM NEON implementation

2014-06-30 Thread Ard Biesheuvel
81923.60x > Nice speedup! > Changes in v2: > - Use ENTRY/ENDPROC > - Don't provide Thumb2 version > Please move Changelog below '---' > Signed-off-by: Jussi Kivilinna Acked-by: Ard Biesheuvel Tested-by: Ard Biesheuvel Tested on Exynos-5250

Re: [PATCH 1/2] [v2] crypto: sha1/ARM: make use of common SHA-1 structures

2014-06-30 Thread Ard Biesheuvel
On 29 June 2014 16:33, Jussi Kivilinna wrote: > Common SHA-1 structures are defined in for code sharing. > > This patch changes SHA-1/ARM glue code to use these structures. > > Acked-by: Ard Biesheuvel > Signed-off-by: Jussi Kivilinna > --- These two should go into Russ

Re: [PATCH] [v3] crypto: sha512: add ARM NEON implementation

2014-06-30 Thread Ard Biesheuvel
t; 4096256 3.42x > 409610243.56x > 409640963.59x > 819216 2.48x > 8192256 3.42x > 819210243.56x > 8192 4096 3.60x > 8192

Re: [PATCH 1/2] arm64 aes: fix encryption of unaligned data

2014-07-26 Thread Ard Biesheuvel
he residue bytes that were not > processed as the last parameter to blkcipher_walk_done. > > Signed-off-by: Mikulas Patocka > Acked-by: Ard Biesheuvel Thanks for the patch. This correctly fixes a thinko on my part regarding the guarantees offered by the blkcipher API. Unfortunat

Re: [PATCH 1/2] arm64 aes: fix encryption of unaligned data

2014-07-26 Thread Ard Biesheuvel
On 26 July 2014 15:13, Ard Biesheuvel wrote: > On 26 July 2014 01:40, Mikulas Patocka wrote: >> cryptsetup fails on arm64 when using kernel encryption via AF_ALG socket. >> See https://bugzilla.redhat.com/show_bug.cgi?id=1122937 >> >> The bug is caused by incorrect ha

Re: [PATCH 2/2] arm aes: fix encryption of unaligned data

2014-07-26 Thread Ard Biesheuvel
On 26 July 2014 01:42, Mikulas Patocka wrote: > Fix the same alignment bug as in arm64 - we need to pass residue > unprocessed bytes as the last argument to blkcipher_walk_done. > > Signed-off-by: Mikulas Patocka > Cc: sta...@vger.kernel.org # 3.13+ > Acked-by: Ard Biesh

Re: [PATCH 1/2] arm64 aes: fix encryption of unaligned data

2014-07-26 Thread Ard Biesheuvel
On 26 July 2014 17:31, Mikulas Patocka wrote: > > > On Sat, 26 Jul 2014, Ard Biesheuvel wrote: > >> On 26 July 2014 15:13, Ard Biesheuvel wrote: >> > On 26 July 2014 01:40, Mikulas Patocka wrote: >> >> cryptsetup fails on arm64 when using kernel encryp

[PATCH] crypto: use chunks smaller than algo block size in chunk tests

2014-07-27 Thread Ard Biesheuvel
This patch updates many of the chunked tcrypt test cases so that not all of the chunks are an exact multiple of the block size. This should help uncover cases where the residue passed to blkcipher_walk_done() is incorrect. Signed-off-by: Ard Biesheuvel --- Herbert, After this change, the ARM

Re: [PATCH] [v3] crypto: sha512: add ARM NEON implementation

2014-07-29 Thread Ard Biesheuvel
t; 4096256 3.42x > 409610243.56x > 409640963.59x > 819216 2.48x > 8192256 3.42x > 819210243.56x > 8192 4096 3.60x > 8192

[PATCH 2/2] ARM: crypto: enable NEON SHA-384/SHA-512 for big endian

2014-08-04 Thread Ard Biesheuvel
The SHA-512 NEON works just fine under big endian, so remove the Kconfig condition preventing it from being selected if CONFIG_CPU_BIG_ENDIAN is set. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/Kconfig b/crypto

[PATCH 1/2] ARM: crypto: enable NEON SHA-1 for big endian

2014-08-04 Thread Ard Biesheuvel
This tweaks the SHA-1 NEON code slightly so it works correctly under big endian, and removes the Kconfig condition preventing it from being selected if CONFIG_CPU_BIG_ENDIAN is set. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/sha1-armv7-neon.S | 8 crypto/Kconfig

[PATCH v2] ARM: crypto: enable NEON SHA-1 for big endian

2014-08-05 Thread Ard Biesheuvel
This tweaks the SHA-1 NEON code slightly so it works correctly under big endian, and removes the Kconfig condition preventing it from being selected if CONFIG_CPU_BIG_ENDIAN is set. Signed-off-by: Ard Biesheuvel --- I accidentally submitted the version below to the patch system (#8125/1) rather

Re: [PATCH] arm64/crypto: remove redundant update of data

2014-08-25 Thread Ard Biesheuvel
gt; Updating data by blocks * SHA256_BLOCK_SIZE at the end of > ha2_finup is redundant code and can be removed. > ^^^ typo here > Signed-off-by: Colin Ian King Acked-by: Ard Biesheuvel > --- > arch/arm64/crypto/sha2-ce-glue.c | 1 - > 1 file changed, 1 deletion(-) > > diff

Re: 3.17 regression; alg: skcipher: Chunk test 1 failed on encryption at page 0 for ecb-aes-padlock

2014-10-20 Thread Ard Biesheuvel
On 20 October 2014 09:14, Jamie Heilman wrote: > I get this new failure w/3.17.0 on my system with a VIA Esther > processor: > > alg: skcipher: Chunk test 1 failed on encryption at page 0 for ecb-aes-padlock > : 71 73 f7 db 24 93 21 6d 61 1e bb 63 42 79 db 64 > 0010: 6f 82 c0 ca a3 9b

Re: 3.17 regression; alg: skcipher: Chunk test 1 failed on encryption at page 0 for ecb-aes-padlock

2014-10-20 Thread Ard Biesheuvel
On 21 October 2014 01:43, Jamie Heilman wrote: > Ard Biesheuvel wrote: >> On 20 October 2014 09:14, Jamie Heilman wrote: >> > I get this new failure w/3.17.0 on my system with a VIA Esther >> > processor: >> > >> > alg: skcipher: Chunk test 1 fai

[PATCH] arm64/crypto: use crypto instructions for generating AES key schedule

2014-10-22 Thread Ard Biesheuvel
This patch implements the AES key schedule generation using ARMv8 Crypto Instructions. It replaces the table based C implementation in aes_generic.ko, which means we can drop the dependency on that module. Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/Kconfig | 5 +- arch

Re: [PATCH] arm64/crypto: use crypto instructions for generating AES key schedule

2014-10-22 Thread Ard Biesheuvel
On 22 October 2014 18:25, Catalin Marinas wrote: > On Wed, Oct 22, 2014 at 08:15:32AM +0100, Ard Biesheuvel wrote: >> This patch implements the AES key schedule generation using ARMv8 >> Crypto Instructions. It replaces the table based C implementation >> in aes_generic.k

Re: [PATCH] arm64/crypto: use crypto instructions for generating AES key schedule

2014-10-22 Thread Ard Biesheuvel
On 22 October 2014 18:59, Catalin Marinas wrote: > On Wed, Oct 22, 2014 at 05:31:32PM +0100, Ard Biesheuvel wrote: >> On 22 October 2014 18:25, Catalin Marinas wrote: >> > On Wed, Oct 22, 2014 at 08:15:32AM +0100, Ard Biesheuvel wrote: >> >> This patch implements t

[PATCH v2] arm64/crypto: use crypto instructions to generate AES key schedule

2014-11-03 Thread Ard Biesheuvel
This patch implements the AES key schedule generation using ARMv8 Crypto Instructions. It replaces the table based C implementation in aes_generic.ko, which means we can drop the dependency on that module. Tested-by: Steve Capper Acked-by: Steve Capper Signed-off-by: Ard Biesheuvel --- v2

Re: simd: Allow simd use in kernel threads with softirqs disabled

2014-11-14 Thread Ard Biesheuvel
On 14 November 2014 16:43, Herbert Xu wrote: > While working on the cryptd request reordering problem, I noticed > an anomaly where kernel threads are normally allowed to use simd > per may_use_simd, but as soon as you disable softirqs, they suddenly > lose that ability for no good reason. > > The

Re: [PATCH] arm64: crypto: Add ARM64 CRC32 hw accelerated module

2014-11-21 Thread Ard Biesheuvel
n ARMv8. >> >> Tested on AMD Seattle. >> >> Improvement compared to crc32c-generic algorithm: >> TCRYPT CRC32C speed test shows ~450% speedup. >> Simple dd write tests to btrfs filesystem show ~30% speedup. >> >> Signed-off-by: Yazen Ghannam >&

Re: [PATCH 7/8 v2] crypto: replace memset by memzero_explicit

2014-11-30 Thread Ard Biesheuvel
!= x > when strict > } > // > > This change was suggested by Daniel Borkmann > > Signed-off-by: Julia Lawall > > --- > Daniel Borkmann suggested that these patches could go through Herbert Xu's > cryptodev tree. > > I was not able to

[PATCH] arm64: crypto: increase AES interleave to 4x

2015-02-19 Thread Ard Biesheuvel
ed of async cbc(aes) (cbc-aes-ce) decryption test 4 (128 bit key, 8192 byte blocks): 124735 operations in 1 seconds test 14 (256 bit key, 8192 byte blocks): 92328 operations in 1 seconds Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 del

Re: [PATCH] arm64: crypto: increase AES interleave to 4x

2015-02-20 Thread Ard Biesheuvel
On 20 February 2015 at 15:55, Will Deacon wrote: > On Thu, Feb 19, 2015 at 05:25:16PM +0000, Ard Biesheuvel wrote: >> This patch increases the interleave factor for parallel AES modes >> to 4x. This improves performance on Cortex-A57 by ~35%. This is >> due to the 3

[PATCH] ARM: crypto: update NEON AES module to latest OpenSSL version

2015-02-25 Thread Ard Biesheuvel
ing NEON instructions") Reported-by: Adrian Kotelba Signed-off-by: Ard Biesheuvel --- This was found using the tcrypt test code, to which I recently added additional chunking modes. However, XTS typically operates on pages or at least on sectors, so this bug is unlikely to affect anyone in real life.

Re: [PATCH] ARM: crypto: update NEON AES module to latest OpenSSL version

2015-03-02 Thread Ard Biesheuvel
On 28 February 2015 at 22:30, Milan Broz wrote: > On 02/26/2015 08:22 AM, Ard Biesheuvel wrote: >> This updates the bit sliced AES module to the latest version in the >> upstream OpenSSL repository (e620e5ae37bc). This is needed to fix a >> bug in the XTS decryption path, wh

[PATCH 1/4] crypto/arm: move ARM specific Kconfig definitions to a dedicated file

2015-03-09 Thread Ard Biesheuvel
This moves all Kconfig symbols defined in crypto/Kconfig that depend on CONFIG_ARM to a dedicated Kconfig file in arch/arm/crypto, which is where the code that implements those features resides as well. Signed-off-by: Ard Biesheuvel --- arch/arm/Kconfig| 3 ++ arch/arm/crypto/Kconfig

[PATCH 2/4] crypto/arm: add support for SHA1 using ARMv8 Crypto Instructions

2015-03-09 Thread Ard Biesheuvel
This implements the SHA1 secure hash algorithm using the AArch32 versions of the ARMv8 Crypto Extensions for SHA1. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig| 10 +++ arch/arm/crypto/Makefile | 2 + arch/arm/crypto/sha1-ce-core.S | 134

[PATCH 3/4] crypto/arm: add support for SHA-224/256 using ARMv8 Crypto Extensions

2015-03-09 Thread Ard Biesheuvel
This implements the SHA-224/256 secure hash algorithm using the AArch32 versions of the ARMv8 Crypto Extensions for SHA2. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig| 9 ++ arch/arm/crypto/Makefile | 2 + arch/arm/crypto/sha2-ce-core.S | 134

[PATCH 4/4] crypto/arm: AES in ECB/CBC/CTR/XTS modes using ARMv8 Crypto Extensions

2015-03-09 Thread Ard Biesheuvel
This implements the ECB, CBC, CTR and XTS asynchronous block ciphers using the AArch32 versions of the ARMv8 Crypto Extensions for AES. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig | 9 + arch/arm/crypto/Makefile | 2 + arch/arm/crypto/aes-ce-core.S | 535

[PATCH] crypto/arm: add support for GHASH using ARMv8 Crypto Extensions

2015-03-09 Thread Ard Biesheuvel
This implements the GHASH hash algorithm (as used by the GCM AEAD chaining mode) using the AArch32 version of the 64x64 to 128 bit polynomial multiplication instruction (vmull.p64) that is part of the ARMv8 Crypto Extensions. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig

[PATCH v2 0/5] ARM: crypto: ARMv8 Crypto Extensions

2015-03-10 Thread Ard Biesheuvel
(currently still untested) - added alignment hints where appropriate (e,g., [rX, :128]) - various minor tweaks There are all tested on LE using the respective tcrypt tests. Ard Biesheuvel (5): crypto/arm: move ARM specific Kconfig definitions to a dedicated file crypto/arm: add support for

[PATCH v2 5/5] crypto/arm: add support for GHASH using ARMv8 Crypto Extensions

2015-03-10 Thread Ard Biesheuvel
This implements the GHASH hash algorithm (as used by the GCM AEAD chaining mode) using the AArch32 version of the 64x64 to 128 bit polynomial multiplication instruction (vmull.p64) that is part of the ARMv8 Crypto Extensions. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig

[PATCH v2 2/5] crypto/arm: add support for SHA1 using ARMv8 Crypto Instructions

2015-03-10 Thread Ard Biesheuvel
This implements the SHA1 secure hash algorithm using the AArch32 versions of the ARMv8 Crypto Extensions for SHA1. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig| 10 +++ arch/arm/crypto/Makefile | 2 + arch/arm/crypto/sha1-ce-core.S | 134

[PATCH v2 3/5] crypto/arm: add support for SHA-224/256 using ARMv8 Crypto Extensions

2015-03-10 Thread Ard Biesheuvel
This implements the SHA-224/256 secure hash algorithm using the AArch32 versions of the ARMv8 Crypto Extensions for SHA2. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig| 9 ++ arch/arm/crypto/Makefile | 2 + arch/arm/crypto/sha2-ce-core.S | 134

[PATCH v2 4/5] crypto/arm: AES in ECB/CBC/CTR/XTS modes using ARMv8 Crypto Extensions

2015-03-10 Thread Ard Biesheuvel
This implements the ECB, CBC, CTR and XTS asynchronous block ciphers using the AArch32 versions of the ARMv8 Crypto Extensions for AES. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig | 9 + arch/arm/crypto/Makefile | 2 + arch/arm/crypto/aes-ce-core.S | 518

[PATCH v2 1/5] crypto/arm: move ARM specific Kconfig definitions to a dedicated file

2015-03-10 Thread Ard Biesheuvel
This moves all Kconfig symbols defined in crypto/Kconfig that depend on CONFIG_ARM to a dedicated Kconfig file in arch/arm/crypto, which is where the code that implements those features resides as well. Signed-off-by: Ard Biesheuvel --- arch/arm/Kconfig| 3 ++ arch/arm/crypto/Kconfig

Re: [PATCH] arm: crypto: Add NEON optimized SHA-256

2015-03-16 Thread Ard Biesheuvel
Hello Sami, On 16 March 2015 at 16:48, Sami Tolvanen wrote: > Add Andy Polyakov's NEON optimized SHA-256 implementation. > > On Nexus 6, this implementation is ~2x faster than sha256-generic. > > Signed-off-by: Sami Tolvanen > Have you tested this code with the tcrypt.ko module? Some more comm

Re: [PATCH] arm: crypto: Add NEON optimized SHA-256

2015-03-16 Thread Ard Biesheuvel
On 16 March 2015 at 17:23, Sami Tolvanen wrote: > On Mon, Mar 16, 2015 at 05:08:03PM +0100, Ard Biesheuvel wrote: >> Have you tested this code with the tcrypt.ko module? > > I have not, but I can look into it. > >> Did you talk to Andy about the license? I don't thi

Re: [PATCH] arm: crypto: Add NEON optimized SHA-256

2015-03-17 Thread Ard Biesheuvel
On 17 March 2015 at 16:09, Andy Polyakov wrote: > Hi, > Have you tested this code with the tcrypt.ko module? >>> >>> I have not, but I can look into it. >>> Did you talk to Andy about the license? I don't think this is permissible for the kernel as-is. >>> >>> Unless I have misunder

[PATCH] arm64/crypto: issue aese/aesmc instructions in pairs

2015-03-17 Thread Ard Biesheuvel
CBC dec CTR before3.641.341.32 after 1.950.850.93 Note that this results in a ~5% performance decrease for older cores. Signed-off-by: Ard Biesheuvel --- Will, This is the optimization you yourself mentioned to me

Re: [PATCHv2] arm: crypto: Add optimized SHA-256/224

2015-03-23 Thread Ard Biesheuvel
Signed-off-by: Sami Tolvanen > Cc: Andy Polyakov > This builds fine and passes the tcrypt.ko tests in ARM and Thumb2 and even in big-endian (ARM) mode, so Tested-by: Ard Biesheuvel Reviewed-by: Ard Biesheuvel Nice work! Ard. > --- > Changes since v1: > Rebased to Herbert&#

[PATCH] crypto/arm: fix big-endian bug in ghash

2015-03-23 Thread Ard Biesheuvel
This fixes a bug in the new v8 Crypto Extensions GHASH code that only manifests itself in big-endian mode. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/ghash-ce-core.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/crypto/ghash-ce-core.S b/arch/arm/crypto

Re: [PATCHv2] arm: crypto: Add optimized SHA-256/224

2015-03-24 Thread Ard Biesheuvel
On 24 March 2015 at 12:32, Herbert Xu wrote: > On Mon, Mar 23, 2015 at 01:50:09PM +, Sami Tolvanen wrote: >> Add Andy Polyakov's optimized assembly and NEON implementations for >> SHA-256/224. >> >> The sha256-armv4.pl script for generating the assembly code is from >> OpenSSL commit 2ecd32a1f

Re: [PATCHv2] arm: crypto: Add optimized SHA-256/224

2015-03-24 Thread Ard Biesheuvel
On 24 March 2015 at 12:35, Herbert Xu wrote: > On Mon, Mar 23, 2015 at 07:26:03PM +0100, Ard Biesheuvel wrote: >> (resending due to size bounce) > > Aha that's why the patch didn't make it through. Can it be split > up? Not so easily. It consists (among othe

Re: [PATCHv2] arm: crypto: Add optimized SHA-256/224

2015-03-24 Thread Ard Biesheuvel
On 24 March 2015 at 12:46, Herbert Xu wrote: > On Tue, Mar 24, 2015 at 12:40:50PM +0100, Ard Biesheuvel wrote: >> >> Not so easily. It consists (among other things) of a .pl file that >> generates a .S file, but to prevent introducing a build time >> dependency on perl,

Re: [PATCHv2] arm: crypto: Add optimized SHA-256/224

2015-03-24 Thread Ard Biesheuvel
On 24 March 2015 at 13:27, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 13:50 Mon 23 Mar , Sami Tolvanen wrote: >> Add Andy Polyakov's optimized assembly and NEON implementations for >> SHA-256/224. >> >> The sha256-armv4.pl script for generating the assembly code is from >> OpenSSL commit 2ec

Re: [PATCHv2] arm: crypto: Add optimized SHA-256/224

2015-03-24 Thread Ard Biesheuvel
On 24 March 2015 at 14:05, Jean-Christophe PLAGNIOL-VILLARD wrote: > >> + '&eor ($t0,$t0,$a,"ror#".($Sigma0[2]-$Sigma0[0]))', # Sigma0(a) >> >> + '&add ($h,$h,$t1)', # h+=Ch(e,f,g) >> >> + '&ldr ($t1,sprintf "[sp,#%d]",4*(($j+1)&15)) if (($j&15)!=15);'. >> >

Re: [PATCHv2] arm: crypto: Add optimized SHA-256/224

2015-03-24 Thread Ard Biesheuvel
On 24 March 2015 at 14:06, Ard Biesheuvel wrote: > On 24 March 2015 at 14:05, Jean-Christophe PLAGNIOL-VILLARD > wrote: >> >> + '&eor ($t0,$t0,$a,"ror#".($Sigma0[2]-$Sigma0[0]))', # Sigma0(a) >>> >> + '&add ($h,$h

Re: [PATCHv2] arm: crypto: Add optimized SHA-256/224

2015-03-24 Thread Ard Biesheuvel
On 24 March 2015 at 18:05, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 15:46 Tue 24 Mar , Ard Biesheuvel wrote: >> On 24 March 2015 at 14:06, Ard Biesheuvel wrote: >> > On 24 March 2015 at 14:05, Jean-Christophe PLAGNIOL-VILLARD >> > wrote: >> >

Re: [PATCHv2] arm: crypto: Add optimized SHA-256/224

2015-03-24 Thread Ard Biesheuvel
On 24 March 2015 at 19:17, Sami Tolvanen wrote: > On Tue, Mar 24, 2015 at 06:40:29PM +0100, Ard Biesheuvel wrote: >> @Sami, Andy: we need to respin the whole patch, including updated >> OpenSSL upstream commit id :-( > > Sure, I will send v3 once the changes are in OpenSS

Re: [PATCHv2] arm: crypto: Add optimized SHA-256/224

2015-03-27 Thread Ard Biesheuvel
On 27 March 2015 at 11:42, Andy Polyakov wrote: >>> Could you share the error log please? >> >> OK, I spotted one issue with this code: >> >> arch/arm/crypto/sha256-core.S: Assembler messages: >> arch/arm/crypto/sha256-core.S:1847: Error: invalid constant (efb0) >> after fixup >> >> This is ca

Re: [PATCHv2] arm: crypto: Add optimized SHA-256/224

2015-03-27 Thread Ard Biesheuvel
On 27 March 2015 at 11:44, Ard Biesheuvel wrote: > On 27 March 2015 at 11:42, Andy Polyakov wrote: >>>> Could you share the error log please? >>> >>> OK, I spotted one issue with this code: >>> >>> arch/arm/crypto/sha256-core.S: Assembler mess

[PATCH] crypto/arm: accelerated SHA-512 using ARM generic ASM and NEON

2015-03-28 Thread Ard Biesheuvel
1.513.512.69 Signed-off-by: Ard Biesheuvel --- This should get the same treatment as Sami's sha56 version: I would like to wait until the OpenSSL source file hits the upstream repository so that I can refer to its sha1 hash in the commit log. arch/arm/crypto/Kc

[RFC PATCH 3/6] crypto: sha256: implement base layer for SHA-256

2015-03-28 Thread Ard Biesheuvel
To reduce the number of copies of boilerplate code throughout the tree, this patch implements generic glue for the SHA-256 algorithm. This allows a specific arch or hardware implementation to only implement the special handling that it needs. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig

[RFC PATCH 2/6] crypto: sha512-generic: move to generic glue implementation

2015-03-28 Thread Ard Biesheuvel
This updated the generic SHA-512 implementation to use the generic shared SHA-512 glue code. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig | 1 + crypto/sha512_generic.c | 117 +++- 2 files changed, 16 insertions(+), 102 deletions

[RFC PATCH 5/6] arm64/crypto: move ARMv8 SHA-224/256 driver to SHA-256 base layer

2015-03-28 Thread Ard Biesheuvel
Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/Kconfig| 1 + arch/arm64/crypto/sha2-ce-core.S | 11 +- arch/arm64/crypto/sha2-ce-glue.c | 211 ++- 3 files changed, 40 insertions(+), 183 deletions(-) diff --git a/arch/arm64/crypto/Kconfig b

[RFC PATCH 4/6] crypto: sha256-generic: move to generic glue implementation

2015-03-28 Thread Ard Biesheuvel
This updates the generic SHA-256 implementation to use the new shared SHA-256 glue code. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig | 1 + crypto/sha256_generic.c | 131 +++- 2 files changed, 18 insertions(+), 114 deletions(-) diff

[RFC PATCH 1/6] crypto: sha512: implement base layer for SHA-512

2015-03-28 Thread Ard Biesheuvel
To reduce the number of copies of boilerplate code throughout the tree, this patch implements generic glue for the SHA-512 algorithm. This allows a specific arch or hardware implementation to only implement the special handling that it needs. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig

[RFC PATCH 0/6] SHA-256/512 glue code consolidation

2015-03-28 Thread Ard Biesheuvel
in asm for inputs that are round multiples of the block size. The final patch is the same core code as the patch I sent yesterday, but this time with most of the redundant glue removed. Comments, suggestions etc are highly appreciated! Regards, Ard. Ard Biesheuvel (6): crypto: sha512

[RFC PATCH 6/6] arm/crypto: accelerated SHA-512 using ARM generic ASM and NEON

2015-03-28 Thread Ard Biesheuvel
10241.412.982.56 8192 40961.412.712.59 8192 81921.513.512.69 Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig |8 + arch/arm/crypto/Makefile |8 +- arch/arm/crypto/sha512

Re: [RFC PATCH 1/6] crypto: sha512: implement base layer for SHA-512

2015-03-29 Thread Ard Biesheuvel
On 29 March 2015 at 10:29, Markus Stockhausen wrote: >> Von: linux-crypto-ow...@vger.kernel.org >> [linux-crypto-ow...@vger.kernel.org]" im Auftrag von "Ard >> Biesheuvel [ard.biesheu...@linaro.org] >> Gesendet: Samstag, 28. März 2015 23:10 >> An: lin

[PATCH v2 00/14] crypto: SHA glue code consolidation

2015-03-30 Thread Ard Biesheuvel
t the generated asm (for arm64), I noticed that the memcpy/memset invocations with compile time constant src and len arguments (which includes the empty struct assignments) are eliminated completely, and replaced by direct loads and stores. Hopefully this addresses the concern raised by Markus regar

[PATCH v2 01/14] crypto: sha512: implement base layer for SHA-512

2015-03-30 Thread Ard Biesheuvel
To reduce the number of copies of boilerplate code throughout the tree, this patch implements generic glue for the SHA-512 algorithm. This allows a specific arch or hardware implementation to only implement the special handling that it needs. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig

[PATCH v2 05/14] crypto: sha256-generic: move to generic glue implementation

2015-03-30 Thread Ard Biesheuvel
This updates the generic SHA-256 implementation to use the new shared SHA-256 glue code. It also implements a .finup hook crypto_sha256_finup() and exports it to other modules. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig | 1 + crypto/sha256_generic.c | 139

[PATCH v2 03/14] crypto: sha1: implement base layer for SHA-1

2015-03-30 Thread Ard Biesheuvel
To reduce the number of copies of boilerplate code throughout the tree, this patch implements generic glue for the SHA-1 algorithm. This allows a specific arch or hardware implementation to only implement the special handling that it needs. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig

[PATCH v2 04/14] crypto: sha512-generic: move to generic glue implementation

2015-03-30 Thread Ard Biesheuvel
This updated the generic SHA-512 implementation to use the generic shared SHA-512 glue code. It also implements a .finup hook crypto_sha512_finup() and exports it to other modules. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig | 1 + crypto/sha512_generic.c | 126

[PATCH v2 06/14] crypto: sha1-generic: move to generic glue implementation

2015-03-30 Thread Ard Biesheuvel
This updated the generic SHA-1 implementation to use the generic shared SHA-1 glue code. It also implements a .finup hook crypto_sha1_finup() and exports it to other modules. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig| 1 + crypto/sha1_generic.c | 105

[RFC PATCH 5/6] arm64/crypto: move ARMv8 SHA-224/256 driver to SHA-256 base layer

2015-03-30 Thread Ard Biesheuvel
Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/Kconfig| 1 + arch/arm64/crypto/sha2-ce-core.S | 11 +- arch/arm64/crypto/sha2-ce-glue.c | 211 ++- 3 files changed, 40 insertions(+), 183 deletions(-) diff --git a/arch/arm64/crypto/Kconfig b

[PATCH v2 08/14] crypto/arm: move SHA-1 ARMv8 implementation to base layer

2015-03-30 Thread Ard Biesheuvel
Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig| 2 +- arch/arm/crypto/sha1-ce-glue.c | 110 +++-- 2 files changed, 31 insertions(+), 81 deletions(-) diff --git a/arch/arm/crypto/Kconfig b/arch/arm/crypto/Kconfig index c111d8992afb

[RFC PATCH 3/6] crypto: sha256: implement base layer for SHA-256

2015-03-30 Thread Ard Biesheuvel
To reduce the number of copies of boilerplate code throughout the tree, this patch implements generic glue for the SHA-256 algorithm. This allows a specific arch or hardware implementation to only implement the special handling that it needs. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig

[RFC PATCH 2/6] crypto: sha512-generic: move to generic glue implementation

2015-03-30 Thread Ard Biesheuvel
This updated the generic SHA-512 implementation to use the generic shared SHA-512 glue code. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig | 1 + crypto/sha512_generic.c | 117 +++- 2 files changed, 16 insertions(+), 102 deletions

[PATCH v2 07/14] crypto/arm: move SHA-1 ARM asm implementation to base layer

2015-03-30 Thread Ard Biesheuvel
Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig | 1 + arch/arm/{include/asm => }/crypto/sha1.h | 3 + arch/arm/crypto/sha1_glue.c | 117 +++ 3 files changed, 28 insertions(+), 93 deletions(-) rename arch/arm/{include/

[PATCH v2 09/14] crypto/arm: move SHA-224/256 ARMv8 implementation to base layer

2015-03-30 Thread Ard Biesheuvel
Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig| 1 + arch/arm/crypto/sha2-ce-glue.c | 151 + 2 files changed, 33 insertions(+), 119 deletions(-) diff --git a/arch/arm/crypto/Kconfig b/arch/arm/crypto/Kconfig index 31ad19f18af2

[RFC PATCH 6/6] arm/crypto: accelerated SHA-512 using ARM generic ASM and NEON

2015-03-30 Thread Ard Biesheuvel
10241.412.982.56 8192 40961.412.712.59 8192 81921.513.512.69 Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig |8 + arch/arm/crypto/Makefile |8 +- arch/arm/crypto/sha512

[PATCH v2 02/14] crypto: sha256: implement base layer for SHA-256

2015-03-30 Thread Ard Biesheuvel
To reduce the number of copies of boilerplate code throughout the tree, this patch implements generic glue for the SHA-256 algorithm. This allows a specific arch or hardware implementation to only implement the special handling that it needs. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig

[RFC PATCH 4/6] crypto: sha256-generic: move to generic glue implementation

2015-03-30 Thread Ard Biesheuvel
This updates the generic SHA-256 implementation to use the new shared SHA-256 glue code. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig | 1 + crypto/sha256_generic.c | 131 +++- 2 files changed, 18 insertions(+), 114 deletions(-) diff

[PATCH v2 resend 05/14] crypto: sha256-generic: move to generic glue implementation

2015-03-30 Thread Ard Biesheuvel
This updates the generic SHA-256 implementation to use the new shared SHA-256 glue code. It also implements a .finup hook crypto_sha256_finup() and exports it to other modules. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig | 1 + crypto/sha256_generic.c | 139

[PATCH v2 resend 07/14] crypto/arm: move SHA-1 ARM asm implementation to base layer

2015-03-30 Thread Ard Biesheuvel
Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig | 1 + arch/arm/{include/asm => }/crypto/sha1.h | 3 + arch/arm/crypto/sha1_glue.c | 117 +++ 3 files changed, 28 insertions(+), 93 deletions(-) rename arch/arm/{include/

[PATCH v2 resend 03/14] crypto: sha1: implement base layer for SHA-1

2015-03-30 Thread Ard Biesheuvel
To reduce the number of copies of boilerplate code throughout the tree, this patch implements generic glue for the SHA-1 algorithm. This allows a specific arch or hardware implementation to only implement the special handling that it needs. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig

[PATCH v2 resend 04/14] crypto: sha512-generic: move to generic glue implementation

2015-03-30 Thread Ard Biesheuvel
This updated the generic SHA-512 implementation to use the generic shared SHA-512 glue code. It also implements a .finup hook crypto_sha512_finup() and exports it to other modules. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig | 1 + crypto/sha512_generic.c | 126

[PATCH v2 resend 01/14] crypto: sha512: implement base layer for SHA-512

2015-03-30 Thread Ard Biesheuvel
To reduce the number of copies of boilerplate code throughout the tree, this patch implements generic glue for the SHA-512 algorithm. This allows a specific arch or hardware implementation to only implement the special handling that it needs. Signed-off-by: Ard Biesheuvel --- crypto/Kconfig

  1   2   3   4   5   6   7   8   9   10   >