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

Serialize and Deserialize Uncompressed #99

Closed
wants to merge 4 commits into from

Conversation

gakonst
Copy link
Contributor

@gakonst gakonst commented Feb 17, 2020

This PR defines a new serialization trait which directly serializes a group element in its uncompressed form. In addition, I found it reasonable to add the serialization trait bounds in the AffineCurve trait.

&self,
output_buf: &mut [u8],
) -> Result<(), crate::serialize::SerializationError> {
let len = <Self as CanonicalSerialize>::buffer_size();
Copy link
Contributor

Choose a reason for hiding this comment

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

What about using the field buffer size here instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kobigurk
Copy link
Contributor

Also seems like it needs cargo fmt

@Pratyush
Copy link
Member

What do you think about adding these as new methods on the Canonical{Serialize,Deserialize} traits? Instead of adding new traits?

@gakonst
Copy link
Contributor Author

gakonst commented Feb 19, 2020

This would mean we'd need to implement the uncompressed methods for Fields as well which I wanted to avoid since I did not need it anywhere (and did not see when it'd be used). When would (de)serializing uncompressed fields be useful?

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.

3 participants