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

More flexible and deduplicated serialization #463

Merged
merged 10 commits into from
Sep 2, 2022
Merged

Conversation

Pratyush
Copy link
Member

@Pratyush Pratyush commented Aug 30, 2022

Description

closes: #130, #145, #461

depends on #447


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to GitHub issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the GitHub PR explorer

Copy link
Member

@weikengchen weikengchen left a comment

Choose a reason for hiding this comment

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

I went through all the files.

@Pratyush Pratyush force-pushed the improve-serialization branch 2 times, most recently from 5e6358a to 6ea3d4d Compare August 31, 2022 18:44
@Pratyush
Copy link
Member Author

@weikengchen There are a few changes here.

  • Serialization for Short Weierstrass curves now sets the flags to 0 if the y-coordinate is positive, 1 << 6 if it's a point at infinity, and 1 << 7 if the y-coordinate is negative.
  • Serialization for Twisted Edwards curves now sets the flags to 0 if the y-coordinate is positive, and 1 if it's negative.
    I will add this information to the CHANGELOG.

I intend to add a PR that allows users to specify custom serialization/deserialization routines. This is useful, for example, for decoding bls12_381 points, since the standardized format for those curves differs from our standardized format. It would also be useful for users of 0.3 that need to maintain compatibility with the old way of serialization/deserialization.

We should also prepare a migration guide that explains how to go about upgrading to 0.4 once we've finished the refactors.

@Pratyush
Copy link
Member Author

Pratyush commented Sep 1, 2022

I have updated the CHANGELOG now.

@Pratyush Pratyush added T-feature Type: new features T-design Type: discuss API design and/or research P-high Priority: high T-refactor Type: cleanup/refactor breaking-change This PR contains a breaking change labels Sep 1, 2022
@Pratyush Pratyush changed the title Improve serialization More flexible and deduplicated serialization Sep 2, 2022
@Pratyush Pratyush merged commit 8eb4e7a into master Sep 2, 2022
@Pratyush Pratyush deleted the improve-serialization branch September 2, 2022 17:50
@Pratyush Pratyush linked an issue Sep 2, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This PR contains a breaking change P-high Priority: high T-design Type: discuss API design and/or research T-feature Type: new features T-refactor Type: cleanup/refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Serialization with modes
2 participants