You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve performance of ring::rand using getrandom() for 257-byte outputs #353
Currently we use the fact that getrandom() will never return a partial result if the requested output is 256 bytes or less, as specified in the getrandom man page. In particular, if we need more than 256 bytes of output then issue multiple syscalls for (up to) 256 bytes. I wrote that code on the assumption that we'd never need more than 256 bytes of output in a performance-sensitive situation.
However, the new RSA blinding code from #283 often needs 257 bytes of output, so the assumption is now wrong. Therefore, we should change the code to ask for all the random bytes at once in the getrandom syscall, handling the case where the syscall returns only a partial result by looping.
Activity
kimhyunkang commentedon Nov 17, 2016
I'm trying to start contributing to ring, and I'd like to take this.
briansmith commentedon Nov 17, 2016
Awesome!
Allow calling `getrandom` with 257-byte buffer
Allow calling `getrandom` with 257-byte buffer
Allow calling `getrandom` with 257-byte buffer
briansmith commentedon Dec 21, 2016
Done in #355.