-
Notifications
You must be signed in to change notification settings - Fork 220
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
Add a number of bits in the modulus builtin function #549
Comments
Do you think it would be better to expose the modulus as a byte array or an array of u64? The modulus for This is another place where a big int impl native to Noir would be helpful. We could just have a |
For the original issue, I think a I'd prefer Looking at it again, getting the number of bits from the modulus byte array seems pretty cumbersome, so perhaps we should have both A bigint package seems like a good idea, perhaps we could put it into ACIR since the partial witness generator also requires BigInt and it could be re-exported. This requires another issue though for discussion methinks. |
This is good in my opinion. I originally did make a |
One point of clarification. If you look at PR #697, I made |
This actually is not possible yet as we do not have fully working slices. |
If the number of elements returned is truly unknown then we'd need true slices. I'm assuming though that it'd be known based on the the number of bits in the input type, in which case it'd be |
Do you mean known when the modulus bits array is passed to
|
Problem
Some applications may require knowledge of the number of bits in the modulus, which is known by the compiler.
Solution
Use a builtin attribute to expose the number of bits in the modulus. We can also expose the modulus as a byte array.
Alternatives considered
(Describe any alternative solutions you have considered.)
Additional context
(If applicable.)
The text was updated successfully, but these errors were encountered: