Skip to content

crypto: decouple curve25519 and idgen from random pool#18679

Merged
xiaoxiang781216 merged 1 commit intoapache:masterfrom
karaketir16:master
Apr 7, 2026
Merged

crypto: decouple curve25519 and idgen from random pool#18679
xiaoxiang781216 merged 1 commit intoapache:masterfrom
karaketir16:master

Conversation

@karaketir16
Copy link
Copy Markdown
Contributor

This commit modularizes the curve25519 and idgen implementations in the crypto subsystem.

Previously, curve25519.c and idgen.c were only compiled when CONFIG_CRYPTO_RANDOM_POOL was enabled. However, cryptosoft.c (used by software cipher support) has a direct dependency on curve25519 functions. This caused linker errors (undefined reference to curve25519) when software crypto was enabled but the random pool was disabled.

Changes:

  • Introduce hidden Kconfig options CRYPTO_CURVE25519 and CRYPTO_IDGEN.
  • Make CRYPTO_RANDOM_POOL select both CRYPTO_IDGEN and CRYPTO_CURVE25519.
  • Make CRYPTO_CRYPTODEV_SOFTWARE_CRYPTO/KEYMGMT select CRYPTO_CURVE25519.
  • Update CMakeLists.txt and Makefile to use the new config flags.

This ensures that required algorithms are automatically included in the build regardless of whether the entropy pool is enabled.

This commit modularizes the curve25519 and idgen implementations in the
crypto subsystem.

Previously, curve25519.c and idgen.c were only compiled when
CONFIG_CRYPTO_RANDOM_POOL was enabled. However, cryptosoft.c (used by
software cipher support) has a direct dependency on curve25519 functions.
This caused linker errors (undefined reference to curve25519) when
software crypto was enabled but the random pool was disabled.

Changes:
- Introduce hidden Kconfig options CRYPTO_CURVE25519 and CRYPTO_IDGEN.
- Make CRYPTO_RANDOM_POOL select both CRYPTO_IDGEN and CRYPTO_CURVE25519.
- Make CRYPTO_CRYPTODEV_SOFTWARE_CRYPTO/KEYMGMT select CRYPTO_CURVE25519.
- Update CMakeLists.txt and Makefile to use the new config flags.

This ensures that required algorithms are automatically included in the
build regardless of whether the entropy pool is enabled.

Signed-off-by: karaketir16 <osmankaraketir@gmail.com>
@github-actions github-actions Bot added Size: S The size of the change in this PR is small Area: Crypto labels Apr 6, 2026
Copy link
Copy Markdown
Contributor

@acassis acassis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karaketir16 thank you very much! Welcome aboard!

@xiaoxiang781216 xiaoxiang781216 merged commit b843d91 into apache:master Apr 7, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Crypto Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants