-
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
Changes from 1 commit
f5f90af
07922fd
7c56bcc
9615ec8
4dd861f
3b0232a
00c8c75
6d938d3
ec66003
c492c75
dc04575
ebdaec7
40a8b65
8a43317
d611a4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -307,6 +307,10 @@ impl KeyAggCache { | |
/// let _agg_pk = key_agg_cache.agg_pk(); | ||
/// # } | ||
/// ``` | ||
/// | ||
/// # Panics | ||
/// | ||
/// Panics if an empty slice of pubkeys is provided. | ||
pub fn new<C: Verification>(secp: &Secp256k1<C>, pubkeys: &[&PublicKey]) -> Self { | ||
let cx = secp.ctx().as_ptr(); | ||
|
||
|
@@ -729,6 +733,10 @@ impl AggregatedNonce { | |
/// let aggnonce = AggregatedNonce::new(&secp, &[&pub_nonce1, &pub_nonce2]); | ||
/// # } | ||
/// ``` | ||
/// # Panics | ||
/// | ||
/// Panics if an empty slice of nonces is provided. | ||
/// | ||
pub fn new<C: Signing>(secp: &Secp256k1<C>, nonces: &[&PublicNonce]) -> Self { | ||
if nonces.is_empty() { | ||
panic!("Cannot aggregate an empty slice of nonces"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I swear there is a clippy lint to rewrite this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, it's |
||
|
@@ -1140,6 +1148,10 @@ impl Session { | |
/// assert!(aggregated_signature.verify(&secp, &agg_pk, &msg_bytes).is_ok()); | ||
/// # } | ||
/// ``` | ||
/// | ||
/// # Panics | ||
/// | ||
/// Panics if an empty slice of partial signatures is provided. | ||
pub fn partial_sig_agg(&self, partial_sigs: &[&PartialSignature]) -> AggregatedSignature { | ||
if partial_sigs.is_empty() { | ||
panic!("Cannot aggregate an empty slice of partial signatures"); | ||
|
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.
It still passes a danging pointer into the C code. Is it a valid operation? I think we ought to
assert!(!pubkeys.is_empty())
.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.
In a later commit 40a8b65 I add this assertion. Sorry, these changes wound up in a bad order. I think originally they were next to each other and then I moved "docs only" stuff near the start to help reviewers understand where I was going with the PR.