Skip to content

Customizable serialization for SWCurveConfig and TECurveConfig - #467

Merged
Pratyush merged 4 commits into
arkworks-rs:masterfrom
alexander-zw:serialize
Sep 6, 2022
Merged

Customizable serialization for SWCurveConfig and TECurveConfig#467
Pratyush merged 4 commits into
arkworks-rs:masterfrom
alexander-zw:serialize

Conversation

@alexander-zw

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

Copy link
Copy Markdown
Collaborator

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
Comment thread ec/src/models/short_weierstrass/affine.rs
Comment thread ec/src/models/short_weierstrass/affine.rs
Comment thread ec/src/models/short_weierstrass/affine.rs
Comment thread ec/src/models/short_weierstrass/affine.rs
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

Enable specialization of subgroup checks, scalar mul using GLV, deserialization, etc via SW/TEModelParameter traits

2 participants