Hi Herbert, On Mon, Apr 28, 2025 at 12:56:21PM +0800, Herbert Xu wrote: > Since the poly1305 algorithm is fixed, there is no point in going > through the Crypto API for it. Use the lib/crypto poly1305 interface > instead. > > For compatiblity keep the poly1305 parameter in the algorithm name. > > Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> > --- > crypto/Kconfig | 2 +- > crypto/chacha20poly1305.c | 323 ++++++++------------------------------ > 2 files changed, 67 insertions(+), 258 deletions(-) > > diff --git a/crypto/Kconfig b/crypto/Kconfig > index 9878286d1d68..f87e2a26d2dd 100644 > --- a/crypto/Kconfig > +++ b/crypto/Kconfig > @@ -784,8 +784,8 @@ config CRYPTO_AEGIS128_SIMD > config CRYPTO_CHACHA20POLY1305 > tristate "ChaCha20-Poly1305" > select CRYPTO_CHACHA20 > - select CRYPTO_POLY1305 > select CRYPTO_AEAD > + select CRYPTO_LIB_POLY1305 Should this be `select CRYPTO_LIB_POLY1305_GENERIC`, instead? I'm getting a build failure using the latest HEAD of cryptodev-2.6: 64745a9ca890 ("crypto: s390/sha512 - Initialise upper counter to zero for sha384"): ld: vmlinux.o: in function `poly_hash': /devel/cryptodev-2.6/crypto/chacha20poly1305.c:155:(.text+0x751bee): undefined reference to `poly1305_init' ld: /devel/cryptodev-2.6/crypto/chacha20poly1305.c:162:(.text+0x751c5e): undefined reference to `poly1305_update' ld: /devel/cryptodev-2.6/crypto/chacha20poly1305.c:168:(.text+0x751cd5): undefined reference to `poly1305_update' ld: /devel/cryptodev-2.6/crypto/chacha20poly1305.c:176:(.text+0x751d4f): undefined reference to `poly1305_update' ld: /devel/cryptodev-2.6/crypto/chacha20poly1305.c:182:(.text+0x751da6): undefined reference to `poly1305_update' ld: /devel/cryptodev-2.6/crypto/chacha20poly1305.c:186:(.text+0x751dd1): undefined reference to `poly1305_update' ld: /devel/cryptodev-2.6/crypto/chacha20poly1305.c:188:(.text+0x751df9): undefined reference to `poly1305_final' ... I have CONFIG_CRYPTO_CHACHA20POLY1305=y but CONFIG_CRYPTO_LIB_POLY1305_GENERIC=m. Looking at lib/crypto/Makefile, I see that poly1305.o, which exports poly1305_init() (and the other dependencies missing) is enabled by CONFIG_CRYPTO_LIB_POLY1305_GENERIC: obj-$(CONFIG_CRYPTO_LIB_POLY1305_GENERIC) += libpoly1305.o libpoly1305-y := poly1305-donna32.o libpoly1305-$(CONFIG_ARCH_SUPPORTS_INT128) := poly1305-donna64.o libpoly1305-y += poly1305.o Thanks, -- Giovanni