Then I saw the suggestion raised in #35 by @hdevalence and thought that it would be nice to convert our impl to a feature-gated behind a serde feature.
So I modified our impl according to the gate-feature suggestion and made the PR.
Adds serde impl for:
G1Affine
G2Affine
G2Prepared which then required Fp, Fp2 & Fp6 serde impls.
All the implementations will make the deserialization fail if any of the items is not canonically-encoded.
Appart from that, I think that implement Write and Read for these types would be also nice, since sometimes, you just want to move the point structures as bytes but without doing any compresions/decompressions, having them "serialized" as bytes (which would be much more performant). See: https://github.com/dusk-network/plonk/issues/190 where a Proof takes a considerable amount of time to be deserialized just because we call decompression for each point we store on it computing the security checks.
I added the serde feature to the default features group, but feel free to remove it from there since Idk if everyone will want the feature enabled by default.
A few weeks ago, I needed
serde
implementations for the types that this library exports, so I coded them on our fork: https://github.com/dusk-network/bls12_381Then I saw the suggestion raised in #35 by @hdevalence and thought that it would be nice to convert our impl to a
feature-gated behind a serde feature
.So I modified our impl according to the gate-feature suggestion and made the PR.
Adds serde impl for:
G1Affine
G2Affine
G2Prepared
which then requiredFp
,Fp2
&Fp6
serde impls.All the implementations will make the deserialization fail if any of the items is not
canonically-encoded
.Appart from that, I think that implement
Write
andRead
for these types would be also nice, since sometimes, you just want to move the point structures as bytes but without doing any compresions/decompressions, having them "serialized" as bytes (which would be much more performant). See: https://github.com/dusk-network/plonk/issues/190 where aProof
takes a considerable amount of time to be deserialized just because we calldecompression
for each point we store on it computing the security checks.I added the
serde
feature to thedefault
features group, but feel free to remove it from there since Idk if everyone will want the feature enabled by default.