-
Notifications
You must be signed in to change notification settings - Fork 108
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
Avoiding zero in bach muls #905
Comments
We systematize the work of #4751 to avoid scalar multiplication by 0, an issue that has arisen in various ways. In our case, the acir test `6_array` was reliably failing (failing the with `Trying to invert zero in the field`) about 1/256 of the time. The error was thrown from https://github.com/AztecProtocol/aztec-packages/blob/394a0e06928946c1c9eea1bdfec39269cb2d601a/barretenberg/cpp/src/barretenberg/ecc/groups/element_impl.hpp#L68 coming from this line in Zerormorph verification https://github.com/AztecProtocol/aztec-packages/blob/394a0e06928946c1c9eea1bdfec39269cb2d601a/barretenberg/cpp/src/barretenberg/commitment_schemes/zeromorph/zeromorph.hpp#L622 Spawning an issue to handle this situation more systmatically: AztecProtocol/barretenberg#905 The PR allowed the acir test to be run more than 512 times without any issue.
We systematize the work of AztecProtocol/aztec-packages#4751 to avoid scalar multiplication by 0, an issue that has arisen in various ways. In our case, the acir test `6_array` was reliably failing (failing the with `Trying to invert zero in the field`) about 1/256 of the time. The error was thrown from https://github.com/AztecProtocol/aztec-packages/blob/394a0e06928946c1c9eea1bdfec39269cb2d601a/barretenberg/cpp/src/barretenberg/ecc/groups/element_impl.hpp#L68 coming from this line in Zerormorph verification https://github.com/AztecProtocol/aztec-packages/blob/394a0e06928946c1c9eea1bdfec39269cb2d601a/barretenberg/cpp/src/barretenberg/commitment_schemes/zeromorph/zeromorph.hpp#L622 Spawning an issue to handle this situation more systmatically: #905 The PR allowed the acir test to be run more than 512 times without any issue.
The use of the |
As in the case of AztecProtocol/aztec-packages#5174, we sometimes encounter issues relating to our inability to handle scalar multiplication of EC points in the case where the scalar is 0. I believe: this could be fixed by simply checking whether
z==0
before https://github.com/AztecProtocol/aztec-packages/blob/394a0e06928946c1c9eea1bdfec39269cb2d601a/barretenberg/cpp/src/barretenberg/ecc/groups/element_impl.hpp#L68, but we avoid this because of the cost of the check. Someone should determine whether this is really a concern, and if it is, we should identify some hot code paths and use a more robust method outside of those cases.The text was updated successfully, but these errors were encountered: