-
Notifications
You must be signed in to change notification settings - Fork 182
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
Deprecate and remove getrandom_uninit
#454
Comments
Copying from #439 Is it worth keeping the
|
When working on Memory Sanitizer support (#463), I realized that the In particular, if/when we update the signature of custom implementations to take |
In ring, currently I do use the pattern |
I don't think that |
+1 to keeping it |
I think it is fine to keep it. We have this unsafe code in |
Sounds good to me. Personally, I think the only strong argument to keep it is @briansmith's point about sanitizers, but that is a very good point. |
I had proposed and implemented
getrandom_uninit
as a safer alternative to the "raw" API proposed in #279. @josephlr has pointed out that we ended up adding a non-trivial amount ofunsafe
code for this, but there really isn't a significant performance benefit, and he suggested we remove it in the next breaking release. We've recently decided not to build other primitives like #281 on top of it within getrandom itself.The only time there would really be a performance benefit is if one were randomly-initializing an abnormally-large (for cryptography code) buffer.
Off the time of my head, would be in the implementation of RSA (or similar) blinding on non-SIMD 32-bit targets, where we could have (8192 / 32) = 256 words to zero before calling
getrandom
if we don't havegetrandom_uninit
. Still, the syscall and actual CSPRNG computation cost is going to dominate that, and also blinding implementations typically reuse the buffer for the blinding so that the initial zeroing would only need to be done the very first time (per blinding context), so the zeroing cost is neglibile.The text was updated successfully, but these errors were encountered: