Skip to content

crypto: lib - Add partial block helper

Herbert Xu linux-crypto linux-next linuxppc-dev lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest11 patches 3 repliesIn review
  2. v311 patches 0 repliesSuperseded
  3. v211 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v115 patches15 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11crypto: lib/sha256 - Move partial block handling outinclude/crypto/internal/blockhash.h include/crypto/sha2.h include/crypto/sha256_base.h+62 -370 replies
2/11crypto: lib/poly1305 - Add block-only interfaceinclude/crypto/internal/poly1305.h include/crypto/poly1305.h lib/crypto/poly1305.c+68 -390 replies
3/11crypto: arm/poly1305 - Add block-only interfacearch/arm/lib/crypto/poly1305-armv4.pl arch/arm/lib/crypto/poly1305-glue.c+47 -350 replies
4/11crypto: arm64/poly1305 - Add block-only interfacearch/arm64/lib/crypto/Makefile arch/arm64/lib/crypto/poly1305-glue.c+45 -290 replies
5/11crypto: mips/poly1305 - Add block-only interfacearch/mips/lib/crypto/poly1305-glue.c arch/mips/lib/crypto/poly1305-mips.pl+26 -150 replies
6/11crypto: powerpc/poly1305 - Add block-only interfacearch/powerpc/lib/crypto/poly1305-p10-glue.c+49 -350 replies
7/11crypto: x86/poly1305 - Add block-only interfacearch/x86/lib/crypto/poly1305-x86_64-cryptogams.pl arch/x86/lib/crypto/poly1305_glue.c+71 -870 replies
8/11crypto: chacha20poly1305 - Use lib/crypto poly1305crypto/Kconfig crypto/chacha20poly1305.c+67 -2586 replies
9/11crypto: testmgr - Remove poly1305crypto/testmgr.c crypto/testmgr.h+0 -2940 replies
10/11crypto: poly1305 - Remove algorithmcrypto/Kconfig crypto/Makefile crypto/poly1305.c+0 -1660 replies
11/11crypto: lib/poly1305 - Use block-only interfacearch/arm/lib/crypto/poly1305-glue.c arch/arm64/lib/crypto/poly1305-glue.c arch/mips/lib/crypto/poly1305-glue.c +4 more+32 -35829 replies

Reviews trailers per patch

None of the 11 patches has a Reviewed-by or Acked-by.

PatchThorsten LeemhuisVenkat Rao Bagalkote
1/11
2/11
3/11
4/11
5/11
6/11
7/11
8/11
9/11
10/11
11/11T-b T-b

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

Read the v4 thread

Cover letter [v4 PATCH 00/11] crypto: lib - Add partial block helper

v4 modifies the block helper so that the block function and state are back in local-scope variables, the lengths have been extended to size_t where necessary.

This is based on

	https://patchwork.kernel.org/project/linux-crypto/list/?series=955753
	https://patchwork.kernel.org/project/linux-crypto/list/?series=957401

This series introduces a partial block helper for lib/crypto hash algorithms based on the one from sha256_base.

It then uses it on poly1305 to eliminate duplication between architectures. In particular, instead of having complete update functions for each architecture, reduce it to a block function per architecture instead. The partial block handling is handled by the generic library layer.

The poly1305 implementation was anomalous due to the inability to call setkey in softirq. It also has just a single user, which is chacha20poly1305 that is hard-coded to use poly1305. Replace the gratuitous use of ahash in chacha20poly1305 with the lib/crypto poly1305 instead.

This then allows the shash poly1305 to be removed.

Note that there is still some testing coverage for lib/poly1305 through the Crypto API chacha20poly1305 algorithm.

Herbert Xu (11):
crypto: lib/sha256 - Move partial block handling out
crypto: lib/poly1305 - Add block-only interface
crypto: arm/poly1305 - Add block-only interface
crypto: arm64/poly1305 - Add block-only interface
crypto: mips/poly1305 - Add block-only interface
crypto: powerpc/poly1305 - Add block-only interface
crypto: x86/poly1305 - Add block-only interface
crypto: chacha20poly1305 - Use lib/crypto poly1305
crypto: testmgr - Remove poly1305
crypto: poly1305 - Remove algorithm
crypto: lib/poly1305 - Use block-only interface

 arch/arm/lib/crypto/poly1305-armv4.pl         |   4 +-
 arch/arm/lib/crypto/poly1305-glue.c           | 113 ++----
 arch/arm64/lib/crypto/Makefile                |   3 +-
 arch/arm64/lib/crypto/poly1305-glue.c         | 105 ++----
 arch/mips/lib/crypto/poly1305-glue.c          |  75 +---
 arch/mips/lib/crypto/poly1305-mips.pl         |  12 +-
 arch/powerpc/lib/crypto/poly1305-p10-glue.c   | 109 ++----
 .../lib/crypto/poly1305-x86_64-cryptogams.pl  |  33 +-
 arch/x86/lib/crypto/poly1305_glue.c           | 169 +++------
 crypto/Kconfig                                |  14 +-
 crypto/Makefile                               |   2 -
 crypto/chacha20poly1305.c                     | 323 ++++--------------
 crypto/poly1305.c                             | 152 ---------
 crypto/testmgr.c                              |   6 -
 crypto/testmgr.h                              | 288 ----------------
 include/crypto/internal/blockhash.h           |  52 +++
 include/crypto/internal/poly1305.h            |  28 +-
 include/crypto/poly1305.h                     |  60 +---
 include/crypto/sha2.h                         |   9 +-
 include/crypto/sha256_base.h                  |  38 +--
 lib/crypto/poly1305.c                         |  83 ++---
 21 files changed, 396 insertions(+), 1282 deletions(-)
 delete mode 100644 crypto/poly1305.c
 create mode 100644 include/crypto/internal/blockhash.h
Signature · 1 line
2.39.5