Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teach util/entropy.c about other APIs #83

Open
cperciva opened this issue Nov 5, 2017 · 4 comments
Open

Teach util/entropy.c about other APIs #83

cperciva opened this issue Nov 5, 2017 · 4 comments

Comments

@cperciva
Copy link
Member

cperciva commented Nov 5, 2017

Linux 3.17+ has getrandom(2). Linux also has getentropy(3), which theoretically behaves the same way as the getentropy(2) in OpenBSD 5.6+. FreeBSD has the kern.arandom sysctl. iOS has SecRandom. Windows has CryptGenRandom.

@gperciva
Copy link
Member

Is the idea that we use those other APIs instead of /dev/urandom and only fall back to that if they fail?

@cperciva
Copy link
Member Author

cperciva commented Apr 21, 2018 via email

@gperciva gperciva mentioned this issue Jul 19, 2018
@gperciva
Copy link
Member

I'm guessing that you'll want a

entropy_linux_getrandom.c

(like alg/sha256_shani.c or crypto/crypto_aes_aesni.c). Do you think that should stay in the util/ directory, or should we move it to a new entropy/ directory? i.e. the first step would be moving util/entropy.{ch} to entropy/entropy.{ch}.

(I've had this code ready to go for a while, but I thought that we should get the current round of releases done before adding it.)

@cperciva
Copy link
Member Author

I'd prefer to keep it in /util/. In general, that's where non-POSIX bits belong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants