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

bip-0374: fix challenge generation, use correct generator point #1734

Merged
merged 2 commits into from
Dec 28, 2024

Conversation

guggero
Copy link
Contributor

@guggero guggero commented Dec 28, 2024

Both generating and verifying a proof allows for specifying a custom generator point G. But that custom generator point was not passed into the dleq_challenge function, resulting in the default (secp256k1) generator point to be used. This lead to the test vectors being incorrect.

Noticed this while re-implementing DLEQ proof generation and verification in Golang.

Both generating and verifying a proof allows for specifying a custom
generator point G. But that custom generator point was not passed into
the dleq_challenge function, resulting in the default (secp256k1)
generator point to be used. This lead to the test vectors being
incorrect.
@jonatack
Copy link
Member

cc @andrewtoth @RubenSomsen @theStack for feedback

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK, at first glance the fix LGTM.

Copy link
Contributor

@andrewtoth andrewtoth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Might make sense to also remove the default value for G in dleq_challenge.

To avoid the mistake fixed in the previous commit, we remove the default
value from the G parameter of dleq_challenge.
@guggero
Copy link
Contributor Author

guggero commented Dec 28, 2024

Thanks! Might make sense to also remove the default value for G in dleq_challenge.

Makes sense. Added a commit to remove the default value.

Copy link
Contributor

@andrewtoth andrewtoth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK e141b95

@jonatack
Copy link
Member

ACK

@jonatack jonatack merged commit 6c807b7 into bitcoin:master Dec 28, 2024
4 checks passed
@jonatack
Copy link
Member

jonatack commented Dec 28, 2024

There are a couple of unrelated other issues with this file, if it is intended to be run:

  • File permissions, i.e. 755
  • File header #!/usr/bin/env python3

@guggero guggero deleted the bip-0374-test-vector-fix branch December 28, 2024 22:18
@theStack
Copy link
Contributor

Post-merge ACK e141b95

Thanks for fixing!

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

Successfully merging this pull request may close these issues.

4 participants