Skip to content
This repository has been archived by the owner on Feb 17, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants