secp256k1-sys: remove CPtr
impl for &[T]
and associated weirdness
#816
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theCPtr
trait for&[T]
, which provides aas_mut_c_ptr()
method which basically cannot be safely used.Removing that
&[T]
impl revealed another case where it was (unnecessarily) being used: inEllSwift::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.