Documentation
¶
Overview ¶
Headless go-virtio rng validate harness: boots tamago/amd64 under QEMU, drives a real virtio-rng-pci device through the go-virtio/rng driver, and proves the device actually delivers entropy. No host-side observation is needed — the guest does the proof itself and reports RNG-VALIDATE: PASS/FAIL on the serial console. run-rng.sh parses the verdict and exits non-zero on FAIL.
This mirrors the blk harness: a *real* virtio-rng-pci device (not the fake transport the unit tests use) exercises the request-queue bring-up, the device-writable buffer post, the doorbell, and the used-ring length report on actual QEMU emulation.
Entropy proof (three independent checks, any failure => FAIL):
- LENGTH: a Read of N bytes returns exactly N (io.ReadFull semantics).
- DISTINCT: two successive N-byte reads differ. A stuck/zero source returns identical buffers; real entropy does not.
- DISTRIBUTION: over a large sample, (a) not all bytes are zero, (b) the number of distinct byte values is high, and (c) a chi-square-style uniformity check over the 256 buckets is within a generous bound. A constant or low-entropy source fails at least one of these.
Click to show internal directories.
Click to hide internal directories.