[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/arm6

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

2014-05-14 Thread Ard Biesheuvel
The Crypto Extensions based GHASH implementation uses the NEON register file, and hence runs with preemption disabled. This patch adds a TIF_NEED_RESCHED check to its inner loop so we at least give up the CPU voluntarily when we are running in process context and have been tagged for preemption by

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

2014-05-14 Thread Ard Biesheuvel
The Crypto Extensions based SHA2 implementation uses the NEON register file, and hence runs with preemption disabled. This patch adds a TIF_NEED_RESCHED check to its inner loop so we at least give up the CPU voluntarily when we are running in process context and have been tagged for preemption by t

[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/crypto

[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 + ar

[PATCH v2 00/11] arm64 crypto roundup

2014-05-14 Thread Ard Biesheuvel
This is another repost of the arm64 crypto patches, this time I have only included the ones that go under arch/arm64/crypto. Changes wrt previous version: - updated the voluntary preemption patches to test for CRYPTO_TFM_REQ_MAY_SLEEP instead of !in_interrupt() - added Herbert's ack All patches

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

2014-05-14 Thread Ard Biesheuvel
The Crypto Extensions based SHA1 implementation uses the NEON register file, and hence runs with preemption disabled. This patch adds a TIF_NEED_RESCHED check to its inner loop so we at least give up the CPU voluntarily when we are running in process context and have been tagged for preemption by t

[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/c

[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/arm64/include/

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

2014-05-14 Thread Ard Biesheuvel
This adds ARMv8 implementations of AES in ECB, CBC, CTR and XTS modes, both for ARMv8 with Crypto Extensions and for plain ARMv8 NEON. The Crypto Extensions version can only run on ARMv8 implementations that have support for these optional extensions. The plain NEON version is a table based yet t

[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 @@ -40,

[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:

Re: [PATCH 2/6] crypto: SHA1 multibuffer crypto hash infrastructure

2014-05-14 Thread Tim Chen
On Wed, 2014-05-14 at 08:10 +0800, Herbert Xu wrote: > On Tue, May 13, 2014 at 04:19:45PM -0700, Tim Chen wrote: > > > > diff --git a/crypto/shash.c b/crypto/shash.c > > index 929058a..6f40424 100644 > > --- a/crypto/shash.c > > +++ b/crypto/shash.c > > @@ -229,6 +229,42 @@ int shash_ahash_update(s

[PATCH] [RFC] crypto: cesa: Don't use tfm->__crt_alg->cra_type directly

2014-05-14 Thread Marek Vasut
The checking for the type of algorithm implementation is pretty strange here. Use regular flags to check for the type instead. Signed-off-by: Marek Vasut Cc: Bill Pemberton Cc: Herbert Xu Cc: Kent Yoder Cc: Jamie Iles Cc: Phil Sutter --- drivers/crypto/mv_cesa.c | 4 ++-- 1 file changed, 2

[PATCH 6/7] crypto: padlock: Don't use tfm->__crt_alg->cra_name directly

2014-05-14 Thread Marek Vasut
Signed-off-by: Marek Vasut --- drivers/crypto/padlock-sha.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) NOTE: I didn't compile-test those, but the change should not break anything. If possible, please test on relevant hardware. diff --git a/drivers/crypto/padlock-sha.c b/drivers

[PATCH 2/7] crypto: ccp: Don't use tfm->__crt_alg->cra_name directly

2014-05-14 Thread Marek Vasut
Signed-off-by: Marek Vasut --- drivers/crypto/ccp/ccp-crypto-aes-xts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) NOTE: I didn't compile-test those, but the change should not break anything. If possible, please test on relevant hardware. diff --git a/drivers/crypto/ccp/ccp-

[PATCH 4/7] crypto: dcp: Don't use tfm->__crt_alg->cra_name directly

2014-05-14 Thread Marek Vasut
Signed-off-by: Marek Vasut --- drivers/crypto/mxs-dcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) NOTE: I didn't compile-test those, but the change should not break anything. If possible, please test on relevant hardware. diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/

[PATCH 5/7] crypto: n2: Don't use tfm->__crt_alg->cra_name directly

2014-05-14 Thread Marek Vasut
Signed-off-by: Marek Vasut --- drivers/crypto/n2_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) NOTE: I didn't compile-test those, but the change should not break anything. If possible, please test on relevant hardware. diff --git a/drivers/crypto/n2_core.c b/drivers/cry

[PATCH 7/7] crypto: sahara: Don't use tfm->__crt_alg->cra_name directly

2014-05-14 Thread Marek Vasut
Signed-off-by: Marek Vasut --- drivers/crypto/sahara.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) NOTE: I didn't compile-test those, but the change should not break anything. If possible, please test on relevant hardware. diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sa

[PATCH 1/7] crypto: geode: Don't use tfm->__crt_alg->cra_name directly

2014-05-14 Thread Marek Vasut
Use a standard accessor instead of directly digging into a structure. Signed-off-by: Marek Vasut --- drivers/crypto/geode-aes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) NOTE: I didn't compile-test those, but the change should not break anything. If possible, please test o

[PATCH 3/7] crypto: cesa: Don't use tfm->__crt_alg->cra_name directly

2014-05-14 Thread Marek Vasut
Signed-off-by: Marek Vasut --- drivers/crypto/mv_cesa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) NOTE: I didn't compile-test those, but the change should not break anything. If possible, please test on relevant hardware. diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/

[PATCH 4/4] crypto: geode: Weed out printk() from probe()

2014-05-14 Thread Marek Vasut
Signed-off-by: Marek Vasut Cc: Benjamin Herrenschmidt Cc: Dmitry Kasatkin Cc: Eric Bénard Cc: Jussi Kivilinna Cc: Kent Yoder Cc: Michal Ludvig Cc: Varun Wadekar Cc: Vladimir Zapolskiy Cc: linux-ge...@lists.infradead.org --- drivers/crypto/geode-aes.c | 4 ++-- 1 file changed, 2 insertions

[PATCH 3/4] crypto: geode: Consistently use AES_KEYSIZE_128

2014-05-14 Thread Marek Vasut
Consistently use AES_KEYSIZE_128 instead of arbitrary defined value. Signed-off-by: Marek Vasut Cc: Benjamin Herrenschmidt Cc: Dmitry Kasatkin Cc: Eric Bénard Cc: Jussi Kivilinna Cc: Kent Yoder Cc: Michal Ludvig Cc: Varun Wadekar Cc: Vladimir Zapolskiy Cc: linux-ge...@lists.infradead.org

[PATCH 1/4] crypto: geode: Kill AES_MIN_BLOCK_SIZE

2014-05-14 Thread Marek Vasut
This is actually defined in include/crypto/aes.h , no need to have a a different symbol for the same thing twice. Signed-off-by: Marek Vasut Cc: Benjamin Herrenschmidt Cc: Dmitry Kasatkin Cc: Eric Bénard Cc: Jussi Kivilinna Cc: Kent Yoder Cc: Michal Ludvig Cc: Varun Wadekar Cc: Vladimir Za

[PATCH 2/4] crypto: geode: Kill AES_IV_LENGTH

2014-05-14 Thread Marek Vasut
The AES IV length is always 128bits, just use the define from aes.h Signed-off-by: Marek Vasut Cc: Benjamin Herrenschmidt Cc: Dmitry Kasatkin Cc: Eric Bénard Cc: Jussi Kivilinna Cc: Kent Yoder Cc: Michal Ludvig Cc: Varun Wadekar Cc: Vladimir Zapolskiy Cc: linux-ge...@lists.infradead.org -

Re: [PATCH resend 00/15] arm64 crypto roundup

2014-05-14 Thread Catalin Marinas
On Wed, May 14, 2014 at 02:29:05AM +0100, Herbert Xu wrote: > On Fri, May 09, 2014 at 08:37:58AM +0200, Ard Biesheuvel wrote: > > > > @Herbert, Jussi: care to share your opinion on the SHAx, GHASH and AES > > patches above? Herbert has already acked the ccm patch, but Catalin is > > requesting for

Re: ahash vs. shash

2014-05-14 Thread Dmitry Kasatkin
On 14 May 2014 04:39, Herbert Xu wrote: > Dmitry Kasatkin wrote: >> Hi, >> >> ahash allows to use HW acceleration, but usually it comes at a cost of >> additional HW related configuration overhead, such as configuring hash >> module, DMA, etc. For that reason hashing small chucks of data is >> fa