Randomness / entropy source on AROS? (getrandom / ...
# aros
j
Randomness / entropy source on AROS? (getrandom / arc4random) Hi all, I have been porting Rust's standard library to aarch64 AROS. Most of it runs already: files, sockets, threads, processes, time. The one piece I am not sure how to do right is randomness. Rust's std needs a random source, mainly to seed HashMap so it is not trivial to hash-flood, but also for anything user code does with it. So it wants something like
getrandom()
/
arc4random_buf()
. What I found on AROS: • `rand`/`random`/`srandom`exist, but they are the classic deterministic ones and need seeding. • `arc4random`is referenced in a couple of old places but not actually implemented. • No`/dev/urandom`, no`getrandom`, no random.device, no entropy pool that I can find. I understand the algorithm is the easy part. The real question is entropy: where should the unpredictable bytes come from on AROS? Right now my Rust code just mixes weak stuff (ASLR addresses, timer jitter), which is fine for HashMap keys to differ per run but is not secure. So my questions: 1. Is there already a plan or preferred way to provide entropy / a`getrandom`on AROS that I missed? 2. On the hosted ports, is it acceptable to pull entropy from the host libc (`arc4random_buf`via hostlib.resource), the same way we already borrow the host clock and host sockets? 3. For native AROS, is anyone thinking about an entropy source (interrupt/timer jitter pool, or a platform hardware RNG)? This would help anything doing TLS/crypto, not just Rust. I am happy to contribute code if there is agreement on the shape. Just did not want to invent my own thing if a direction already exists. Thanks for your lights...