-
Notifications
You must be signed in to change notification settings - Fork 293
Followups to #716 (add musig2 API) #794
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
Merged
apoelstra
merged 15 commits into
rust-bitcoin:master
from
apoelstra:2025-05_musig2-followups
Jun 11, 2025
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f5f90af
fmt: stop blacklisting secp256k1-sys; just fmt whole crate
apoelstra 07922fd
musig: fix a couple FFI bindings
apoelstra 7c56bcc
clippy: whitelist a bunch of lints
apoelstra 9615ec8
context: whitelist new compiler warning
apoelstra 4dd861f
stop using deprecated thread_rng
apoelstra 3b0232a
musig: fix all the doctests
apoelstra 00c8c75
musig: remove outdated doc references to ZeroSession error
apoelstra 6d938d3
musig: add missing Panics sections to docs
apoelstra ec66003
musig: remove SessionSecretRand::new constructor
apoelstra c492c75
key: move pubkey_sort to method on Secp256k1; rename
apoelstra dc04575
musig: a couple small improvements of byte array APIs
apoelstra ebdaec7
musig: clarify doc comment about aggregate nonce proxy
apoelstra 40a8b65
musig: explicitly panic when given an empty slice of pubkeys to aggre…
apoelstra 8a43317
musig: add a bunch of unit tests
apoelstra d611a4f
musig: weaken/simplify warnings about nonce reuse
apoelstra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong. How can it sort keys without mutating them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh shit, you're right. I'm not sure what I was thinking here. (Well, probably I saw
const rustsecp256k1_v0_11_pubkey **pubkeys
and forgot that in C notation, an extra*
on the other end of the line will negateconst
).No worries, we haven't published this yet, so we can revert this particular change.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes, this unsoundness goes pretty deep.
In #627 we added an impl of
CPtr
for&[u8]
which implements anas_mut_c_ptr
function, which by itself is not unsound, but pretty-much any use of it will be unsound..This is how the original code (before I changed
*mut
to*const
erroneously) compiled and passed CI. It was using this function to get a*mut
pointer from a&[u8]
.This made it into 3 releases (secp-sys 0.9, 0.10 and 0.11). You can see it here: https://docs.rs/secp256k1-sys/latest/src/secp256k1_sys/lib.rs.html#1054-1072
Oops.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, untangled the threads. #816
I believe all released versions of our library are technically sound, though we expose a
<&[T]>::as_mut_c_ptr()
method which invites UB upon anybody who calls it.