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

Use the getrandom system call on Linux when it is available in CRYPTO_sysrand #148

Closed
briansmith opened this issue Mar 12, 2016 · 3 comments

Comments

@briansmith
Copy link
Owner

This should be faster than using /dev/urandom. Also, it would be better for sandboxed applications that want to block open and read syscalls completely.

This may obviate the need for the hwrand+ChaCha20 optimization and/or the /dev/urandom buffering. We should benchmark getrandom vs. the current CRYPTO_sysrand implementation vs. the hwrand+ChaCha20 optimization.

@DemiMarie
Copy link

I doubt it will solve the speed issue unless the kernel algorithms have changed. See my comment on #58 (tl;dr the kernel uses very slow algorithms).

@briansmith briansmith self-assigned this May 13, 2016
@briansmith
Copy link
Owner Author

This is now #176. One issue is that Travis CI only natively supports Ubuntu 12.04 and Ubuntu 14.04, and the first Ubuntu with getrandom is Ubuntu 16.04. Apparently we could in theory use the Travis CI Docker support (see https://docs.travis-ci.com/user/docker/), but that seems way too complicated. For now I'm just going to punt on the Travis CI testing and do the testing locally instead.

@briansmith
Copy link
Owner Author

This was done a while back. See https://briansmith.org/rustdoc/ring/rand/struct.SystemRandom.html for the documentation.

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

No branches or pull requests

2 participants