-
Notifications
You must be signed in to change notification settings - Fork 230
elliptic-curve: make FromEncodedPoint return a CtOption
#782
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
Conversation
Internally `k256`/`p256` return a `CtOption` for this method, then convert to an `Option`. It would be helpful when implementing other traits from the `group` crate, e.g. `GroupEncoding`, if this instead returned a `CtOption`.
0b57d60 to
b5911b5
Compare
Corresponding changes for: RustCrypto/traits#782 Internally these were already returning `CtOption` anyway. It should also simplify the implementation of `GroupEncoding`.
Corresponding changes for: RustCrypto/traits#782 Internally these were already returning `CtOption` anyway. It should also simplify the implementation of `GroupEncoding`.
|
I believe a corresponding change to ToCompactEncoding to return a CtOption instead of an Option would help with chaining key construction. The complexity in switching between CtOption and Option in the steps in: https://github.com/helium/helium-crypto-rs/pull/20/files#diff-522b3f5cfeb12570fd7f3eb9445fbe8a5151dadd10e4dc51ca79d2de9b51c9deR211-R230 doesn't smell right, does it. I tried putting together a patch here but got lost in the elliptic_curves crate picking up that patch without newer commits creeping in |
|
Yes, sorry, this got missed when Regarding that code example, there's an impl of |
I guess I'll await the change to trickle in since I couldn't get the parts to fit together right trying to make a PR for the two relevant crates.
Ah yes! I missed that, updated. Thanks for the pointer |
|
It's a breaking change, so we can't fix it until the next minor version bump |
completely understand |
Internally
k256/p256return aCtOptionfor this method, then convert to anOption.It would be helpful when implementing other traits from the
groupcrate, e.g.GroupEncoding, if this instead returned aCtOption.