-
Notifications
You must be signed in to change notification settings - Fork 245
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
Add functional-style methods for keys #415
Comments
Agreed. The |
Is resolution of this issue achieved by removing the implementations of
We have implementations of FTR I don't see why implementing |
This issue is about I think the issue would be resolved by adding |
oh my bad, I looked at EDIT: oh boy, I wasn't even in the right repo, face palm. |
I was thinking about ops too. One issue is the operations currently accept slice and return |
The reason we take a slice is that this API is intended for use where you are adding a (hashed) tweak to a key. This is for BIP32 and Taproot. We regret exposing such a low-level API for these two applications. Zero is a valid tweak so we cannot take a We explicitly do not want to support adding public keys together, as part of our general "don't expose primitives to roll your own crypto" philosophy in libsecp. Unfortunately, we do expose this in the |
That's why I suggested adding
Interesting. I definitely see value in discouraging people from implementing their own crypto. I wonder if the approach of not exposing some fundamental operations is the best one. The thing is there are also people who roll well-reviewed crypto and those have then harder time using it and implementing it, paradoxically worsening security because of increased implementation complexity. I could get behind avoiding operators and instead have methods with some reasonable name and documentation warning about potential pitfalls. |
Methods like
add_assign
are annoying to use because the variable changes meaning after the operation and renaming it is awkward. This could be trivially fixed by adding methods copying the input and performing the operation.The text was updated successfully, but these errors were encountered: