Skip to content

crypto: reduce ahash API overhead

Eric Biggers linux-crypto 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest30 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/30crypto: shash - remove crypto_shash_ctx_aligned()include/crypto/algapi.h include/crypto/internal/hash.h+0 -100 replies
2/30crypto: sun4i-ss - remove unnecessary alignmask for ahashesdrivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c+0 -21 reply
3/30crypto: sun8i-ce - remove unnecessary alignmask for ahashesdrivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c+0 -61 reply
4/30crypto: sun8i-ss - remove unnecessary alignmask for ahashesdrivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c+0 -51 reply
5/30crypto: atmel - remove unnecessary alignmask for ahashesdrivers/crypto/atmel-sha.c+0 -20 replies
6/30crypto: artpec6 - stop setting alignmask for ahashesdrivers/crypto/axis/artpec6_crypto.c+0 -30 replies
7/30crypto: mxs-dcp - remove unnecessary alignmask for ahashesdrivers/crypto/mxs-dcp.c+0 -20 replies
8/30crypto: s5p-sss - remove unnecessary alignmask for ahashesdrivers/crypto/s5p-sss.c+0 -60 replies
9/30crypto: talitos - remove unnecessary alignmask for ahashesdrivers/crypto/talitos.c+1 -12 replies
10/30crypto: omap-sham - stop setting alignmask for ahashesdrivers/crypto/omap-sham.c+2 -140 replies
11/30crypto: rockchip - remove unnecessary alignmask for ahashesdrivers/crypto/rockchip/rk3288_crypto_ahash.c+0 -30 replies
12/30crypto: starfive - remove unnecessary alignmask for ahashesdrivers/crypto/starfive/jh7110-hash.c+2 -110 replies
13/30crypto: stm32 - remove unnecessary alignmask for ahashesdrivers/crypto/stm32/stm32-hash.c+0 -200 replies
14/30crypto: ahash - remove support for nonzero alignmaskDocumentation/crypto/devel-algos.rst crypto/ahash.c crypto/shash.c +2 more+28 -1320 replies
15/30crypto: authenc - stop using alignmask of ahashcrypto/authenc.c+2 -100 replies
16/30crypto: authencesn - stop using alignmask of ahashcrypto/authencesn.c+6 -140 replies
17/30crypto: testmgr - stop checking crypto_ahash_alignmaskcrypto/testmgr.c+3 -60 replies
18/30net: ipv4: stop checking crypto_ahash_alignmasknet/ipv4/ah4.c+7 -100 replies
19/30net: ipv6: stop checking crypto_ahash_alignmasknet/ipv6/ah6.c+7 -100 replies
20/30crypto: ccm - stop using alignmask of ahashcrypto/ccm.c+1 -20 replies
21/30crypto: chacha20poly1305 - stop using alignmask of ahashcrypto/chacha20poly1305.c+1 -20 replies
22/30crypto: gcm - stop using alignmask of ahashcrypto/gcm.c+1 -20 replies
23/30crypto: ahash - remove crypto_ahash_alignmaskinclude/crypto/hash.h+0 -60 replies
24/30crypto: ahash - remove struct ahash_request_privcrypto/ahash.c+0 -80 replies
25/30crypto: ahash - improve file commentcrypto/ahash.c+6 -20 replies
26/30crypto: chelsio - stop using crypto_ahash::initdrivers/crypto/chelsio/chcr_algo.c+8 -10 replies
27/30crypto: talitos - stop using crypto_ahash::initdrivers/crypto/talitos.c+9 -60 replies
28/30crypto: hash - move "ahash wrapping shash" functions to ahash.ccrypto/ahash.c crypto/hash.h crypto/shash.c+188 -1910 replies
29/30crypto: ahash - check for shash type instead of not ahash typecrypto/ahash.c+3 -50 replies
30/30crypto: ahash - optimize performance when wrapping shashcrypto/ahash.c crypto/hash.h crypto/shash.c +1 more+167 -2040 replies

Reviews trailers per patch

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

PatchCorentin Labbe
1/30
2/30A-b
3/30A-b
4/30A-b
5/30
6/30
7/30
8/30
9/30
10/30
11/30
12/30
13/30
14/30
15/30
16/30
17/30
18/30
19/30
20/30
21/30
22/30
23/30
24/30
25/30
26/30
27/30
28/30
29/30
30/30

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/30] crypto: reduce ahash API overhead

This patch series first removes the alignmask support from ahash. As is the case with shash, the alignmask support of ahash has no real point. Removing it reduces API overhead and complexity.

Second, this patch series optimizes the common case where the ahash API uses an shash algorithm, by eliminating unnecessary indirect calls.

This series can be retrieved from git at
https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git
tag "crypto-ahash-2023-10-22". Note that it depends on my other series "crypto: stop supporting alignmask in shash"
(https://lore.kernel.org/r/[email protected]).

Patch 1 cleans up after removal of alignmask support from shash.

Patches 2-12 make drivers stop setting an alignmask for ahashes.

Patch 13 removes alignmask support from ahash.

Patches 14-23 remove checks of ahash alignmasks that became unnecessary.

Patches 24-25 are other ahash related cleanups.

Patches 26-29 prepare for optimizing the ahash-using-shash case.

Patches 30 optimizes the ahash-using-shash case.

Eric Biggers (30):
crypto: shash - remove crypto_shash_ctx_aligned()
crypto: sun4i-ss - remove unnecessary alignmask for ahashes
crypto: sun8i-ce - remove unnecessary alignmask for ahashes
crypto: sun8i-ss - remove unnecessary alignmask for ahashes
crypto: atmel - remove unnecessary alignmask for ahashes
crypto: artpec6 - stop setting alignmask for ahashes
crypto: mxs-dcp - remove unnecessary alignmask for ahashes
crypto: s5p-sss - remove unnecessary alignmask for ahashes
crypto: talitos - remove unnecessary alignmask for ahashes
crypto: omap-sham - stop setting alignmask for ahashes
crypto: rockchip - remove unnecessary alignmask for ahashes
crypto: starfive - remove unnecessary alignmask for ahashes
crypto: stm32 - remove unnecessary alignmask for ahashes
crypto: ahash - remove support for nonzero alignmask
crypto: authenc - stop using alignmask of ahash
crypto: authencesn - stop using alignmask of ahash
crypto: testmgr - stop checking crypto_ahash_alignmask
net: ipv4: stop checking crypto_ahash_alignmask
net: ipv6: stop checking crypto_ahash_alignmask
crypto: ccm - stop using alignmask of ahash
crypto: chacha20poly1305 - stop using alignmask of ahash
crypto: gcm - stop using alignmask of ahash
crypto: ahash - remove crypto_ahash_alignmask
crypto: ahash - remove struct ahash_request_priv
crypto: ahash - improve file comment
crypto: chelsio - stop using crypto_ahash::init
crypto: talitos - stop using crypto_ahash::init
crypto: hash - move "ahash wrapping shash" functions to ahash.c
crypto: ahash - check for shash type instead of not ahash type
crypto: ahash - optimize performance when wrapping shash

 Documentation/crypto/devel-algos.rst          |   4 +-
 crypto/ahash.c                                | 406 +++++++++++-------
 crypto/authenc.c                              |  12 +-
 crypto/authencesn.c                           |  20 +-
 crypto/ccm.c                                  |   3 +-
 crypto/chacha20poly1305.c                     |   3 +-
 crypto/gcm.c                                  |   3 +-
 crypto/hash.h                                 |  14 +-
 crypto/shash.c                                | 205 +--------
 crypto/testmgr.c                              |   9 +-
 .../crypto/allwinner/sun4i-ss/sun4i-ss-core.c |   2 -
 .../crypto/allwinner/sun8i-ce/sun8i-ce-core.c |   6 -
 .../crypto/allwinner/sun8i-ss/sun8i-ss-core.c |   5 -
 drivers/crypto/atmel-sha.c                    |   2 -
 drivers/crypto/axis/artpec6_crypto.c          |   3 -
 drivers/crypto/chelsio/chcr_algo.c            |   9 +-
 drivers/crypto/mxs-dcp.c                      |   2 -
 drivers/crypto/omap-sham.c                    |  16 +-
 drivers/crypto/rockchip/rk3288_crypto_ahash.c |   3 -
 drivers/crypto/s5p-sss.c                      |   6 -
 drivers/crypto/starfive/jh7110-hash.c         |  13 +-
 drivers/crypto/stm32/stm32-hash.c             |  20 -
 drivers/crypto/talitos.c                      |  17 +-
 include/crypto/algapi.h                       |   5 -
 include/crypto/hash.h                         |  74 +---
 include/crypto/internal/hash.h                |   9 +-
 include/linux/crypto.h                        |  27 +-
 net/ipv4/ah4.c                                |  17 +-
 net/ipv6/ah6.c                                |  17 +-
 29 files changed, 339 insertions(+), 593 deletions(-)

base-commit: a2786e8bdd0242d7f00abf452a572de7464d177b
prerequisite-patch-id: e447f81a392f2f3955206357d72032cf691c7e11
prerequisite-patch-id: 71947e05e23fb176da3ca898720b9e3332e891d7
prerequisite-patch-id: 98d070bdaf3cfaf88553ab707cc3bfe85371c006
prerequisite-patch-id: 9e4287b71c1129edb1ba162e2a1f641a9ac4385f
prerequisite-patch-id: 22a4cda4ae529854e55627c55d3f35b035871f3b
prerequisite-patch-id: f67b194e37338a4715850686b2f02bbf0a47cbe1
prerequisite-patch-id: bcb547f4c9be4b022b824f9bff6b919b2d37d60f
prerequisite-patch-id: 20a8c2663a94c2d49217c5158a6bc588881fb9ad
prerequisite-patch-id: e45e43c487d75c87fd713a5ef57a584cf947950e
prerequisite-patch-id: bb211c1b59f73b22319aee6fafd14b07bc5d1460
prerequisite-patch-id: 5f033ce643ba7d1f219dee490abd21e1e0958a51
prerequisite-patch-id: 2173122570085246d5f4e5d3c4a920f7b7c528f9
prerequisite-patch-id: 3fe1bc3b93e9502f874c485c5f2e39eec4899222
prerequisite-patch-id: 982ed5e31a6616f9788d4641c3757342e9f15576
prerequisite-patch-id: 6a207af4a7044cc47ab3f797e9c865fdbdb5d20c
prerequisite-patch-id: f34ad579025354af65a73c1497dc967e2e834a55
prerequisite-patch-id: 5ad384179da558ff3359baabda588731ed2e90a4
prerequisite-patch-id: d3d243977afb4f574fb289eddf0e71becda1ae2b

Signature · 1 line
2.42.0