zkcrypto / bls12_381

Implementation of the BLS12-381 pairing-friendly elliptic curve group
Other
304 stars 178 forks source link

Basic serde support for Scalar, G1 and G2 (Fix #57) #61

Open akakou opened 3 years ago

akakou commented 3 years ago

Fix CI error of #57.

This PR makes this library support structs as below to serde.

  • Scalar
  • G1Affine and G1Projective
  • G2Affine and G2Projective
akakou commented 3 years ago

It related to #35, #38, #57.

str4d commented 3 years ago

I think this PR needs a rebase now that #64 has been merged.

Also, as a heads up: this PR is unlikely to be part of bls12_381 0.5.0 (which will be cut later this week) due to time constraints. But since the (implicit) serde feature flag is completely optional, we could include it in a subsequent point release.

akakou commented 3 years ago

Thank you for your reply! I rebased it, so could you check this PR?

ma2bd commented 3 years ago

Any time estimate for the landing of this PR? Serde is useful not only for serialization but also for the generation of correct message hashers (see https://crates.io/crates/bcs).

akakou commented 2 years ago

@str4d

I solved the conflicts. Could you check and merge this PR? (I hope the PR be merged before when the next conflict occurs.)

ebfull commented 1 year ago

We introduced serde support in the pasta_curves crate here: https://github.com/zcash/pasta_curves/pull/48

The implementation uses serde's is_human_readable to check whether the format it's encoding into is human readable (and so needs a hex serialization for readability) or not (in which case a raw byte encoding is appropriate). We'd want to do something similar in this PR as well.