int px_get_random_bytes(uint8 *dst, unsigned count) { system_reseed(); fortuna_get_bytes(count, dst); return 0; }
int tm_random_bytes (uint8_t* buf, size_t buf_size, size_t* read) { fortuna_get_bytes(buf_size, buf); *read = buf_size; // Doesn't fail, by default. return 0; }
/* * consume random bytes */ uint32_t randomread(void *xp, uint32_t n){ Proc *up = externup(); if(waserror()){ qunlock(&rl); nexterror(); } qlock(&rl); fortuna_get_bytes(n, xp); qunlock(&rl); poperror(); return n; }