Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Serialization of GroupAffine #14

Closed
debris opened this issue Apr 13, 2020 · 3 comments · Fixed by #129
Closed

Serialization of GroupAffine #14

debris opened this issue Apr 13, 2020 · 3 comments · Fixed by #129

Comments

@debris
Copy link

debris commented Apr 13, 2020

Version:

latest master


Overview:

I stumbled upon a problem while using zexe CanonDeserialization for bls12_381::G1Affine.


Details:

I have an existing code which utilizes zkcrypto/pairing library.

That code reads a 96 bytes long uncompressed G1Affine:

0x0db882cf5db3e8567f16b4db1772d4d1f5a3fe8d62f0df2eb8a5cfa50806702afde8fc25335eb5ec859c2818b2610b2e19ab445dac720bb1f2b0cd3336f7a1acc62bf1b3a321826264dc7e469281e23b218394d598689da04e136878ff9a7897

by calling pairing::bls12_381::G1Uncompressed(data).into_affine()

I expected algebra::CanonDeserialization::deserialize to correctly read this data as well, but it does not work.

I also tried reading compressed G1Affine, but it also does not work.


Questions:

  • Is it a bug or is the serialization format different in zexe? If it's different, is it documented somewhere?
  • I'm using zexe for zcash sapling verification in no-std environments. debris/zexe-sapling. For now I added pairing-like deserialization there, but it would be nice if it was supported out of the box in zexe.
@paberr
Copy link

paberr commented Apr 23, 2020

Questions:

  • Is it a bug or is the serialization format different in zexe? If it's different, is it documented somewhere?

Maybe, to quickly answer this part of the questions: Yes, the serialization format is different. zkcrypto uses a distinguisher bit, which zexe doesn't have.

@Pratyush
Copy link
Member

A solution for the interim is to make a separate deserialize_zk_crypto function which deserializes from the format used by zkcrypto.

@Pratyush Pratyush transferred this issue from arkworks-rs/snark Nov 20, 2020
@Pratyush
Copy link
Member

This is fixed now with #129

@Pratyush Pratyush linked a pull request Oct 20, 2022 that will close this issue
6 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants