Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor prove + verify to use helper functions #24

Open
2 tasks
jdwhite48 opened this issue Feb 2, 2022 · 0 comments
Open
2 tasks

Refactor prove + verify to use helper functions #24

jdwhite48 opened this issue Feb 2, 2022 · 0 comments
Assignees
Labels
restructure The API could be organized better

Comments

@jdwhite48
Copy link
Owner

jdwhite48 commented Feb 2, 2022

Related: #20

  • Currently, there is a lot of repeated code in prove that could be shared:

  • PPE and MSMEG2 have functionally identical computations for π, except that the commitment randomness for x, i.e. r, is a 1-column vector instead of a 2-column matrix R and the size of used randomness T is different. Call this e.g. prove_vars_in_G2.

  • PPE and MSMEG1 have functionally identical computations for θ, except that the commitment randomness for y, i.e. s, is a 1-column vector instead of a 2-column matrix S and the size of used randomness T is different. Call this e.g. prove_vars_in_G1.

  • MSMEG1 and QuadEqu have functionally identical computations for π, except that r is a 1-column vector instead of a 2-column and the size of T is different. Call this e.g. prove_scalar_vars_for_B2.

  • MSMEG2 and QuadEqu have functionally identical computations for θ, except that s is a 1-column vector instead of a 2-column and the size of T is different. Call this e.g. prove_scalar_vars_for_B1.

  • Similarly there is a lot of repeated code in verify that could be shared (although slightly less so):

  • PPE and MSMEG1 have functionally identical 1st and 3rd LHS terms (only differing in where variables originated before being committed) and identical 2nd RHS term. Call this private helper function e.g. verify_G1_vars.

  • PPE and MSMEG2 have functionally identical 2nd LHS term and identical 3rd RHS term. Call this e.g. verify_G2_vars.

  • MSMEG1 and QuadEqu have functionally identical 2nd LHS term and identical 3rd RHS term. Call this e.g. verify_scalar_consts_from_B2.

  • MSMEG2 and QuadEqu have functionally identical 1st and 3rd LHS terms and identical 2nd RHS term. Call this e.g. verify_scalar_consts_from_B1.

@jdwhite48 jdwhite48 added the restructure The API could be organized better label Feb 2, 2022
@jdwhite48 jdwhite48 self-assigned this Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
restructure The API could be organized better
Projects
None yet
Development

No branches or pull requests

1 participant