-
Notifications
You must be signed in to change notification settings - Fork 457
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
Apply nonce bit-length mitigation to stop timing leakage. #203
Conversation
Hi @indutny, is there any movement on this? This project is used by many others and remains likely vulnerable and not fixed months after our disclosure. |
Thanks for the PR, just wandering by (edit: bump & witness) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you for submitting this and sorry for delay. There are few minor changes that I'd like to request before landing it, though!
Co-Authored-By: Fedor Indutny <fedor.indutny@gmail.com>
Fixed those. Please test the changes (and timing). |
Ported from elliptic-js: indutny/elliptic#203
Hey, I've went ahead and applied alternative "fix": ec735ed . However, as bad as it sounds it must be said that this library was never meant to be timing-leak free. Architecture of elliptic and bn.js was designed to provide the fastest possible pure JS implementation of elliptic curve so that it would be usable in browsers. Patching this one particular loophole doesn't mean that there are no other side-channels (in fact, there are many through the source code). |
This should be a mitigation for the Minerva attack. See https://minerva.crocs.fi.muni.cz for more info. Some tests would be nice to see this is really constant time (and wasn't before), but I am not that well versed in JavaScript.