Skip to content

Conversation

@siladu
Copy link
Contributor

@siladu siladu commented Oct 2, 2025

and fix issues found by tests

Heavily inspired by https://github.com/NethermindEth/int256

PR is built on top of #9188

thomas-quadratic and others added 14 commits September 30, 2025 19:33
Signed-off-by: Thomas Zamojski <[email protected]>
Following Ameziane's review and benchmarking, we decided to reinclude two elements.
Firstly, ModOperation itself should check if the modulus is zero, shortcutting the UInt256 constructor for the numerator.
Secondly, benchmarks should reincorporate the fully random test: number of bytes are chosen uniformly at random, and then bytes are filled uniformly at random.

Signed-off-by: Thomas Zamojski <[email protected]>
Benchmarks for different sizes and fully random inputs were added for addmod, similarly to mod's benchmarks.

Signed-off-by: Thomas Zamojski <[email protected]>
MulMod operation is accelerated using custom UInt256 custom implementation.

Signed-off-by: Thomas Zamojski <[email protected]>
Adds mulmod benchmarks, fixes spotless and fixes random seed in UInt256Test.

Signed-off-by: Thomas Zamojski <[email protected]>
Signed-off-by: Thomas Zamojski <[email protected]>
Signed-off-by: Thomas Zamojski <[email protected]>
Signed-off-by: Thomas Zamojski <[email protected]>
Fix bugs found by tests

Signed-off-by: Simon Dudley <[email protected]>
@siladu siladu force-pushed the uint256-op-modulus-parameterised-tests branch from f456ffc to 62c7946 Compare October 2, 2025 03:16
Signed-off-by: Simon Dudley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants