-
Notifications
You must be signed in to change notification settings - Fork 234
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
feat: Add support for uint256 to DSL bigint #5327
Conversation
Benchmark resultsMetrics with a significant change:
Detailed resultsAll benchmarks are run on txs on the This benchmark source data is available in JSON format on S3 here. Values are compared against data from master at commit L2 block published to L1Each column represents the number of txs on an L2 block published to L1.
L2 chain processingEach column represents the number of blocks on the L2 chain where each block has 16 txs.
Circuits statsStats on running time and I/O sizes collected for every circuit run across all benchmarks.
Tree insertion statsThe duration to insert a fixed batch of leaves into each tree type.
MiscellaneousTransaction sizes based on how many contract classes are registered in the tx.
Transaction size based on fee payment method
Transaction processing duration by data writes.
|
|
||
|
||
|
||
fn test_u256(mut x: [u8; 5], y: [u8; 5]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can put these test functions inside of the stdlib.
This is also not being run currently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is now called by the test.
I have not added it to stdlib test because I do not see any other test in the stdlib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noir/noir-repo/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/big_int.rs
Outdated
Show resolved
Hide resolved
Closing this as we've been told that crypto team isn't comfortable with the changes. |
uint256 in dsl big int are implemented by extending the bigfield class into bigfieldyn class, which is the same code, except that:
For now this class only works with 2^{256} modulus, but can be very easily extended to support any 256 bits (or less) prime.
Support for non-prime can be added with moderate effort. Only the witness generation part will need to be adapted because Montgomery multiplication does not work with power-of-2 limbs and even modulus.
In this PR, we simply use uint256_t for the witness generation.
I also added U256 in Noir stdlib