Skip to content

Conversation

stratospher
Copy link
Contributor

@stratospher stratospher commented Jan 7, 2022

Built on top of #26222.

This PR introduces Elligator swift encoding and decoding in the functional test framework. It's used in #24748 for writing p2p encryption tests.

@DrahtBot DrahtBot added the Tests label Jan 7, 2022
Copy link
Member

@sipa sipa left a comment

Choose a reason for hiding this comment

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

Cool! Nice to see this works.

I've left a number of comments to simplify the code.

@stratospher stratospher force-pushed the py-ellsq branch 2 times, most recently from 8cdf579 to e755867 Compare January 8, 2022 14:32
@stratospher
Copy link
Contributor Author

Thanks for your really nice review @sipa! I’ve addressed your comments. Ready for further review.

@stratospher
Copy link
Contributor Author

Thanks again @sipa! I’ve addressed your comments. Ready for further review.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 8, 2022

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK theStack, sipa

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #27452 (test: cover addrv2 anchors by adding TorV3 to CAddress in messages.py by pinheadmz)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@stratospher
Copy link
Contributor Author

Thanks again @sipa! I’ve addressed your comments. Ready for further review.

@stratospher
Copy link
Contributor Author

Made some changes to simplify the Elligator squared interface

  • interact with pubkeys instead of group elements. (added get_group_element() and set_from_curve_point() in ECPubkey for this purpose)
  • rename encode_bytes() to ellsq_encode() and decode_bytes() to ellsq_decode()
  • sort TEST_FRAMEWORK_MODULES in alphabetical order

@stratospher
Copy link
Contributor Author

Updated the elligator squared encoding function signature from ellsq_encode(pubkey) to ellsq_encode(pubkey, randombytes) in order to test the BIP 324 test vectors in python.

@theStack
Copy link
Contributor

Concept ACK

@stratospher stratospher changed the title test: add python implementation of Elligator squared test: add python implementation of Elligator swift Oct 3, 2022
@stratospher
Copy link
Contributor Author

@sipa
Copy link
Member

sipa commented Jun 28, 2023

@stratospher Want to rebase? It'd be good to get rid of the merge commit in this PR's history.

@stratospher
Copy link
Contributor Author

Rebased on master, updated to address review comment and to just use commits from 26222 which this depends on.

@maflcko
Copy link
Member

maflcko commented Jun 29, 2023

Are you sure you rebased on current master?

Copy link
Member

@sipa sipa left a comment

Choose a reason for hiding this comment

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

Code review ACK afd762a

Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

Code-review ACK afd762a

Regarding #24005 (comment), I've prepared at least adding the BIP324 decoding test vectors today (theStack@06c9424). Feel free to pick it up either in this PR or a follow-up.

stratospher and others added 3 commits June 29, 2023 23:32
Co-authored-by: Pieter Wuille <pieter.wuille@gmail.com>
remove util also since unit tests there were removed in bitcoin#27538

Co-authored-by: theStack <sebastian.falbesoner@gmail.com>
@stratospher
Copy link
Contributor Author

Thanks @sipa, @theStack! I've updated to include ellswift test vectors from BIP 324 + addressed review comments.

Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

ACK 4f4d039 🐊

Checked that since my previous ACK, review suggestions were tackled and the ellswift encoding/decoding test vectors were added (nice, wasn't aware of csv.DictReader)! Also verified that the added .csv files are identical to the ones from the BIP repository.

@DrahtBot DrahtBot requested a review from sipa June 29, 2023 21:52
@sipa
Copy link
Member

sipa commented Jun 30, 2023

ACK 4f4d039

@DrahtBot DrahtBot removed the request for review from sipa June 30, 2023 18:16
@fanquake fanquake merged commit 61d59fe into bitcoin:master Jun 30, 2023
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 1, 2023
4f4d039 test: add ellswift test vectors from BIP324 (stratospher)
a312877 test: Add ellswift unit tests (stratospher)
714fb2c test: Add python ellswift implementation to test framework (stratospher)

Pull request description:

  Built on top of bitcoin#26222.

  This PR introduces Elligator swift encoding and decoding in the functional test framework. It's used in bitcoin#24748 for writing p2p encryption tests.

ACKs for top commit:
  sipa:
    ACK 4f4d039
  theStack:
    ACK 4f4d039 🐊

Tree-SHA512: 32bc8e88f715f2cd67dc04cd38db92680872072cb3775478e2c30da89aa2da2742992779ea14da2f1faca09228942cfbd86d6957402b24bf560244b389e03540
kwvg added a commit to kwvg/dash that referenced this pull request Feb 14, 2024
kwvg added a commit to kwvg/dash that referenced this pull request Feb 14, 2024
kwvg added a commit to kwvg/dash that referenced this pull request Feb 14, 2024
kwvg added a commit to kwvg/dash that referenced this pull request Feb 15, 2024
@bitcoin bitcoin locked and limited conversation to collaborators Jun 29, 2024
@stratospher stratospher deleted the py-ellsq branch July 17, 2024 06:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
No open projects
Status: Needs review
Development

Successfully merging this pull request may close these issues.

8 participants