Skip to content

ChaCha and BLAKE2s cleanups

Eric Biggers linux-arm-kernel linux-crypto lkml 1 version Applied

Status from this message: Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-next

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 6 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/12arm: configs: Remove obsolete assignments to CRYPTO_CHACHA20_NEONarch/arm/configs/exynos_defconfig arch/arm/configs/milbeaut_m10v_defconfig arch/arm/configs/multi_v7_defconfig +1 more+0 -40 replies
2/12crypto: chacha - register only "-lib" driverscrypto/Kconfig crypto/chacha.c crypto/testmgr.c+29 -1100 replies
3/12lib/crypto: chacha: Remove unused function chacha_is_arch_optimized()include/crypto/chacha.h lib/crypto/arm/chacha-glue.c lib/crypto/arm64/chacha-neon-glue.c +5 more+0 -520 replies
4/12lib/crypto: chacha: Rename chacha.c to chacha-block-generic.clib/crypto/Makefile lib/crypto/chacha-block-generic.c+2 -20 replies
5/12lib/crypto: chacha: Rename libchacha.c to chacha.clib/crypto/Makefile lib/crypto/chacha.c+1 -00 replies
6/12lib/crypto: chacha: Consolidate into single moduleinclude/crypto/chacha.h lib/crypto/Kconfig lib/crypto/Makefile +22 more+126 -2890 replies
7/12lib/crypto: x86/blake2s: Reduce size of BLAKE2S_SIGMA2lib/crypto/x86/blake2s-core.S+14 -140 replies
8/12lib/crypto: blake2s: Remove obsolete self-testinclude/crypto/internal/blake2s.h lib/crypto/Makefile lib/crypto/blake2s-selftest.c +1 more+0 -6640 replies
9/12lib/crypto: blake2s: Always enable arch-optimized BLAKE2s codelib/crypto/arm/Kconfig lib/crypto/x86/Kconfig+2 -24 replies
10/12lib/crypto: blake2s: Move generic code into blake2s.clib/crypto/Makefile lib/crypto/blake2s-generic.c lib/crypto/blake2s.c+94 -1120 replies
11/12lib/crypto: blake2s: Consolidate into single C translation unitinclude/crypto/internal/blake2s.h lib/crypto/Kconfig lib/crypto/Makefile +9 more+47 -1110 replies
12/12lib/crypto: tests: Add KUnit tests for BLAKE2slib/crypto/tests/Kconfig lib/crypto/tests/Makefile lib/crypto/tests/blake2s-testvecs.h +2 more+407 -30 replies

Reviews trailers per patch

None of the 12 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchArd Biesheuvel
SeriesR-b
1/12
2/12
3/12
4/12
5/12
6/12
7/12
8/12
9/12
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/12] ChaCha and BLAKE2s cleanups

This series is targeting libcrypto-next. It can also be retrieved from:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git chacha-blake2s-v1

This series consolidates how the ChaCha and BLAKE2s code is organized. This is essentially the same change that I made to the other algorithms, so this should be fairly boring by now.

These algorithms were the last two users of lib/crypto/$(SRCARCH)/{Makefile,Kconfig}. So this series removes all those files, finishing the transition to the centralized build process (at least for the algorithms supported by lib/crypto/ so far).

This series also makes the arch-optimized BLAKE2s code start being enabled by default, again following the pattern of the other algorithms.

Finally, it adds a KUnit test suite for BLAKE2s and deletes the older blake2s-selftest.

Eric Biggers (12):
arm: configs: Remove obsolete assignments to CRYPTO_CHACHA20_NEON
crypto: chacha - register only "-lib" drivers
lib/crypto: chacha: Remove unused function chacha_is_arch_optimized() lib/crypto: chacha: Rename chacha.c to chacha-block-generic.c lib/crypto: chacha: Rename libchacha.c to chacha.c lib/crypto: chacha: Consolidate into single module lib/crypto: x86/blake2s: Reduce size of BLAKE2S_SIGMA2 lib/crypto: blake2s: Remove obsolete self-test
lib/crypto: blake2s: Always enable arch-optimized BLAKE2s code lib/crypto: blake2s: Move generic code into blake2s.c lib/crypto: blake2s: Consolidate into single C translation unit lib/crypto: tests: Add KUnit tests for BLAKE2s

 arch/arm/configs/exynos_defconfig             |   1 -
 arch/arm/configs/milbeaut_m10v_defconfig      |   1 -
 arch/arm/configs/multi_v7_defconfig           |   1 -
 arch/arm/configs/omap2plus_defconfig          |   1 -
 crypto/Kconfig                                |   1 -
 crypto/chacha.c                               | 129 +---
 crypto/testmgr.c                              |   9 +-
 include/crypto/chacha.h                       |  37 +-
 include/crypto/internal/blake2s.h             |  21 -
 lib/crypto/Kconfig                            |  74 +-
 lib/crypto/Makefile                           |  57 +-
 lib/crypto/arm/Kconfig                        |  19 -
 lib/crypto/arm/Makefile                       |   8 -
 lib/crypto/arm/blake2s-core.S                 |   5 +-
 lib/crypto/arm/blake2s-glue.c                 |   7 -
 lib/crypto/arm/blake2s.h                      |   5 +
 lib/crypto/arm/{chacha-glue.c => chacha.h}    |  35 +-
 lib/crypto/arm64/Kconfig                      |   8 -
 lib/crypto/arm64/Makefile                     |   4 -
 .../arm64/{chacha-neon-glue.c => chacha.h}    |  32 +-
 lib/crypto/blake2s-generic.c                  | 111 ---
 lib/crypto/blake2s-selftest.c                 | 651 ------------------
 lib/crypto/blake2s.c                          | 105 ++-
 lib/crypto/chacha-block-generic.c             | 114 +++
 lib/crypto/chacha.c                           | 142 ++--
 lib/crypto/libchacha.c                        |  35 -
 lib/crypto/mips/Kconfig                       |   7 -
 lib/crypto/mips/Makefile                      |   5 -
 lib/crypto/mips/chacha-glue.c                 |  29 -
 lib/crypto/mips/chacha.h                      |  14 +
 lib/crypto/powerpc/Kconfig                    |   8 -
 lib/crypto/powerpc/Makefile                   |   4 -
 .../powerpc/{chacha-p10-glue.c => chacha.h}   |  36 +-
 lib/crypto/riscv/Kconfig                      |   8 -
 lib/crypto/riscv/Makefile                     |   4 -
 .../riscv/{chacha-riscv64-glue.c => chacha.h} |  36 +-
 lib/crypto/s390/Kconfig                       |   7 -
 lib/crypto/s390/Makefile                      |   4 -
 lib/crypto/s390/{chacha-glue.c => chacha.h}   |  29 +-
 lib/crypto/tests/Kconfig                      |  10 +
 lib/crypto/tests/Makefile                     |   1 +
 lib/crypto/tests/blake2s-testvecs.h           | 238 +++++++
 lib/crypto/tests/blake2s_kunit.c              | 134 ++++
 lib/crypto/x86/Kconfig                        |  20 -
 lib/crypto/x86/Makefile                       |   7 -
 lib/crypto/x86/blake2s-core.S                 |  28 +-
 lib/crypto/x86/{blake2s-glue.c => blake2s.h}  |  16 +-
 lib/crypto/x86/{chacha_glue.c => chacha.h}    |  36 +-
 scripts/crypto/gen-hash-testvecs.py           |  27 +-
 49 files changed, 840 insertions(+), 1481 deletions(-)
 delete mode 100644 include/crypto/internal/blake2s.h
 delete mode 100644 lib/crypto/arm/Kconfig
 delete mode 100644 lib/crypto/arm/Makefile
 delete mode 100644 lib/crypto/arm/blake2s-glue.c
 create mode 100644 lib/crypto/arm/blake2s.h
 rename lib/crypto/arm/{chacha-glue.c => chacha.h} (76%)
 delete mode 100644 lib/crypto/arm64/Kconfig
 delete mode 100644 lib/crypto/arm64/Makefile
 rename lib/crypto/arm64/{chacha-neon-glue.c => chacha.h} (75%)
 delete mode 100644 lib/crypto/blake2s-generic.c
 delete mode 100644 lib/crypto/blake2s-selftest.c
 create mode 100644 lib/crypto/chacha-block-generic.c
 delete mode 100644 lib/crypto/libchacha.c
 delete mode 100644 lib/crypto/mips/Kconfig
 delete mode 100644 lib/crypto/mips/Makefile
 delete mode 100644 lib/crypto/mips/chacha-glue.c
 create mode 100644 lib/crypto/mips/chacha.h
 delete mode 100644 lib/crypto/powerpc/Kconfig
 delete mode 100644 lib/crypto/powerpc/Makefile
 rename lib/crypto/powerpc/{chacha-p10-glue.c => chacha.h} (62%)
 delete mode 100644 lib/crypto/riscv/Kconfig
 delete mode 100644 lib/crypto/riscv/Makefile
 rename lib/crypto/riscv/{chacha-riscv64-glue.c => chacha.h} (57%)
 delete mode 100644 lib/crypto/s390/Kconfig
 delete mode 100644 lib/crypto/s390/Makefile
 rename lib/crypto/s390/{chacha-glue.c => chacha.h} (51%)
 create mode 100644 lib/crypto/tests/blake2s-testvecs.h
 create mode 100644 lib/crypto/tests/blake2s_kunit.c
 delete mode 100644 lib/crypto/x86/Kconfig
 delete mode 100644 lib/crypto/x86/Makefile
 rename lib/crypto/x86/{blake2s-glue.c => blake2s.h} (83%)
 rename lib/crypto/x86/{chacha_glue.c => chacha.h} (85%)

base-commit: 44781c45f26623c3b92b28e933bf349144c10fe6

Signature · 1 line
2.50.1