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

Customizable serialization for SWCurveConfig and TECurveConfig #467

Merged
merged 4 commits into from
Sep 6, 2022

Conversation

alexander-zw
Copy link
Collaborator

@alexander-zw alexander-zw commented Sep 4, 2022

Description

closes: #308


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

@alexander-zw alexander-zw self-assigned this Sep 4, 2022
let zero = Self::BaseField::zero();
match compress {
Compress::Yes => zero.serialized_size_with_flags::<TEFlags>(),
Compress::No => zero.uncompressed_size() + zero.uncompressed_size(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed this from x.uncompressed_size() + y.uncompressed_size() to zero.uncompressed_size() + zero.uncompressed_size(). Is there a difference? Aren't they all the same field? With this change this function is independent of the affine element.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The tests passed after this change, though I'm not sure how well serialize size is tested

Copy link
Member

Choose a reason for hiding this comment

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

It's the same right now, but if it's simpler we can keep the old behaviour.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The new behavior is simpler. In the new behavior the size doesn't depend on the curve element, in the old behavior it referenced the curve values. So should we keep the behavior in this PR right now?

@Pratyush Pratyush changed the title Move serialization methods into curve config for SW and TE Customizable serialization for SWCurveConfig and TECurveConfig Sep 6, 2022
@Pratyush Pratyush merged commit 0e7d401 into arkworks-rs:master Sep 6, 2022
@alexander-zw alexander-zw deleted the serialize branch September 6, 2022 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants