SHA-1 library functions
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest26 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/26 | crypto: x86/sha1 - Rename conflicting symbolarch/ | +5 | 0 replies | |
| 2/26 | lib/crypto: sha1: Rename sha1_init() to sha1_init_raw()include/ kernel/ lib/ +1 more | +6 | 0 replies | |
| 3/26 | lib/crypto: sha1: Add SHA-1 library functionsinclude/ lib/ lib/ +1 more | +183 | 2 replies | |
| 4/26 | lib/crypto: sha1: Add HMAC supportinclude/ lib/ | +222 | 0 replies | |
| 5/26 | crypto: sha1 - Wrap library and add HMAC supportcrypto/ crypto/ crypto/ +2 more | +143 | 0 replies | |
| 6/26 | crypto: sha1 - Use same state format as legacy driverscrypto/ | +66 | 0 replies | |
| 7/26 | lib/crypto: arm/sha1: Migrate optimized code into libraryarch/ arch/ arch/ +13 more | +60 | 0 replies | |
| 8/26 | lib/crypto: arm64/sha1: Migrate optimized code into libraryarch/ arch/ arch/ +5 more | +51 | 0 replies | |
| 9/26 | lib/crypto: mips/sha1: Migrate optimized code into libraryarch/ arch/ arch/ +3 more | +82 | 0 replies | |
| 10/26 | lib/crypto: powerpc/sha1: Migrate optimized code into libraryarch/ arch/ arch/ +9 more | +72 | 0 replies | |
| 11/26 | lib/crypto: s390/sha1: Migrate optimized code into libraryarch/ arch/ arch/ +4 more | +29 | 0 replies | |
| 12/26 | lib/crypto: sparc/sha1: Migrate optimized code into libraryarch/ arch/ arch/ +4 more | +45 | 0 replies | |
| 13/26 | lib/crypto: x86/sha1: Migrate optimized code into libraryarch/ arch/ arch/ +6 more | +95 | 0 replies | |
| 14/26 | crypto: sha1 - Remove sha1_base.hinclude/ | +0 | 0 replies | |
| 15/26 | lib/crypto: tests: Add KUnit tests for SHA-1 and HMAC-SHA1lib/ lib/ lib/ +1 more | +262 | 0 replies | |
| 16/26 | bpf: Use sha1() instead of sha1_transform() in bpf_prog_calc_tag()include/ kernel/ | +8 | 0 replies | |
| 17/26 | sctp: Use HMAC-SHA1 and HMAC-SHA256 library functionsinclude/ include/ include/ +3 more | +32 | 0 replies | |
| 18/26 | ipv6: sr: Use HMAC-SHA1 and HMAC-SHA256 library functionsinclude/ net/ net/ +1 more | +22 | 0 replies | |
| 19/26 | tee: Use SHA-1 library instead of crypto_shashdrivers/ drivers/ | +10 | 0 replies | |
| 20/26 | lib/digsig: Use SHA-1 library instead of crypto_shashlib/ lib/ | +7 | 0 replies | |
| 21/26 | drm/bridge: it6505: Use SHA-1 library instead of crypto_shashdrivers/ drivers/ | +3 | 0 replies | |
| 22/26 | nfc: s3fwrn5: Use SHA-1 library instead of crypto_shashdrivers/ drivers/ | +2 | 0 replies | |
| 23/26 | ppp: mppe: Use SHA-1 library instead of crypto_shashdrivers/ drivers/ | +20 | 0 replies | |
| 24/26 | KEYS: trusted_tpm1: Use SHA-1 library instead of crypto_shashsecurity/ security/ | +35 | 0 replies | |
| 25/26 | ipv6: Switch to higher-level SHA-1 functionsnet/ | +13 | 0 replies | |
| 26/26 | lib/crypto: sha1: Remove low-level functions from APIinclude/ lib/ | +17 | 0 replies |
Reviews trailers per patch
None of the 26 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Ard Biesheuvel |
|---|---|
| Series | R-b |
| 1/26 | |
| 2/26 | |
| 3/26 | |
| 4/26 | |
| 5/26 | |
| 6/26 | |
| 7/26 | |
| 8/26 | |
| 9/26 | |
| 10/26 | |
| 11/26 | |
| 12/26 | |
| 13/26 | |
| 14/26 | |
| 15/26 | |
| 16/26 | |
| 17/26 | |
| 18/26 | |
| 19/26 | |
| 20/26 | |
| 21/26 | |
| 22/26 | |
| 23/26 | |
| 24/26 | |
| 25/26 | |
| 26/26 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/26] SHA-1 library functions
This series is also available at:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git sha1-lib-v1
Patches 1-14 reorganize the kernel's SHA-1 code to be consistent with the way the SHA-2 code is now organized:
- Add SHA-1 and HMAC-SHA1 library functions.
- Make the SHA-1 (and HMAC-SHA1) library functions use the existing architecture-optimized SHA-1 code, which is moved into lib/crypto/.
- Reimplement the old-school crypto API's "sha1" and "hmac(sha1)" algorithms on top of the SHA-1 and HMAC-SHA1 library functions.
The diffstat for that part is:
65 files changed, 1052 insertions(+), 1582 deletions(-)
This hopefully should look quite boring and familiar by now, as essentially the same cleanup was already applied to SHA-2.
Patch 15 adds sha1_kunit.
Note that while SHA-1 is a legacy algorithm, it still has many in-kernel users for legacy protocols. So it's not like we'll be able to remove the SHA-1 code from the kernel anytime soon. And some of these users are currently having to jump through some *major* hoops to work around the limitations of the old-school crypto API. The library API greatly simplifies things, and it makes the SHA-1 code consistent with the SHA-2 code. So, IMO it's well worth doing this reorganization of the SHA-1 code, even though SHA-1 is a legacy algorithm.
To show this even more clearly, patches 16-26 convert various users to use the SHA-1 library API (or both SHA-1 and SHA-2, in the case of some users that use both algorithms). The diffstat for that part is:
27 files changed, 169 insertions(+), 903 deletions(-)
For 6.17, I'd like to take patches 1-15 at the most. Patches 16-26 would be for later, and I'll probably resend them individually later for subsystem maintainers to take.
Eric Biggers (26):
crypto: x86/sha1 - Rename conflicting symbol lib/crypto: sha1: Rename sha1_init() to sha1_init_raw() lib/crypto: sha1: Add SHA-1 library functions lib/crypto: sha1: Add HMAC support
crypto: sha1 - Wrap library and add HMAC support
crypto: sha1 - Use same state format as legacy drivers lib/crypto: arm/sha1: Migrate optimized code into library lib/crypto: arm64/sha1: Migrate optimized code into library lib/crypto: mips/sha1: Migrate optimized code into library lib/crypto: powerpc/sha1: Migrate optimized code into library lib/crypto: s390/sha1: Migrate optimized code into library lib/crypto: sparc/sha1: Migrate optimized code into library lib/crypto: x86/sha1: Migrate optimized code into library
crypto: sha1 - Remove sha1_base.h
lib/crypto: tests: Add KUnit tests for SHA-1 and HMAC-SHA1
bpf: Use sha1() instead of sha1_transform() in bpf_prog_calc_tag()
sctp: Use HMAC-SHA1 and HMAC-SHA256 library functions
ipv6: sr: Use HMAC-SHA1 and HMAC-SHA256 library functions
tee: Use SHA-1 library instead of crypto_shash lib/digsig: Use SHA-1 library instead of crypto_shash drm/bridge: it6505: Use SHA-1 library instead of crypto_shash
nfc: s3fwrn5: Use SHA-1 library instead of crypto_shash
ppp: mppe: Use SHA-1 library instead of crypto_shash
KEYS: trusted_tpm1: Use SHA-1 library instead of crypto_shash
ipv6: Switch to higher-level SHA-1 functions lib/crypto: sha1: Remove low-level functions from API
arch/arm/configs/exynos_defconfig | 1 -
arch/arm/configs/milbeaut_m10v_defconfig | 2 -
arch/arm/configs/multi_v7_defconfig | 2 -
arch/arm/configs/omap2plus_defconfig | 1 -
arch/arm/configs/pxa_defconfig | 1 -
arch/arm/crypto/Kconfig | 31 --
arch/arm/crypto/Makefile | 6 -
arch/arm/crypto/sha1-ce-glue.c | 72 ----
arch/arm/crypto/sha1_glue.c | 75 ----
arch/arm/crypto/sha1_neon_glue.c | 83 -----
arch/arm64/configs/defconfig | 1 -
arch/arm64/crypto/Kconfig | 11 -
arch/arm64/crypto/Makefile | 3 -
arch/arm64/crypto/sha1-ce-glue.c | 118 -------
arch/mips/cavium-octeon/crypto/Makefile | 1 -
arch/mips/cavium-octeon/crypto/octeon-sha1.c | 146 --------
arch/mips/configs/cavium_octeon_defconfig | 1 -
arch/mips/crypto/Kconfig | 10 -
arch/powerpc/configs/44x/akebono_defconfig | 1 -
arch/powerpc/configs/powernv_defconfig | 1 -
arch/powerpc/configs/ppc64_defconfig | 1 -
arch/powerpc/crypto/Kconfig | 16 -
arch/powerpc/crypto/Makefile | 4 -
arch/powerpc/crypto/sha1-spe-glue.c | 107 ------
arch/powerpc/crypto/sha1.c | 78 -----
arch/s390/configs/debug_defconfig | 1 -
arch/s390/configs/defconfig | 1 -
arch/s390/crypto/Kconfig | 10 -
arch/s390/crypto/Makefile | 1 -
arch/s390/crypto/sha1_s390.c | 103 ------
arch/sparc/crypto/Kconfig | 10 -
arch/sparc/crypto/Makefile | 2 -
arch/sparc/crypto/sha1_glue.c | 94 -----
arch/x86/crypto/Kconfig | 14 -
arch/x86/crypto/Makefile | 3 -
arch/x86/crypto/sha1_ssse3_glue.c | 324 ------------------
crypto/Makefile | 2 +-
crypto/sha1.c | 201 +++++++++++
crypto/sha1_generic.c | 87 -----
crypto/testmgr.c | 6 +
drivers/crypto/img-hash.c | 2 +-
drivers/gpu/drm/bridge/Kconfig | 3 +-
drivers/gpu/drm/bridge/ite-it6505.c | 33 +-
drivers/net/ppp/Kconfig | 3 +-
drivers/net/ppp/ppp_mppe.c | 109 +-----
drivers/nfc/s3fwrn5/Kconfig | 3 +-
drivers/nfc/s3fwrn5/firmware.c | 17 +-
drivers/tee/Kconfig | 3 +-
drivers/tee/tee_core.c | 55 +--
include/crypto/sha1.h | 186 +++++++++-
include/crypto/sha1_base.h | 82 -----
include/linux/filter.h | 6 -
include/net/sctp/auth.h | 12 +-
include/net/sctp/constants.h | 2 -
include/net/sctp/structs.h | 5 -
include/net/seg6_hmac.h | 12 -
kernel/bpf/core.c | 49 +--
lib/Kconfig | 3 +-
lib/crypto/Kconfig | 14 +
lib/crypto/Makefile | 23 +-
.../crypto/arm}/sha1-armv4-large.S | 0
.../crypto/arm}/sha1-armv7-neon.S | 13 +-
.../crypto => lib/crypto/arm}/sha1-ce-core.S | 4 +-
lib/crypto/arm/sha1.h | 46 +++
.../crypto/arm64}/sha1-ce-core.S | 40 +--
lib/crypto/arm64/sha1.h | 39 +++
lib/crypto/mips/sha1.h | 81 +++++
.../crypto/powerpc}/sha1-powerpc-asm.S | 0
.../crypto/powerpc}/sha1-spe-asm.S | 0
lib/crypto/powerpc/sha1.h | 67 ++++
lib/crypto/s390/sha1.h | 28 ++
lib/crypto/sha1.c | 267 ++++++++++++---
lib/crypto/sparc/sha1.h | 43 +++
.../crypto => lib/crypto/sparc}/sha1_asm.S | 0
lib/crypto/tests/Kconfig | 10 +
lib/crypto/tests/Makefile | 1 +
lib/crypto/tests/sha1-testvecs.h | 212 ++++++++++++
lib/crypto/tests/sha1_kunit.c | 39 +++
.../crypto/x86/sha1-avx2-asm.S | 7 +-
.../crypto/x86/sha1-ni-asm.S | 23 +-
.../crypto/x86/sha1-ssse3-and-avx.S | 13 +-
lib/crypto/x86/sha1.h | 75 ++++
lib/digsig.c | 46 +--
net/ipv6/Kconfig | 6 +-
net/ipv6/addrconf.c | 23 +-
net/ipv6/seg6.c | 7 -
net/ipv6/seg6_hmac.c | 199 ++---------
net/sctp/Kconfig | 15 +-
net/sctp/auth.c | 153 ++-------
net/sctp/socket.c | 10 -
security/keys/trusted-keys/Kconfig | 4 +-
security/keys/trusted-keys/trusted_tpm1.c | 221 ++----------
92 files changed, 1472 insertions(+), 2474 deletions(-)
delete mode 100644 arch/arm/crypto/sha1-ce-glue.c
delete mode 100644 arch/arm/crypto/sha1_glue.c
delete mode 100644 arch/arm/crypto/sha1_neon_glue.c
delete mode 100644 arch/arm64/crypto/sha1-ce-glue.c
delete mode 100644 arch/mips/cavium-octeon/crypto/octeon-sha1.c
delete mode 100644 arch/powerpc/crypto/sha1-spe-glue.c
delete mode 100644 arch/powerpc/crypto/sha1.c
delete mode 100644 arch/s390/crypto/sha1_s390.c
delete mode 100644 arch/sparc/crypto/sha1_glue.c
delete mode 100644 arch/x86/crypto/sha1_ssse3_glue.c
create mode 100644 crypto/sha1.c
delete mode 100644 crypto/sha1_generic.c
delete mode 100644 include/crypto/sha1_base.h
rename {arch/arm/crypto => lib/crypto/arm}/sha1-armv4-large.S (100%)
rename {arch/arm/crypto => lib/crypto/arm}/sha1-armv7-neon.S (98%)
rename {arch/arm/crypto => lib/crypto/arm}/sha1-ce-core.S (96%)
create mode 100644 lib/crypto/arm/sha1.h
rename {arch/arm64/crypto => lib/crypto/arm64}/sha1-ce-core.S (76%)
create mode 100644 lib/crypto/arm64/sha1.h
create mode 100644 lib/crypto/mips/sha1.h
rename {arch/powerpc/crypto => lib/crypto/powerpc}/sha1-powerpc-asm.S (100%)
rename {arch/powerpc/crypto => lib/crypto/powerpc}/sha1-spe-asm.S (100%)
create mode 100644 lib/crypto/powerpc/sha1.h
create mode 100644 lib/crypto/s390/sha1.h
create mode 100644 lib/crypto/sparc/sha1.h
rename {arch/sparc/crypto => lib/crypto/sparc}/sha1_asm.S (100%)
create mode 100644 lib/crypto/tests/sha1-testvecs.h
create mode 100644 lib/crypto/tests/sha1_kunit.c
rename arch/x86/crypto/sha1_avx2_x86_64_asm.S => lib/crypto/x86/sha1-avx2-asm.S (98%)
rename arch/x86/crypto/sha1_ni_asm.S => lib/crypto/x86/sha1-ni-asm.S (90%)
rename arch/x86/crypto/sha1_ssse3_asm.S => lib/crypto/x86/sha1-ssse3-and-avx.S (97%)
create mode 100644 lib/crypto/x86/sha1.hSignature · 1 line
2.50.1