rng module: portable PRNG plus entropy hook
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 23
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
New module, motivated by three separate real problems rather than a hypothetical:
- FLAG S-01: numx_sketch_rsvd fails 2 ESP32-S3 tests because rand() seed portability differs across libc implementations (see validation/results/sketch/sketch.md). Not a bug in the algorithm, a portability problem in relying on the platform's rand().
- Kyber keygen (the pqc module, #62) needs a CSPRNG. A zero-dependency, no-OS library can't assume /dev/urandom or any platform entropy source exists.
- Every module that currently needs randomness (sketch's rsvd, this) rolls its own seeding ad hoc.
Proposed shape: a deterministic core PRNG (PCG or xorshift, small state, no allocation) for reproducible/testable use, plus a caller-supplied entropy callback (numx_rng_seed_from_entropy(fn) or similar) for the cryptographic use case in pqc, where the caller is responsible for supplying real entropy from whatever the platform provides.
Follow-up once this lands: #64 (migrate rsvd to it, close S-01).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the portability failure described in validation/results/sketch/sketch.md and review the proposed numx_rng_seed_from_entropy(fn) API alongside the pqc module in #62. Define the deterministic PRNG core and caller-supplied entropy hook without allocation or OS dependencies; done means the new rng module supports reproducible use and entropy injection for cryptographic callers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cryptography, embedded-iot
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100