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

Division by zero in blueprint_algebra_curves_plonk_variable_base_scalar_mul_test #381

Open
martun opened this issue May 20, 2024 · 2 comments
Assignees

Comments

@martun
Copy link
Contributor

martun commented May 20, 2024

We always had a division by zero in blueprint_algebra_curves_plonk_variable_base_scalar_mul_test, near

assignment.witness(component.W(7), i + 1) = (P[0].Y - Q.Y) * (P[0].X - Q.X).inversed();

in include/nil/blueprint/components/algebra/curves/pasta/plonk/variable_base_scalar_mul.hpp.

P[0].X - Q.X is zero because both P[0].X and Q.X are zero.

We never noticed it because of in multiprecision A / 0 = 0, here:

So all this time when asking for the inverse element of zero, we were getting zero back... With changes to multiprecision we get a segfault...

@SK0M0R0H
Copy link
Member

SK0M0R0H commented May 21, 2024

Not sure that I understand:

P[0].X - Q.X is zero because both P[0].X and Q.X are zero.

DO you mean P[0].X and Q.X are always zero or do you consider particular case when they're zeros?

@martun
Copy link
Contributor Author

martun commented May 21, 2024

@SK0M0R0H No, they are not always zero, they are sometimes zero for a particular input.

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

No branches or pull requests

3 participants