Skip to content

zephyr: correct the RNG seeding description in the README - #23

Merged
dgarske merged 1 commit into
wolfSSL:masterfrom
Frauschi:readme_fix
Aug 7, 2026
Merged

zephyr: correct the RNG seeding description in the README#23
dgarske merged 1 commit into
wolfSSL:masterfrom
Frauschi:readme_fix

Conversation

@Frauschi

@Frauschi Frauschi commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

The README claimed that wolfPSA's boot init registers a Zephyr-CSPRNG seed callback, so that the shared wolfCrypt Hash-DRBG is seeded from the platform entropy source via sys_csrand_get(). That describes a design that no longer exists: no seed callback is registered by either module, and seeding through sys_csrand_get() would recurse back into the DRBG that implements it.

Describe what actually happens instead. The shared Hash-DRBG is seeded on demand by wolfCrypt's own wc_GenerateSeed(), which on Zephyr reads the hardware entropy driver directly via entropy_get_entropy() on the zephyr,entropy chosen node, and falls back to sys_rand_get() on boards that have no such node. A dead entropy source makes wc_InitRng() fail with RNG_FAILURE_E rather than yield weak output. Also note that the Hash-DRBG requirement is enforced by a build-time #error on HAVE_HASHDRBG.

Fix a second stale claim in the same file while here: wolfPSA's Kconfig no longer selects WOLFSSL_HASH_DRBG or WOLFSSL_RNG_SEED_CB. Neither symbol exists in the wolfSSL module Kconfig, and wolfPSA selects no wolfCrypt feature knobs at all; the structural profile comes from the wolfSSL module's own defaults. The same paragraph named WOLFSSL_CRYPTO_ONLY where it meant the WOLFCRYPT_ONLY macro.

Documentation only; no functional change.

The README claimed that wolfPSA's boot init registers a Zephyr-CSPRNG seed
callback, so that the shared wolfCrypt Hash-DRBG is seeded from the platform
entropy source via sys_csrand_get(). That describes a design that no longer
exists: no seed callback is registered by either module, and seeding through
sys_csrand_get() would recurse back into the DRBG that implements it.

Describe what actually happens instead. The shared Hash-DRBG is seeded on
demand by wolfCrypt's own wc_GenerateSeed(), which on Zephyr reads the
hardware entropy driver directly via entropy_get_entropy() on the
zephyr,entropy chosen node, and falls back to sys_rand_get() on boards that
have no such node. A dead entropy source makes wc_InitRng() fail with
RNG_FAILURE_E rather than yield weak output. Also note that the Hash-DRBG
requirement is enforced by a build-time #error on HAVE_HASHDRBG.

Fix a second stale claim in the same file while here: wolfPSA's Kconfig no
longer selects WOLFSSL_HASH_DRBG or WOLFSSL_RNG_SEED_CB. Neither symbol
exists in the wolfSSL module Kconfig, and wolfPSA selects no wolfCrypt
feature knobs at all; the structural profile comes from the wolfSSL module's
own defaults. The same paragraph named WOLFSSL_CRYPTO_ONLY where it meant
the WOLFCRYPT_ONLY macro.

Documentation only; no functional change.
@dgarske
dgarske merged commit 3ec7b9b into wolfSSL:master Aug 7, 2026
41 checks passed
@Frauschi
Frauschi deleted the readme_fix branch August 7, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants