How nullspook/libpsijent works
libpsijent is a C library that produces random bits and bytes from jitter measured using hardware timestamps. Its main workflow initializes per-generator state, samples timing deltas, converts their low bits into output bits with optional decorrelation, PRNG masking, and bias amplification, then packs bits into bytes. The same measurement core supports raw-delta access and an initialization-time entropy estimate. Source excerpts show these runtime relationships; no separate storage or service subsystem is evident.
Main entry points: psijent.h Generator API · psijent.c Unpacked bits · hwtimestamp.h Hardware timestamps
Components 14
Public API
- Generator API
src/psijent.h - State lifecycle
src/psijent.c - Raw deltas
src/psijent.c - Entropy estimate
src/psijent.c
Jitter Source
- Generator state
src/psijent.c - Delta measurement
src/psijent.c - Hardware timestamps
src/hwtimestamp.h
Bit Processing
- Entropy bit
src/psijent.c - LFSR decorrelation
src/psijent.c - PRNG masking
src/psijent.c - Bias amplification
src/psijent.c - Unpacked bits
src/psijent.c - Byte packing
src/psijent.c
Other components
- Library caller
Connections 19
- Library caller → Generator API: calls
- Generator API → State lifecycle: invokes
- Generator API → Raw deltas: invokes
- Generator API → Entropy estimate: invokes
- Generator API → Unpacked bits: invokes
- Generator API → Byte packing: invokes
- State lifecycle → Generator state: allocates state
- State lifecycle → Entropy estimate: checks entropy
- Raw deltas → Delta measurement: samples deltas
- Entropy estimate → Entropy bit: samples bits
- Entropy bit → Delta measurement: measures
- Delta measurement → Generator state: updates memory state
- Delta measurement → Hardware timestamps: reads counter
- Unpacked bits → Entropy bit: gets bits
- Unpacked bits → LFSR decorrelation: optionally transforms
- Unpacked bits → PRNG masking: optionally XORs
- Unpacked bits → Bias amplification: amplifies bias
- Byte packing → Unpacked bits: requests bits
- Byte packing → Library caller: returns bytes