foxpy / qc

Quad C: Custom Cruel C Crate
MIT License
4 stars 0 forks source link

Feature request: random library: easier access to os random #55

Closed foxpy closed 3 years ago

foxpy commented 3 years ago

Currently user has to call qc_rnd_init and extract random manually from qc_rnd object in a loop in order to obtain os random. It would be nice to have something like

qc_result qc_rnd_os_buf(size_t len, uint8_t buf[static len], qc_err* err);

And while we are here, let's think about filling buffer with random in general. It would be very convenient to have

qc_result qc_rnd_buf(qc_rnd* state, size_t len, uint8_t buf[static len]);

which works just like qc_rnd_os_buf(), but is faster and produced predictable (non crypto quality) random.