Skip to content

Add compress, decompress_unchecked, and is_in_prime_subgroup methods#9

Open
AllFi wants to merge 4 commits intomasterfrom
feature/decompress_unchecked
Open

Add compress, decompress_unchecked, and is_in_prime_subgroup methods#9
AllFi wants to merge 4 commits intomasterfrom
feature/decompress_unchecked

Conversation

@AllFi
Copy link

@AllFi AllFi commented Feb 22, 2023

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.

Refs and implementation examples:

Note: fawkes-crypto uses optimized parameters of twisted edwards curve so the formulas in this PR and in the examples above are different. This transformation is explained in Theorem 4.1 of this proposal.

@AllFi AllFi marked this pull request as ready for review March 1, 2023 11:17
@lok52
Copy link

lok52 commented Mar 1, 2023

Do we have any additional trust assumptions regarding new cold storage EC points format?
https://github.com/zkBob/zkbob-pool-storage/issues/2#issuecomment-1405081627

@AllFi
Copy link
Author

AllFi commented Mar 1, 2023

Do we have any additional trust assumptions regarding new cold storage EC points format?
https://github.com/zkBob/zkbob-pool-storage/issues/2#issuecomment-1405081627

If I haven't made any mistakes in zkBob/libzeropool-zkbob#8 then we don't have any additional trust assumptions. We still check everything that we checked before but in a different order.

@AllFi AllFi force-pushed the feature/decompress_unchecked branch from 6f26a94 to a6a9b53 Compare December 11, 2023 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants