-
Notifications
You must be signed in to change notification settings - Fork 78
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
Speed compare with python-ecdsa? #45
Comments
Without knowing the details of the changes you made with
I'm happy to look at this further (and if it's a matter of |
Looking further at the merge request you have these are candidates for the increase in speed as well -
I think pre-computation can be considered as an optimization for this package but if I remember correctly 2ary NAF leaks timing information that can be used to gain knowledge of the secret key. |
that would most likely explain this: that being said,
it is just a python binding to
no, the private keys use the full size of the order for a given curve
yes, both precomputation and NAF leak, but it does matter only for signing and keypair generation, not for signature verification |
Based on the GMP documentation it seems implicit that unless otherwise specified (e.g. unless there is an explicit secure function for an operation) that operations are suitable for cryptography -
But perhaps that is an incorrect reading on my part. I'm happy to discuss further performance improvements here, but you're correct that doing some security tradeoffs will allow for bigger performance improvements, as seen in the changes you made for |
I personally would love to see some tradeoffs being applied to fastecdsa. |
I'll take a look at the best way to do this once the |
I'm afraid that they meant specifically the @EggPool :
the problem is that precomputing values for public keys is fairly expensive, if precomputation is used together with NAF, you'd need to verify at least 80-100 signatures made with one and the same key for the precomputation to break even |
I've looked a bit more into the GNU MP, and I'm pretty sure that the "useful for cryptography" is limited to functions explicitly listed in https://gmplib.org/manual/Low_002dlevel-Functions#Low_002dlevel-functions-for-cryptography:
|
I've recently merged a faster implementation of elliptic curve arithmetic to python-ecdsa (tlsfuzzer/python-ecdsa#127) and was trying to compare performance with this library, but I'm getting some silly numbers.
(after running
pip install -e .
I got the benchmark running, see #44 though)with
fastecdsa
50a3cdf I'm gettingwhile with current master of python-ecdsa (8deb089e7d5), with gmpy2 installed, I'm getting:
so for NIST192p, the combined sign and verify looks to be almost 3 times faster than
fastecdsa
, which doesn't make sense for the non-native code inpython-ecdsa
... Are the benchmark commands doing different things?The text was updated successfully, but these errors were encountered: