zkBob / fawkes-crypto

Fawkes-Crypto - zkSNARKs framework
https://github.com/zeropoolnetwork/fawkes-crypto
Apache License 2.0
2 stars 1 forks source link

Add compress, decompress_unchecked, and is_in_prime_subgroup methods #5

Closed AllFi closed 1 year ago

AllFi commented 1 year ago

In this PR, the following was done:

  1. Implemented EdwardPoint::compress method that packs X coordinate and the sign of Y in 32 bytes.
  2. Implemented EdwardPoint::decompress_unchecked method that restores the point serialized with the previous method without checking that the point is in the prime subgroup.
  3. Implemented EdwardPoint::is_in_prime_subgroup method that checks that the point is in the prime subgroup.
  4. Added unit tests that check the aforementioned methods work properly.

The reason why it could be useful is described at https://github.com/zkBob/zkbob-pool-storage/issues/2.