Skip to content
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: exp reverse bits in ir #1093

Merged
merged 13 commits into from
Jul 12, 2024
Merged

feat: exp reverse bits in ir #1093

merged 13 commits into from
Jul 12, 2024

Conversation

tqn
Copy link
Contributor

@tqn tqn commented Jul 12, 2024

Adds IR and circuit instructions for ExpReverseBits and HintBits (bit decomposition of a base field element).

Note: HintBits does not invoke a receive interaction on its inputs, but it invokes a send interaction on its output bits. One may believe that this means that values that are still used in the final computation may be written with zero multiplicity, but since every invocation of HintBits comes with assertions (see below), this is not true.

An alternative would be to receive all the inputs, but since the values are not being constrained for the HintBits operation itself, this seems kind of useless.

When an IR HintBits instruction is compiled, it yields many assert statements that constrain the result to be the bit decomposition. These constraints are untested, but I checked that they do in fact yield instructions. Additionally, I essentially just copy-pasted them, so they should work.

@tqn tqn requested review from jtguibas and erabinov and removed request for erabinov July 12, 2024 19:00
@tqn tqn marked this pull request as ready for review July 12, 2024 19:02
@tqn tqn merged commit f473fe4 into experimental Jul 12, 2024
5 of 6 checks passed
@tqn tqn deleted the tqn/ir-exp-reverse-bits branch July 12, 2024 20:12
0xWOLAND pushed a commit that referenced this pull request Aug 2, 2024
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