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

feat: add bandersnatch curve #128

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

dragan2234
Copy link

@dragan2234 dragan2234 commented Jun 18, 2024

Pull Request type

Adding bandersnatch parameters https://eprint.iacr.org/2021/1152.pdf

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Testing
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

Other information

@dragan2234 dragan2234 marked this pull request as draft June 18, 2024 19:05
@dragan2234 dragan2234 marked this pull request as ready for review June 19, 2024 11:34
hydra/definitions.py Outdated Show resolved Hide resolved
src/fustat/definitions.cairo Show resolved Hide resolved
hydra/definitions.py Outdated Show resolved Hide resolved
hydra/definitions.py Show resolved Hide resolved
@dragan2234
Copy link
Author

dragan2234 commented Jun 20, 2024

@feltroidprime Thanks for the review, I have addressed the comments! It should be fine now.

Strange thing is that msm for 1,2,3 points are fine with bandersantch, but 256 points is failing for some reason

@feltroidprime
Copy link
Collaborator

feltroidprime commented Jul 1, 2024

@feltroidprime Thanks for the review, I have addressed the comments! It should be fine now.

Strange thing is that msm for 1,2,3 points are fine with bandersantch, but 256 points is failing for some reason

Yes it is expected, circuits have been compiled for up to 3 points for the LHS of the equation to verify

func get_EVAL_FUNCTION_CHALLENGE_DUPL_circuit(curve_id: felt, n_points: felt) -> (

For the RHS, it supports any number of points as it calls the same circuit in a loop :

func compute_RHS_basis_sum{
but for the LHS we would need to modify the outputs / add an extra circuit to call in a loop to allow the LHS computation for arbitrary number of points
def _eval_function_challenge_dupl(
, depending on the number of coefficients in sum_dlog_div , see number of coefficients in function of n :
+ ( # F=a(x) + y b(x).
(1 + n_points) # Number of coefficients in a's numerator
+ (1 + n_points + 1) # Number of coefficients in a's denominator
+ (1 + n_points + 1) # Number of coefficients in b's numerator
+ (1 + n_points + 4) # Number of coefficients in b's denominator
)

For now, please just comment the n=256 line in the test so I can merge this, and we can add it later or make a specific n=256 circuit for it.

@dragan2234
Copy link
Author

@feltroidprime Thanks for the explanation, just commented out line for testing 256 points

@dragan2234
Copy link
Author

hi @feltroidprime can we merge this? I want to pull some benchmarks regarding proof costs/number of steps.

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.

None yet

2 participants