-
Notifications
You must be signed in to change notification settings - Fork 79
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
Crypto: Refactor the whole crypto package by using a new custom crypto implementation #81
Comments
A refactor of the crypto package is needed, but due to the large dependency and |
Words "custom" and "crypto" don't play together well in my head and this issue seems unclear to me. It would be nice if someone untangled it. Non constant-timeness was mentioned in the #283 by @decentralisedkev, but I'm also not sure about that. Correct me if I'm wrong, but we do have constant-time P256 (and that is another name for Secp256r1) implementation in |
I proposed to use go native package before.. I don’t think, that it’s a huge problem, including if it is used only for tests. |
if someone thinks otherwise, there is a golang repository on github, where you can make changes under the leadership of the community, as well as go through a review and audit of your code. otherwise, a self-written solution looks more dangerous than using a standard library |
I opened an issue a while ago along the lines of “implement secp256r1 in constant time” . I believe Neó uses a Koblitz curve and so it should say secp256k1. The implementation for this which was being used in master was not constant time because it used big.Int. In another issue I linked to a golang discussion where they were debating implementing a constant time big.Int implementation. If you want to use big.Int as it is easier to implement, I would suggest including a warning stating that it is not constant time. Rolling your own crypto is different than implementing an already established protocol. The former can be implanted properly, but fail theoretically. The latter usually has security proofs and or years of usage. In both cases, you would need an audit though which is nothing out of the ordinary in the blockchain space |
Can you pass link to neo lines of code, where is it used? |
@im-kulikov If there is a way to implement secp256k1 in constant time using the standard lib, then that would be my fault for missing that |
Can you pass link to neo lines of code, where is it used? I’m on mobile, if you check the elliptic curve section in neo-python or c# the curve parameters will indicate whether it is secp256k1 or P256 |
NEO C# implementation has defined both Secp256k1 and Secp256r1: but in this repo nothing uses Secp256k1, only Secp256r1 is being used. Also, our own dev branch has a README.md with the following line:
|
Yep, #245. I guess I started looking at the issues list from wrong side and thus missed it. Probably this discussion would be more relevant there, although it makes this issue even more vague. |
|
Closing as unclear. |
There is a lot that could be more optimized and NEO addresses are generated in a wrong way, this is caused by appending bytes that should not be appended. Hence before working on the Wallet implementation, the refactoring of the crypto package should be in place.
The text was updated successfully, but these errors were encountered: