-
Notifications
You must be signed in to change notification settings - Fork 110
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
Non-additive feature flags are problematic #69
Comments
Enabling only a single curve is by design. No cryptographic system should use multiple curves simultaneously. |
There is an established idiom for naming things in Rust libraries, though: https://rust-lang-nursery.github.io/api-guidelines/naming.html IMO following that consistently should generally be preferred over personal taste (though obviously there are backwards compatibility concerns at this stage). |
I think that because of the backwards compatibility issue it will not be possible to change it now. But we should definitely follow the established idiom . Thanks! |
having said that - I would love to see an additive feature version of Curv library. It would be really interesting and useful (we get this request a lot) |
One version to do this would be to split this repository into five separate crates, one per curve + one base crate that only holds the common traits. This would make things more obvious. Then you could keep the shared curv crate as a high-level interface that depends on all of these others. Still, this adds quite a bit of extra complexity. IMO it would be better to bite the bullet and simply stop providing the top-level types. With some reorganization, this means that dependencies add an extra path component to their imports ( |
cc: @oleiba exactly what we have talking about. |
We worked around this issue, by having the depending library to use For example, we have https://github.com/KZen-networks/gotham-city which depends both on https://github.com/KZen-networks/curv directly with feature So we added an additional tag on |
So if you use that as a backwards compatibility shim for now, then it should also be fine to change things to not have the top-level exports in a 0.3 release? |
Yes, we now follow semver semantics so you can break backwards compatibility and update the version accordingly, e.g. 0.2.0 -> 0.3.0. |
Currently you cannot compile curv with more than one of the specific curve features enabled due to the top-level
FE
,GE
,PK
,SK
aliases. Please note that this is generally discouraged, because in a complex application there might be a dependency graph that wants to enable different curves, and this will result in compile failures in curv.(Also, I really dislike these two-letter type names and the fact that there are two sets of aliases for each curve. IMO, using
PublicKey
andSecretKey
consistently instead would make code using curv much more readable.)The text was updated successfully, but these errors were encountered: