From: Eric Biggers <ebiggers@kernel.org>
To: linux-crypto@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
Ard Biesheuvel <ardb@kernel.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
David Sterba <dsterba@suse.com>,
"Jason A . Donenfeld" <Jason@zx2c4.com>,
Paul Crowley <paulcrowley@google.com>
Subject: [PATCH v3 00/14] crypto: arm32-optimized BLAKE2b and BLAKE2s
Date: Wed, 23 Dec 2020 00:09:49 -0800 [thread overview]
Message-ID: <20201223081003.373663-1-ebiggers@kernel.org> (raw)
This patchset adds 32-bit ARM assembly language implementations of
BLAKE2b and BLAKE2s.
As a prerequisite to adding these without copy-and-pasting lots of code,
this patchset also reworks the existing BLAKE2b and BLAKE2s code to
provide helper functions that make implementing "shash" providers for
these algorithms much easier. These changes also eliminate unnecessary
differences between the BLAKE2b and BLAKE2s code.
The new BLAKE2b implementation is NEON-accelerated, while the new
BLAKE2s implementation uses scalar instructions since NEON doesn't work
very well for it. The BLAKE2b implementation is faster and is expected
to be useful as a replacement for SHA-1 in dm-verity, while the BLAKE2s
implementation would be useful for WireGuard which uses BLAKE2s.
Both new implementations are wired up to the shash API, while the new
BLAKE2s implementation is also wired up to the library API.
See the individual commits for full details, including benchmarks.
This patchset was tested on a Raspberry Pi 2 (which uses a Cortex-A7
processor) with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y, plus other tests.
This patchset applies to mainline commit 614cb5894306.
Changed since v2:
- Reworked the shash helpers again. Now they are inline functions,
and for BLAKE2s they now share more code with the library API.
- Made the BLAKE2b code be more consistent with the BLAKE2s code.
- Moved the BLAKE2s changes first in the patchset so that the BLAKE2b
changes can be made just by syncing the code with BLAKE2s.
- Added a few BLAKE2s cleanups (which get included in BLAKE2b too).
- Improved some comments in the new asm files.
Changed since v1:
- Added ARM scalar implementation of BLAKE2s.
- Adjusted the BLAKE2b helper functions to be consistent with what I
decided to do for BLAKE2s.
- Fixed build error in blake2b-neon-core.S in some configurations.
Eric Biggers (14):
crypto: blake2s - define shash_alg structs using macros
crypto: x86/blake2s - define shash_alg structs using macros
crypto: blake2s - remove unneeded includes
crypto: blake2s - move update and final logic to internal/blake2s.h
crypto: blake2s - share the "shash" API boilerplate code
crypto: blake2s - optimize blake2s initialization
crypto: blake2s - add comment for blake2s_state fields
crypto: blake2s - adjust include guard naming
crypto: blake2s - include <linux/bug.h> instead of <asm/bug.h>
crypto: arm/blake2s - add ARM scalar optimized BLAKE2s
wireguard: Kconfig: select CRYPTO_BLAKE2S_ARM
crypto: blake2b - sync with blake2s implementation
crypto: blake2b - update file comment
crypto: arm/blake2b - add NEON-accelerated BLAKE2b
arch/arm/crypto/Kconfig | 19 ++
arch/arm/crypto/Makefile | 4 +
arch/arm/crypto/blake2b-neon-core.S | 347 ++++++++++++++++++++++++++++
arch/arm/crypto/blake2b-neon-glue.c | 105 +++++++++
arch/arm/crypto/blake2s-core.S | 285 +++++++++++++++++++++++
arch/arm/crypto/blake2s-glue.c | 78 +++++++
arch/x86/crypto/blake2s-glue.c | 150 +++---------
crypto/blake2b_generic.c | 249 +++++---------------
crypto/blake2s_generic.c | 158 +++----------
drivers/net/Kconfig | 1 +
include/crypto/blake2b.h | 67 ++++++
include/crypto/blake2s.h | 63 ++---
include/crypto/internal/blake2b.h | 115 +++++++++
include/crypto/internal/blake2s.h | 109 ++++++++-
lib/crypto/blake2s.c | 48 +---
15 files changed, 1278 insertions(+), 520 deletions(-)
create mode 100644 arch/arm/crypto/blake2b-neon-core.S
create mode 100644 arch/arm/crypto/blake2b-neon-glue.c
create mode 100644 arch/arm/crypto/blake2s-core.S
create mode 100644 arch/arm/crypto/blake2s-glue.c
create mode 100644 include/crypto/blake2b.h
create mode 100644 include/crypto/internal/blake2b.h
base-commit: 614cb5894306cfa2c7d9b6168182876ff5948735
--
2.29.2
WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers@kernel.org>
To: linux-crypto@vger.kernel.org
Cc: "Jason A . Donenfeld" <Jason@zx2c4.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
David Sterba <dsterba@suse.com>, Ard Biesheuvel <ardb@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Paul Crowley <paulcrowley@google.com>
Subject: [PATCH v3 00/14] crypto: arm32-optimized BLAKE2b and BLAKE2s
Date: Wed, 23 Dec 2020 00:09:49 -0800 [thread overview]
Message-ID: <20201223081003.373663-1-ebiggers@kernel.org> (raw)
This patchset adds 32-bit ARM assembly language implementations of
BLAKE2b and BLAKE2s.
As a prerequisite to adding these without copy-and-pasting lots of code,
this patchset also reworks the existing BLAKE2b and BLAKE2s code to
provide helper functions that make implementing "shash" providers for
these algorithms much easier. These changes also eliminate unnecessary
differences between the BLAKE2b and BLAKE2s code.
The new BLAKE2b implementation is NEON-accelerated, while the new
BLAKE2s implementation uses scalar instructions since NEON doesn't work
very well for it. The BLAKE2b implementation is faster and is expected
to be useful as a replacement for SHA-1 in dm-verity, while the BLAKE2s
implementation would be useful for WireGuard which uses BLAKE2s.
Both new implementations are wired up to the shash API, while the new
BLAKE2s implementation is also wired up to the library API.
See the individual commits for full details, including benchmarks.
This patchset was tested on a Raspberry Pi 2 (which uses a Cortex-A7
processor) with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y, plus other tests.
This patchset applies to mainline commit 614cb5894306.
Changed since v2:
- Reworked the shash helpers again. Now they are inline functions,
and for BLAKE2s they now share more code with the library API.
- Made the BLAKE2b code be more consistent with the BLAKE2s code.
- Moved the BLAKE2s changes first in the patchset so that the BLAKE2b
changes can be made just by syncing the code with BLAKE2s.
- Added a few BLAKE2s cleanups (which get included in BLAKE2b too).
- Improved some comments in the new asm files.
Changed since v1:
- Added ARM scalar implementation of BLAKE2s.
- Adjusted the BLAKE2b helper functions to be consistent with what I
decided to do for BLAKE2s.
- Fixed build error in blake2b-neon-core.S in some configurations.
Eric Biggers (14):
crypto: blake2s - define shash_alg structs using macros
crypto: x86/blake2s - define shash_alg structs using macros
crypto: blake2s - remove unneeded includes
crypto: blake2s - move update and final logic to internal/blake2s.h
crypto: blake2s - share the "shash" API boilerplate code
crypto: blake2s - optimize blake2s initialization
crypto: blake2s - add comment for blake2s_state fields
crypto: blake2s - adjust include guard naming
crypto: blake2s - include <linux/bug.h> instead of <asm/bug.h>
crypto: arm/blake2s - add ARM scalar optimized BLAKE2s
wireguard: Kconfig: select CRYPTO_BLAKE2S_ARM
crypto: blake2b - sync with blake2s implementation
crypto: blake2b - update file comment
crypto: arm/blake2b - add NEON-accelerated BLAKE2b
arch/arm/crypto/Kconfig | 19 ++
arch/arm/crypto/Makefile | 4 +
arch/arm/crypto/blake2b-neon-core.S | 347 ++++++++++++++++++++++++++++
arch/arm/crypto/blake2b-neon-glue.c | 105 +++++++++
arch/arm/crypto/blake2s-core.S | 285 +++++++++++++++++++++++
arch/arm/crypto/blake2s-glue.c | 78 +++++++
arch/x86/crypto/blake2s-glue.c | 150 +++---------
crypto/blake2b_generic.c | 249 +++++---------------
crypto/blake2s_generic.c | 158 +++----------
drivers/net/Kconfig | 1 +
include/crypto/blake2b.h | 67 ++++++
include/crypto/blake2s.h | 63 ++---
include/crypto/internal/blake2b.h | 115 +++++++++
include/crypto/internal/blake2s.h | 109 ++++++++-
lib/crypto/blake2s.c | 48 +---
15 files changed, 1278 insertions(+), 520 deletions(-)
create mode 100644 arch/arm/crypto/blake2b-neon-core.S
create mode 100644 arch/arm/crypto/blake2b-neon-glue.c
create mode 100644 arch/arm/crypto/blake2s-core.S
create mode 100644 arch/arm/crypto/blake2s-glue.c
create mode 100644 include/crypto/blake2b.h
create mode 100644 include/crypto/internal/blake2b.h
base-commit: 614cb5894306cfa2c7d9b6168182876ff5948735
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2020-12-23 8:13 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-23 8:09 Eric Biggers [this message]
2020-12-23 8:09 ` [PATCH v3 00/14] crypto: arm32-optimized BLAKE2b and BLAKE2s Eric Biggers
2020-12-23 8:09 ` [PATCH v3 01/14] crypto: blake2s - define shash_alg structs using macros Eric Biggers
2020-12-23 8:09 ` Eric Biggers
2020-12-23 8:09 ` [PATCH v3 02/14] crypto: x86/blake2s " Eric Biggers
2020-12-23 8:09 ` Eric Biggers
2020-12-23 8:09 ` [PATCH v3 03/14] crypto: blake2s - remove unneeded includes Eric Biggers
2020-12-23 8:09 ` Eric Biggers
2020-12-23 8:09 ` [PATCH v3 04/14] crypto: blake2s - move update and final logic to internal/blake2s.h Eric Biggers
2020-12-23 8:09 ` Eric Biggers
2020-12-23 9:05 ` Ard Biesheuvel
2020-12-23 9:05 ` Ard Biesheuvel
2020-12-23 8:09 ` [PATCH v3 05/14] crypto: blake2s - share the "shash" API boilerplate code Eric Biggers
2020-12-23 8:09 ` Eric Biggers
2020-12-23 9:06 ` Ard Biesheuvel
2020-12-23 9:06 ` Ard Biesheuvel
2020-12-23 8:09 ` [PATCH v3 06/14] crypto: blake2s - optimize blake2s initialization Eric Biggers
2020-12-23 8:09 ` Eric Biggers
2020-12-23 9:06 ` Ard Biesheuvel
2020-12-23 9:06 ` Ard Biesheuvel
2020-12-23 8:09 ` [PATCH v3 07/14] crypto: blake2s - add comment for blake2s_state fields Eric Biggers
2020-12-23 8:09 ` Eric Biggers
2020-12-23 9:07 ` Ard Biesheuvel
2020-12-23 9:07 ` Ard Biesheuvel
2020-12-23 8:09 ` [PATCH v3 08/14] crypto: blake2s - adjust include guard naming Eric Biggers
2020-12-23 8:09 ` Eric Biggers
2020-12-23 9:07 ` Ard Biesheuvel
2020-12-23 9:07 ` Ard Biesheuvel
2020-12-23 8:09 ` [PATCH v3 09/14] crypto: blake2s - include <linux/bug.h> instead of <asm/bug.h> Eric Biggers
2020-12-23 8:09 ` Eric Biggers
2020-12-23 9:07 ` Ard Biesheuvel
2020-12-23 9:07 ` Ard Biesheuvel
2020-12-23 8:09 ` [PATCH v3 10/14] crypto: arm/blake2s - add ARM scalar optimized BLAKE2s Eric Biggers
2020-12-23 8:09 ` Eric Biggers
2020-12-23 9:08 ` Ard Biesheuvel
2020-12-23 9:08 ` Ard Biesheuvel
2020-12-23 8:10 ` [PATCH v3 11/14] wireguard: Kconfig: select CRYPTO_BLAKE2S_ARM Eric Biggers
2020-12-23 8:10 ` Eric Biggers
2020-12-23 8:10 ` [PATCH v3 12/14] crypto: blake2b - sync with blake2s implementation Eric Biggers
2020-12-23 8:10 ` Eric Biggers
2020-12-23 9:09 ` Ard Biesheuvel
2020-12-23 9:09 ` Ard Biesheuvel
2020-12-23 8:10 ` [PATCH v3 13/14] crypto: blake2b - update file comment Eric Biggers
2020-12-23 8:10 ` Eric Biggers
2020-12-23 8:10 ` [PATCH v3 14/14] crypto: arm/blake2b - add NEON-accelerated BLAKE2b Eric Biggers
2020-12-23 8:10 ` Eric Biggers
2020-12-23 9:10 ` Ard Biesheuvel
2020-12-23 9:10 ` Ard Biesheuvel
2021-01-02 22:09 ` [PATCH v3 00/14] crypto: arm32-optimized BLAKE2b and BLAKE2s Herbert Xu
2021-01-02 22:09 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201223081003.373663-1-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=Jason@zx2c4.com \
--cc=ardb@kernel.org \
--cc=dsterba@suse.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=paulcrowley@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.