Skip to content

Conversation

@BlakeMScurr
Copy link

While I was exploring this library I noticed some simple improvements.

The main change is replacing the boolean logic in BigLessThan with bit manipulation, which removes 2 constraints if we're using 3 registers, and 4 if we're using 4.

All relevant tests are passing, though I didn't run the whole suite for fear of overheating my laptop.

Rather than using boolean logic, construct and compare two bit strings
which represent the registers where a > b, and where b > a respectively.

As well as simplifying the code, this removes 2 constraints where k=3
and 4 where k=4 for 256 bit big ints.
@BlakeMScurr BlakeMScurr changed the title Simplify code and make minor optimisations Simplify bigint and make minor optimisations Nov 30, 2022
@BlakeMScurr BlakeMScurr changed the title Simplify bigint and make minor optimisations Combine mux constraints and use simplified bitstring algorithm for BigLessThan. Dec 1, 2022
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.

1 participant