Skip to content
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

Musig: Minor comment corrections #296

Closed
wants to merge 1 commit into from

Conversation

siv2r
Copy link
Contributor

@siv2r siv2r commented Aug 28, 2024

Changes:

@siv2r
Copy link
Contributor Author

siv2r commented Aug 28, 2024

secp256k1_fe_normalize_var(&pk.y);
/* Negate sk if secp256k1_fe_is_odd(&cache_i.pk.y)) XOR cache_i.parity_acc.
* This corresponds to the line "Let d = g⋅gacc⋅d' mod n" in the
* specification. */
if ((secp256k1_fe_is_odd(&cache_i.pk.y)
!= cache_i.parity_acc)) {
secp256k1_scalar_negate(&sk, &sk);
}

I'm not sure why pk.y is being normalized here. Shouldn't cache_i.pk.y be normalized instead? That's the one passed to the fe_is_odd function, which requires the field element to be normalized.

Just a side note: all tests still pass even after removing this function call (line 579).

@siv2r siv2r mentioned this pull request Aug 28, 2024
@jonasnick
Copy link
Contributor

Thanks, I think all the corrections were either addressed or pointed out in the PR to upstream libsecp256k1.

@jonasnick
Copy link
Contributor

I think it's best if we merge the PR in upstream libsecp first and then merge the changes to this repo.

@real-or-random
Copy link
Collaborator

I think it's best if we merge the PR in upstream libsecp first and then merge the changes to this repo.

Yes, this can be closed then. Updating to the upstream musig module is tracked in #301.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants