-
Notifications
You must be signed in to change notification settings - Fork 178
Affine infinity fix #139
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
Affine infinity fix #139
Conversation
|
|
||
| type_acc = update; | ||
|
|
||
| for _ in (i_step / 3)..(2 * i_step / 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could there be a case where depth > (i_step/3) but less than (2* i_step / 3) ? in that case it seems like execution of this loop will not be necessary.
for i_step = 12, it will not be the case, as the final loop has depth = 2 (=254 - 12n) so control won't flow to this branch so is not a problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes you are right. I knew it will not be problem for i_step=12 as you indicated but better include all possible cases properly. done.
…r mul and refactor
|
Thank you for looking into the issue! |
* add unsuccessful tests with small scalars * add affine infinity if checks to native groth16 and change doubling method * add affine infinity if checks to hinted groth16 and change doubling method * add affine infinity if checks to chunked groth16 and change doubling method * move if infinity checks in scalar mul to check_add and check_double functions * fix G1:affine is_zero_keep_element * fix the segment if-checks comparing depth and i_step in chunked scalar mul and refactor --------- Co-authored-by: sevkett12 <[email protected]>
This PR fixes the issue with affine infinity as the inputs of affine_add and affine_double functions. Also, T+(2^w-1)T logic is changed to w times doubling in G1 scalar multiplication. Slightly (around %6) increases the script size. This error occurs mainly for small public inputs so some tests covering this are added. Closes #137