Skip to content

POLYVAL library

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 Latest9 patches 6 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/9crypto: polyval - Rename conflicting functionscrypto/polyval-generic.c+6 -60 replies
2/9lib/crypto: polyval: Add POLYVAL libraryinclude/crypto/polyval.h lib/crypto/Kconfig lib/crypto/Makefile +1 more+493 -34 replies
3/9lib/crypto: tests: Add KUnit tests for POLYVALlib/crypto/tests/Kconfig lib/crypto/tests/Makefile lib/crypto/tests/polyval-testvecs.h +2 more+464 -20 replies
4/9lib/crypto: arm64/polyval: Migrate optimized code into libraryarch/arm64/crypto/Kconfig arch/arm64/crypto/Makefile arch/arm64/crypto/polyval-ce-glue.c +5 more+110 -1910 replies
5/9lib/crypto: x86/polyval: Migrate optimized code into libraryarch/x86/crypto/Kconfig arch/x86/crypto/Makefile arch/x86/crypto/polyval-clmulni_glue.c +5 more+107 -2140 replies
6/9crypto: hctr2 - Convert to use POLYVAL librarycrypto/Kconfig crypto/hctr2.c crypto/testmgr.c+66 -1650 replies
7/9crypto: polyval - Remove the polyval crypto_shashcrypto/Kconfig crypto/Makefile crypto/polyval-generic.c+0 -2160 replies
8/9crypto: testmgr - Remove polyval testscrypto/tcrypt.c crypto/testmgr.c crypto/testmgr.h+0 -1810 replies
9/9fscrypt: Drop obsolete recommendation to enable optimized POLYVALDocumentation/filesystems/fscrypt.rst+0 -20 replies

Reviews trailers per patch

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

PatchArd Biesheuvel
SeriesR-b
1/9
2/9R-b T-b
3/9
4/9
5/9
6/9
7/9
8/9
9/9

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 0/9] POLYVAL library

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 polyval-lib-v1

This series migrates the POLYVAL code to lib/crypto/. It turns out that just like Poly1305, the library is a much better fit for it.

This series also replaces the generic implementation of POLYVAL with a much better one.

Notably, this series improves the performance of HCTR2, since it eliminates unnecessary overhead that was being incurred by accessing POLYVAL via the crypto_shash API. I see a 45% increase in throughput with 64-byte messages, 53% with 128-byte, or 6% with 4096-byte.

It also eliminates the need to explicitly enable the optimized POLYVAL code, as it's now enabled automatically when HCTR2 support is enabled.

Eric Biggers (9):
crypto: polyval - Rename conflicting functions lib/crypto: polyval: Add POLYVAL library
lib/crypto: tests: Add KUnit tests for POLYVAL lib/crypto: arm64/polyval: Migrate optimized code into library lib/crypto: x86/polyval: Migrate optimized code into library
crypto: hctr2 - Convert to use POLYVAL library
crypto: polyval - Remove the polyval crypto_shash
crypto: testmgr - Remove polyval tests
fscrypt: Drop obsolete recommendation to enable optimized POLYVAL

 Documentation/filesystems/fscrypt.rst         |   2 -
 arch/arm64/crypto/Kconfig                     |  10 -
 arch/arm64/crypto/Makefile                    |   3 -
 arch/arm64/crypto/polyval-ce-glue.c           | 158 ---------
 arch/x86/crypto/Kconfig                       |  10 -
 arch/x86/crypto/Makefile                      |   3 -
 arch/x86/crypto/polyval-clmulni_glue.c        | 180 ----------
 crypto/Kconfig                                |  12 +-
 crypto/Makefile                               |   1 -
 crypto/hctr2.c                                | 226 ++++---------
 crypto/polyval-generic.c                      | 205 ------------
 crypto/tcrypt.c                               |   4 -
 crypto/testmgr.c                              |   9 +-
 crypto/testmgr.h                              | 171 ----------
 include/crypto/polyval.h                      | 182 ++++++++++-
 lib/crypto/Kconfig                            |  12 +
 lib/crypto/Makefile                           |  10 +
 .../crypto/arm64}/polyval-ce-core.S           |  38 +--
 lib/crypto/arm64/polyval.h                    |  82 +++++
 lib/crypto/polyval.c                          | 307 ++++++++++++++++++
 lib/crypto/tests/Kconfig                      |   9 +
 lib/crypto/tests/Makefile                     |   1 +
 lib/crypto/tests/polyval-testvecs.h           | 186 +++++++++++
 lib/crypto/tests/polyval_kunit.c              | 223 +++++++++++++
 .../crypto/x86/polyval-pclmul-avx.S           |  40 ++-
 lib/crypto/x86/polyval.h                      |  83 +++++
 scripts/crypto/gen-hash-testvecs.py           |  47 ++-
 27 files changed, 1240 insertions(+), 974 deletions(-)
 delete mode 100644 arch/arm64/crypto/polyval-ce-glue.c
 delete mode 100644 arch/x86/crypto/polyval-clmulni_glue.c
 delete mode 100644 crypto/polyval-generic.c
 rename {arch/arm64/crypto => lib/crypto/arm64}/polyval-ce-core.S (92%)
 create mode 100644 lib/crypto/arm64/polyval.h
 create mode 100644 lib/crypto/polyval.c
 create mode 100644 lib/crypto/tests/polyval-testvecs.h
 create mode 100644 lib/crypto/tests/polyval_kunit.c
 rename arch/x86/crypto/polyval-clmulni_asm.S => lib/crypto/x86/polyval-pclmul-avx.S (91%)
 create mode 100644 lib/crypto/x86/polyval.h

base-commit: ce59a87d1cbd3fa075aba73efde946e61d5ef089

Signature · 1 line
2.51.2