zephyr: correct the RNG seeding description in the README - #23
Merged
Conversation
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
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.