Skip to content

Move the generic SP800-90B noise source into rng_noisesrc.c - #11920

Open
dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:noisesrc_wolfentropy
Open

dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:noisesrc_wolfentropy

Conversation

@dgarske

@dgarske dgarske commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Description

This PR moves the wc_NoiseSrc_* noise-source layer (WOLFSSL_NOISE_SRC) out of random.c/random.h and into a new rng_noisesrc.c/rng_noisesrc.h, which sit outside the FIPS module boundary. wolfentropy.c/wolfentropy.h are unchanged.

  • The noise source adopts wolfEntropy semantics: sliding-window APT, SHA3-256 conditioner, and reset-and-retry on a health-test failure (the failing source reruns its startup test on the next call) in place of the latched failure and the dropped-source mask.
  • Its Repetition Count and Adaptive Proportion tests keep per-source state in a wc_NoiseHealth struct; they follow wolfEntropy's algorithm but are a separate implementation, so the MemUse source is untouched.
  • A zero hmin, margin, cutoff, window or startupOctets selects the wolfEntropy default values; the C2000 port keeps its own cutoffs.
  • WOLFSSL_C2000_ENTROPY now implies WOLFSSL_NOISE_SRC from settings.h.

Testing

  • New --enable-noisesrc configure option enables the noise source and forces SHA-3 on. CMake builds rng_noisesrc.c unconditionally, as it is self-gated.
  • noisesrc_test gains startup-rerun, recovery, defaults and validation cases, and both KATs move to SHA3-256.
  • New noisesrc_host CI job runs make check with --enable-noisesrc --enable-all; IDE/C2000/compile.sh compiles rng_noisesrc.c under WOLFSSL_C2000_ENTROPY.
  • Doxygen entries for the wc_NoiseSrc_* API; IDE/C2000/README.md updated.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

@dgarske
dgarske force-pushed the noisesrc_wolfentropy branch from 6f7b323 to a261c17 Compare October 30, 2026 01:39
@dgarske dgarske changed the title Move the generic SP800-90B noise source into wolfEntropy Move the generic SP800-90B noise source into rng_noisesrc.c Oct 30, 2026
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