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

Serde serialization. #30

Closed
afck opened this issue May 15, 2018 · 3 comments
Closed

Serde serialization. #30

afck opened this issue May 15, 2018 · 3 comments

Comments

@afck
Copy link
Contributor

afck commented May 15, 2018

We're using merkle's Proofs in messages that need to be serialized, and want to support Serde in addition to protobuf, so I added a very crude serialization-serde feature in my fork: afck@dd41698

Unfortunately Proof can't just be deserialized, so we added a ProofData that doesn't contain the algorithm field, and conversion functions.

Would you be interested in merging something like that into master? Is there a better way to handle proof deserialization?

@romac
Copy link
Member

romac commented May 15, 2018

That would indeed be nice to have, though I wonder if there is indeed a better way to handle proof deserialization without having ProofData. Perhaps by writing manual Serialize/Deserialize instances for Proof, and encoding the Algorithm as eg. a string equals to the name of the corresponding static in ring::digest, ie. SHA1, SHA256, SHA384, SHA512, SHA512_256.

What do you think?

@afck
Copy link
Contributor Author

afck commented May 15, 2018

Good idea! Supporting the constants in ring::digest should be sufficient for most use-cases. I'll give it a try.

afck added a commit to afck/merkle.rs that referenced this issue May 15, 2018
This adds the `serialization-serde` feature, which implements
serde's `Serialize` and `Deserialize` traits for `Proof` and `Lemma`.

Fixes SpinResearch#30
afck added a commit to afck/merkle.rs that referenced this issue May 15, 2018
This adds the `serialization-serde` feature, which implements
serde's `Serialize` and `Deserialize` traits for `Proof` and `Lemma`.

Fixes SpinResearch#30
@afck afck mentioned this issue May 15, 2018
@romac romac closed this as completed in #32 May 15, 2018
romac pushed a commit that referenced this issue May 15, 2018
This adds the `serialization-serde` feature, which implements
serde's `Serialize` and `Deserialize` traits for `Proof` and `Lemma`.

Fixes #30
@romac
Copy link
Member

romac commented May 15, 2018

@afck Thank you for the PR! Just published v1.7.0 to crates.io with your changes :)

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

No branches or pull requests

2 participants