2022-05-26 12:15:18

by Jason A. Donenfeld

[permalink] [raw]
Subject: [PATCH crypto] crypto: poly1305 - cleanup stray CRYPTO_LIB_POLY1305_RSIZE

When CRYPTO_LIB_POLY1305 is unset, CRYPTO_LIB_POLY1305_RSIZE is still
set in the Kconfig, cluttering things. Fix this by making
CRYPTO_LIB_POLY1305_RSIZE depend on CRYPTO_LIB_POLY1305.

Suggested-by: Linus Torvalds <[email protected]>
Signed-off-by: Jason A. Donenfeld <[email protected]>
---
lib/crypto/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig
index 379a66d7f504..a80b8c4dc2cf 100644
--- a/lib/crypto/Kconfig
+++ b/lib/crypto/Kconfig
@@ -85,6 +85,7 @@ config CRYPTO_LIB_POLY1305_RSIZE
default 11 if X86_64
default 9 if ARM || ARM64
default 1
+ depends on CRYPTO_LIB_POLY1305

config CRYPTO_ARCH_HAVE_LIB_POLY1305
tristate
--
2.35.1



2022-05-27 12:40:47

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH crypto] crypto: poly1305 - cleanup stray CRYPTO_LIB_POLY1305_RSIZE

Hi "Jason,

I love your patch! Yet something to improve:

[auto build test ERROR on herbert-cryptodev-2.6/master]
[also build test ERROR on herbert-crypto-2.6/master crng-random/master v5.18 next-20220526]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/intel-lab-lkp/linux/commits/Jason-A-Donenfeld/crypto-poly1305-cleanup-stray-CRYPTO_LIB_POLY1305_RSIZE/20220526-173718
base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: i386-debian-10.3-kselftests (https://download.01.org/0day-ci/archive/20220527/[email protected]/config)
compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/fde026a9e6312b3278b170ca6a41cd84a6fb935e
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Jason-A-Donenfeld/crypto-poly1305-cleanup-stray-CRYPTO_LIB_POLY1305_RSIZE/20220526-173718
git checkout fde026a9e6312b3278b170ca6a41cd84a6fb935e
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash lib/crypto/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

In file included from include/crypto/internal/poly1305.h:11,
from lib/crypto/poly1305-donna32.c:11:
>> include/crypto/poly1305.h:56:46: error: 'CONFIG_CRYPTO_LIB_POLY1305_RSIZE' undeclared here (not in a function); did you mean 'CONFIG_CRYPTO_POLY1305_MODULE'?
56 | struct poly1305_key opaque_r[CONFIG_CRYPTO_LIB_POLY1305_RSIZE];
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| CONFIG_CRYPTO_POLY1305_MODULE


vim +56 include/crypto/poly1305.h

878afc35cd28bc Eric Biggers 2018-11-16 40
2546f811ef45fc Martin Willi 2015-07-16 41 struct poly1305_desc_ctx {
2546f811ef45fc Martin Willi 2015-07-16 42 /* partial buffer */
2546f811ef45fc Martin Willi 2015-07-16 43 u8 buf[POLY1305_BLOCK_SIZE];
2546f811ef45fc Martin Willi 2015-07-16 44 /* bytes used in partial buffer */
2546f811ef45fc Martin Willi 2015-07-16 45 unsigned int buflen;
ad8f5b88383ea6 Ard Biesheuvel 2019-11-08 46 /* how many keys have been set in r[] */
ad8f5b88383ea6 Ard Biesheuvel 2019-11-08 47 unsigned short rset;
ad8f5b88383ea6 Ard Biesheuvel 2019-11-08 48 /* whether s[] has been set */
2546f811ef45fc Martin Willi 2015-07-16 49 bool sset;
ad8f5b88383ea6 Ard Biesheuvel 2019-11-08 50 /* finalize key */
ad8f5b88383ea6 Ard Biesheuvel 2019-11-08 51 u32 s[4];
ad8f5b88383ea6 Ard Biesheuvel 2019-11-08 52 /* accumulator */
ad8f5b88383ea6 Ard Biesheuvel 2019-11-08 53 struct poly1305_state h;
ad8f5b88383ea6 Ard Biesheuvel 2019-11-08 54 /* key */
1c08a104360f3e Jason A. Donenfeld 2020-01-05 55 union {
1c08a104360f3e Jason A. Donenfeld 2020-01-05 @56 struct poly1305_key opaque_r[CONFIG_CRYPTO_LIB_POLY1305_RSIZE];
1c08a104360f3e Jason A. Donenfeld 2020-01-05 57 struct poly1305_core_key core_r;
1c08a104360f3e Jason A. Donenfeld 2020-01-05 58 };
2546f811ef45fc Martin Willi 2015-07-16 59 };
2546f811ef45fc Martin Willi 2015-07-16 60

--
0-DAY CI Kernel Test Service
https://01.org/lkp

2022-05-28 18:54:10

by Jason A. Donenfeld

[permalink] [raw]
Subject: [PATCH crypto v2] crypto: poly1305 - cleanup stray CRYPTO_LIB_POLY1305_RSIZE

When CRYPTO_LIB_POLY1305 is unset, CRYPTO_LIB_POLY1305_RSIZE is still
set in the Kconfig, cluttering things. Fix this by making
CRYPTO_LIB_POLY1305_RSIZE depend on CRYPTO_LIB_POLY1305 and other
various related config options.

Suggested-by: Linus Torvalds <[email protected]>
Signed-off-by: Jason A. Donenfeld <[email protected]>
---
Changes v1->v2:
- Also depend on CRYPTO_ARCH_HAVE_LIB_POLY1305 and
CRYPTO_LIB_POLY1305_GENERIC, after kbuild bot warning. Hopefully this
handles all the weird edge cases in this unfortunate maze.

lib/crypto/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig
index 379a66d7f504..7ee13c08c970 100644
--- a/lib/crypto/Kconfig
+++ b/lib/crypto/Kconfig
@@ -85,6 +85,7 @@ config CRYPTO_LIB_POLY1305_RSIZE
default 11 if X86_64
default 9 if ARM || ARM64
default 1
+ depends on CRYPTO_LIB_POLY1305 || CRYPTO_ARCH_HAVE_LIB_POLY1305 || CRYPTO_LIB_POLY1305_GENERIC

config CRYPTO_ARCH_HAVE_LIB_POLY1305
tristate
--
2.35.1