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

feat(zk): impl CanonicalSerialize/Deserialize #1105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tmontaigu
Copy link
Contributor

This is to allow specifying whether data should be compressed as compression and validation adds a very signigicant overhead especially in wasm where deserialization goes from 6 min to 450ms

This is to allow specifying whether data should be compressed
as compression and validation adds a very signigicant overhead
especially in wasm where deserialization goes from 6 min to 450ms
@cla-bot cla-bot bot added the cla-signed label Apr 25, 2024
@tmontaigu
Copy link
Contributor Author

tmontaigu commented Apr 26, 2024

@kc1212 @dd23
Given this, I wonder if we remove the serde serialization for ZkPok entities since, it would be better sur rely on ark's canonical serialize/deserialize to pass the Compress and Validate options explicitely and if one want to use serde in a struct that embeds a zk pok think he could use something like #[serde(deserialize_with = "deser_function")] and specify its own default values for Compress/Validate in there

@kc1212
Copy link
Collaborator

kc1212 commented Apr 26, 2024

Is it possible to use #[serde(deserialize_with = "deser_function")] on G1, G2, etc when tfhe-zk-pok is used as a library? Or we'll have to write wrapper types?

@tmontaigu
Copy link
Contributor Author

Yes this should be possible

#[derive(serde::Deserialize, serde::Serialize)]
struct MyStruct<C: zk-pok::Curve> {
 #[serde(deserialize_with = "deser_function")]
 g1: C::G1
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants