Skip to content

NH library and Adiantum cleanup

Eric Biggers linux-arm-kernel linux-crypto linux-kselftest 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/12lib/crypto: nh: Add NH libraryinclude/crypto/nh.h lib/crypto/Kconfig lib/crypto/Makefile +1 more+152 -00 replies
2/12lib/crypto: tests: Add KUnit tests for NHlib/crypto/tests/Kconfig lib/crypto/tests/Makefile lib/crypto/tests/nh-testvecs.h +2 more+390 -02 replies
3/12lib/crypto: arm/nh: Migrate optimized code into libraryarch/arm/crypto/Kconfig arch/arm/crypto/Makefile arch/arm/crypto/nhpoly1305-neon-glue.c +4 more+35 -920 replies
4/12lib/crypto: arm64/nh: Migrate optimized code into libraryarch/arm64/crypto/Kconfig arch/arm64/crypto/Makefile arch/arm64/crypto/nhpoly1305-neon-glue.c +4 more+37 -940 replies
5/12lib/crypto: x86/nh: Migrate optimized code into libraryarch/x86/crypto/Kconfig arch/x86/crypto/Makefile arch/x86/crypto/nhpoly1305-avx2-glue.c +6 more+49 -1900 replies
6/12crypto: adiantum - Convert to use NH librarycrypto/Kconfig crypto/adiantum.c crypto/testmgr.c+191 -1100 replies
7/12crypto: adiantum - Use scatter_walk API instead of sg_mitercrypto/adiantum.c+15 -180 replies
8/12crypto: adiantum - Use memcpy_{to,from}_sglist()crypto/adiantum.c+4 -41 reply
9/12crypto: adiantum - Drop support for asynchronous xchacha cipherscrypto/adiantum.c+70 -1040 replies
10/12crypto: nhpoly1305 - Remove crypto_shash supportcrypto/Kconfig crypto/Makefile crypto/nhpoly1305.c +1 more+0 -3361 reply
11/12crypto: testmgr - Remove nhpoly1305 testscrypto/testmgr.c crypto/testmgr.h+0 -13781 reply
12/12fscrypt: Drop obsolete recommendation to enable optimized NHPoly1305Documentation/filesystems/fscrypt.rst+0 -50 replies

Reviews trailers per patch

3 of 12 patches have a Reviewed-by or Acked-by.

PatchHerbert Xu
1/12
2/12
3/12
4/12
5/12
6/12
7/12
8/12A-b
9/12
10/12A-b
11/12A-b
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] NH library and Adiantum cleanup

This series can also be retrieved from:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git nh-lib-v1

This series removes the nhpoly1305 crypto_shash algorithm, which existed only to fit Adiantum hashing into the traditional Linux crypto API paradigm. It replaces it with an nh() library function, combined with code in the "adiantum" template that handles the Poly1305 step.

The result is simpler code. As usual, I've also fixed the issue where the architecture-optimized code was disabled by default.

I've also included some additional cleanups for the Adiantum code.

I'm planning to take this via libcrypto-next.

Eric Biggers (12):
lib/crypto: nh: Add NH library
lib/crypto: tests: Add KUnit tests for NH
lib/crypto: arm/nh: Migrate optimized code into library lib/crypto: arm64/nh: Migrate optimized code into library lib/crypto: x86/nh: Migrate optimized code into library
crypto: adiantum - Convert to use NH library
crypto: adiantum - Use scatter_walk API instead of sg_miter
crypto: adiantum - Use memcpy_{to,from}_sglist()
crypto: adiantum - Drop support for asynchronous xchacha ciphers
crypto: nhpoly1305 - Remove crypto_shash support
crypto: testmgr - Remove nhpoly1305 tests
fscrypt: Drop obsolete recommendation to enable optimized NHPoly1305

 Documentation/filesystems/fscrypt.rst         |    5 -
 arch/arm/crypto/Kconfig                       |   10 -
 arch/arm/crypto/Makefile                      |    2 -
 arch/arm/crypto/nhpoly1305-neon-glue.c        |   80 -
 arch/arm64/crypto/Kconfig                     |   10 -
 arch/arm64/crypto/Makefile                    |    3 -
 arch/arm64/crypto/nhpoly1305-neon-glue.c      |   79 -
 arch/x86/crypto/Kconfig                       |   20 -
 arch/x86/crypto/Makefile                      |    5 -
 arch/x86/crypto/nhpoly1305-avx2-glue.c        |   81 -
 arch/x86/crypto/nhpoly1305-sse2-glue.c        |   80 -
 crypto/Kconfig                                |    8 +-
 crypto/Makefile                               |    1 -
 crypto/adiantum.c                             |  442 +++---
 crypto/nhpoly1305.c                           |  255 ---
 crypto/testmgr.c                              |   10 +-
 crypto/testmgr.h                              | 1372 -----------------
 include/crypto/nh.h                           |   52 +
 include/crypto/nhpoly1305.h                   |   74 -
 lib/crypto/Kconfig                            |   13 +
 lib/crypto/Makefile                           |   11 +
 .../crypto => lib/crypto/arm}/nh-neon-core.S  |    0
 lib/crypto/arm/nh.h                           |   33 +
 .../crypto/arm64}/nh-neon-core.S              |    3 +-
 lib/crypto/arm64/nh.h                         |   34 +
 lib/crypto/nh.c                               |   82 +
 lib/crypto/tests/Kconfig                      |    8 +
 lib/crypto/tests/Makefile                     |    1 +
 lib/crypto/tests/nh-testvecs.h                |  298 ++++
 lib/crypto/tests/nh_kunit.c                   |   43 +
 .../crypto/x86/nh-avx2.S                      |    3 +-
 .../crypto/x86/nh-sse2.S                      |    3 +-
 lib/crypto/x86/nh.h                           |   45 +
 scripts/crypto/gen-hash-testvecs.py           |   40 +
 34 files changed, 909 insertions(+), 2297 deletions(-)
 delete mode 100644 arch/arm/crypto/nhpoly1305-neon-glue.c
 delete mode 100644 arch/arm64/crypto/nhpoly1305-neon-glue.c
 delete mode 100644 arch/x86/crypto/nhpoly1305-avx2-glue.c
 delete mode 100644 arch/x86/crypto/nhpoly1305-sse2-glue.c
 delete mode 100644 crypto/nhpoly1305.c
 create mode 100644 include/crypto/nh.h
 delete mode 100644 include/crypto/nhpoly1305.h
 rename {arch/arm/crypto => lib/crypto/arm}/nh-neon-core.S (100%)
 create mode 100644 lib/crypto/arm/nh.h
 rename {arch/arm64/crypto => lib/crypto/arm64}/nh-neon-core.S (97%)
 create mode 100644 lib/crypto/arm64/nh.h
 create mode 100644 lib/crypto/nh.c
 create mode 100644 lib/crypto/tests/nh-testvecs.h
 create mode 100644 lib/crypto/tests/nh_kunit.c
 rename arch/x86/crypto/nh-avx2-x86_64.S => lib/crypto/x86/nh-avx2.S (98%)
 rename arch/x86/crypto/nh-sse2-x86_64.S => lib/crypto/x86/nh-sse2.S (97%)
 create mode 100644 lib/crypto/x86/nh.h

base-commit: 0914d5848096af6496c7aa5e1ac051fcdb3f755b

Signature · 1 line
2.52.0