Skip to contentSkip to conversation

Enable config for sm3, sm4, polyval, xctr cipher test as built in module.

PATCH In review Kshitiz Varshney 2 participants 2 messages Feb 5, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Enable config for sm3, sm4, polyval, xctr cipher test as built in module.

Issue:-
Multiple crypto tests like sm3, sm4 xctr and polyval failing.

skcipher: failed to allocate transform for xctr(aes): -2
alg: self-tests for xctr(aes) using xctr(aes) failed (rc=-2)
alg: self-tests for sm3 using sm3 failed (rc=-2)
tcrypt: failed to load transform for sm3: -2
alg: hash: failed to allocate transform for polyval: -2
alg: self-tests for polyval using polyval failed (rc=-2)

Resolution:-
Enabling CONFIG_CRYPTO_SM3_GENERIC, CONFIG_CRYPTO_SM4_GENERIC, CONFIG_CRYPTO_HCTR2, CONFIG_CRYPTO_ARIA as module enables support of sm3, sm4, aria, polyval & xctr.

---
 arch/arm/configs/imx_v6_v7_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/configs/imx_v6_v7_defconfig +4 -0
index 0a90583f9f01..bc2bfc7c61b0 100644
@@ -466,6 +466,10 @@ CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=y
 CONFIG_SECURITYFS=y
+CONFIG_CRYPTO_ARIA=m
+CONFIG_CRYPTO_SM4_GENERIC=m
+CONFIG_CRYPTO_HCTR2=m
+CONFIG_CRYPTO_SM3_GENERIC=m
 CONFIG_CRYPTO_DEV_FSL_CAAM=y
 CONFIG_CRYPTO_DEV_SAHARA=y
 CONFIG_CRYPTO_DEV_MXS_DCP=y
Signature · 1 line
2.25.1
#1 lore raw
Quoted 10 lines · Kshitiz Varshney

Issue:-
Multiple crypto tests like sm3, sm4 xctr and polyval failing.

skcipher: failed to allocate transform for xctr(aes): -2
alg: self-tests for xctr(aes) using xctr(aes) failed (rc=-2)
alg: self-tests for sm3 using sm3 failed (rc=-2)
tcrypt: failed to load transform for sm3: -2
alg: hash: failed to allocate transform for polyval: -2
alg: self-tests for polyval using polyval failed (rc=-2)

Quoted 6 lines

Resolution:-
Enabling CONFIG_CRYPTO_SM3_GENERIC, CONFIG_CRYPTO_SM4_GENERIC, CONFIG_CRYPTO_HCTR2, CONFIG_CRYPTO_ARIA as module enables support of sm3, sm4, aria, polyval & xctr.

This looks like an issue in tcrypt. When algorithms are unavailable it should consider the corresponding test cases to be skipped, not failed.

Quoted 1 line
 arch/arm/configs/imx_v6_v7_defconfig | 4 ++++

There should be no need to enable every crypto algorithm in every defconfig file. Can you consider fixing the underlying issue instead of doing that?

- Eric