You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #816: secp256k1-sys: remove CPtr impl for &[T] and associated weirdness
debae90 secp256k1-sys: remove CPtr impl for &[T] (Andrew Poelstra)
2cef561 key.rs: clean up some pointer mangling in sort_pubkeys() (Andrew Poelstra)
44bcb89 ellswift: remove unused `data` argument from `shared_secret` (Andrew Poelstra)
2139aff secp256k1-sys: fix type signature in secp256k1_ec_pubkey_sort (Andrew Poelstra)
Pull request description:
Fixes the signature of secp256k1_ec_pubkey_sort to use `*mut` rather than `*const`.
Separately, our call to `secp256k1_ec_pubkey_sort`, while correctly starting from a `&mut [PublicKey]`, briefly constructed a `&[ffi::PublicKey]` slice before obtaining a `*mut` pointer from this. This was unsound for completely unnecessary reasons, and only compiled because we have an impl of the `CPtr` trait for `&[T]`, which provides a `as_mut_c_ptr()` method which basically cannot be safely used.
Removing that `&[T]` impl revealed another case where it was (unnecessarily) being used: in `EllSwift::shared_secret`, where we use it to obtain a `*mut` pointer from a `&[u8]`, which we pass across the FFI boundary which simply drops it.
ACKs for top commit:
tcharding:
ACK debae90
Tree-SHA512: 2245883cbd0695dcf495a075d530155c6f496cf7fe78c2560b567888dc5fb5f3160970c8bbd44abd67e240bccf41555fc71fd3f74daac11d446fc2b4783028ed
0 commit comments