Skip to content

Commit 7698747

Browse files
author
Eric Biggers
committed
crypto: adiantum - Convert to use NH library
Reimplement the Adiantum message hashing using the nh() library function, combined with some code which directly handles the Poly1305 stage. The latter code is derived from crypto/nhpoly1305.c. This eliminates the dependency on the "nhpoly1305" crypto_shash algorithm, which existed only to fit Adiantum message hashing into the traditional Linux crypto API paradigm. Now that simple, architecture-optimized library functions are a well-established option too, we can switch to this simpler implementation. Note: I've dropped the support for the optional third parameter of the adiantum template, which specified the nhpoly1305 implementation. We could keep accepting some strings in this parameter for backwards compatibility, but I don't think it's being used. I believe only "adiantum(xchacha12,aes)" and "adiantum(xchacha20,aes)" are used. Link: https://lore.kernel.org/r/20251211011846.8179-7-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
1 parent a229d83 commit 7698747

3 files changed

Lines changed: 191 additions & 110 deletions

File tree

crypto/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,9 +601,9 @@ menu "Length-preserving ciphers and modes"
601601
config CRYPTO_ADIANTUM
602602
tristate "Adiantum"
603603
select CRYPTO_CHACHA20
604+
select CRYPTO_LIB_NH
604605
select CRYPTO_LIB_POLY1305
605606
select CRYPTO_LIB_POLY1305_GENERIC
606-
select CRYPTO_NHPOLY1305
607607
select CRYPTO_MANAGER
608608
help
609609
Adiantum tweakable, length-preserving encryption mode

0 commit comments

Comments
 (0)