The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v4 0/2] crypto: adiantum - Use the ChaCha library
@ 2026-12-02  6:50 Laveesh Bansal
  2026-12-02  6:50 ` [PATCH v4 1/2] crypto: testmgr - Add Adiantum vectors with a partial last ChaCha block Laveesh Bansal
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Laveesh Bansal @ 2026-12-02  6:50 UTC (permalink / raw)
  To: Eric Biggers; +Cc: Herbert Xu, David S. Miller, linux-crypto, linux-kernel

This series makes adiantum call the ChaCha library directly
instead of going through a crypto_skcipher child.

This came out of a conversation on another patch:
https://lore.kernel.org/all/20261127184407.GB1974@quark/

v1: https://lore.kernel.org/all/20261130055539.8278-1-laveeshb@laveeshbansal.com/
v2: https://lore.kernel.org/all/20261201043945.50022-1-laveeshb@laveeshbansal.com/
v3: https://lore.kernel.org/all/20261201080825.56171-1-laveeshb@laveeshbansal.com/

I used an LLM for research, the first draft, review and tests.
I did the final code changes and reviews myself.

Changes in v4:
I addressed feedback on v3.
https://lore.kernel.org/all/20261202022124.GB2427638@google.com/
https://lore.kernel.org/all/20261202023013.GC2427638@google.com/

Patch 1:
 - Replaced the 145-byte test vectors with 175-byte ones.
 - Sorted the vectors by length.

Patch 2:
 - Added <linux/unaligned.h>.
 - Updated adiantum_xchacha_init() to take only the 24-byte nonce
   and start at stream position 0.
 - Removed 'keylen' from adiantum_setkey().
 - Added __aligned(sizeof(long)) to the bounce buffer in
   adiantum_stream_xor().
 - Moved the stream_len calculation under 'if (bulk_len)'.
 - Declared 'state' inside the 'if (bulk_len)' block.
 - Used the 'nrounds' argument directly in adiantum_setkey().

Changes in v3:
I addressed feedback on v2.
https://lore.kernel.org/all/20261201051752.GB7060@sol/

 - Dropped select CRYPTO_MANAGER and sorted the selects in Kconfig.
 - Made 'iv' in adiantum_setkey() static const.
 - Moved the stream cipher step under 'if (bulk_len)'; also used the
   src and dst local variables there.
 - Set .base.cra_reqsize in the skcipher_alg instead of calling
   crypto_skcipher_set_reqsize() and moved setting tctx->nrounds
   into adiantum_setkey().
 - Wrote the two skcipher_alg structs instead of using a macro.

Changes in v2:
I addressed feedback on v1.
https://lore.kernel.org/all/20261130194303.GB16775@google.com/
https://lore.kernel.org/all/20261130194012.GA16775@google.com/

 - Merged patches 2 and 3.
 - Updated adiantum to not be a template. It registers two skcipher
   algorithms -- adiantum(xchacha12,aes) and adiantum(xchacha20,aes).
 - In-place requests under CONFIG_HIGHMEM map the memory only once.
 - 'buf' is zeroized.
 - Based on the current cryptodev master because the base in v1 --
   commit 9fb9278d13dca -- is no longer in it.

Laveesh Bansal (2):
  crypto: testmgr - Add Adiantum vectors with a partial last ChaCha
    block
  crypto: adiantum - Use the ChaCha library

 crypto/Kconfig    |   4 +-
 crypto/adiantum.c | 415 +++++++++++++----------------
 crypto/testmgr.h  | 656 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 836 insertions(+), 239 deletions(-)


This series applies on top of the following:
  - setkey: https://lore.kernel.org/all/20261125013553.94480-1-ebiggers@kernel.org/
  - aeslib: https://lore.kernel.org/all/20261125032407.126634-1-ebiggers@kernel.org/

base-commit: e1ec0b1e859b0f2261d64b3db95991c2da627af4
prerequisite-patch-id: 5268ec1436ad909487f950765a39a0cc6eac0c6a
prerequisite-patch-id: 0edefdce5d51065803ab84e3492634dcb9e0e53e
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-02 17:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02  6:50 [PATCH v4 0/2] crypto: adiantum - Use the ChaCha library Laveesh Bansal
2026-12-02  6:50 ` [PATCH v4 1/2] crypto: testmgr - Add Adiantum vectors with a partial last ChaCha block Laveesh Bansal
2026-12-02  6:50 ` [PATCH v4 2/2] crypto: adiantum - Use the ChaCha library Laveesh Bansal
2026-12-02 17:23 ` [PATCH v4 0/2] " Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox