We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
this check is not good enough: https://github.com/zksecurity/noname/blob/main/src/stdlib/native/int/lib.no#L17
fn Uint8.new(val: Field) -> Uint8 { let bit_len = 8; bits::check_field_size(bit_len);
why? Because when we multiply:
fn Uint8.mul(self, rhs: Uint8) -> Uint8 { return Uint8.new(self.inner * rhs.inner); }
we might return a value of 16 bits here. If our field modulus is 16 bits (or lower), then the multiplication might wrap around
so we need to check that the field modulus is 17 bits at least so it can contain the result of that multiplication
so I think it should be bits::assert_circuit_field_strictly_larger_than(bit_len * 2)
bits::assert_circuit_field_strictly_larger_than(bit_len * 2)
The text was updated successfully, but these errors were encountered:
katat
Successfully merging a pull request may close this issue.
this check is not good enough: https://github.com/zksecurity/noname/blob/main/src/stdlib/native/int/lib.no#L17
why? Because when we multiply:
we might return a value of 16 bits here. If our field modulus is 16 bits (or lower), then the multiplication might wrap around
so we need to check that the field modulus is 17 bits at least so it can contain the result of that multiplication
so I think it should be
bits::assert_circuit_field_strictly_larger_than(bit_len * 2)
The text was updated successfully, but these errors were encountered: